[MPlayer-dev-eng] Better double frame rate output and framedrop

Vicente Sendra visenri at yahoo.es
Sun Oct 28 21:58:23 CET 2012


--- El lun, 22/10/12, Andy Furniss <andyqos at ukfsn.org> escribió:

> De: Andy Furniss <andyqos at ukfsn.org>
> Asunto: Re: [MPlayer-dev-eng] [PATCH] deinterlace property fix
> Para: mplayer-dev-eng at mplayerhq.hu
> CC: "Vicente Sendra" <visenri at yahoo.es>
> Fecha: lunes, 22 de octubre, 2012 01:50
> Vicente Sendra wrote:
> > --- El sáb, 20/10/12, Andy Furniss wrote:
> >
> >> De: Andy Furniss <andyqos at ukfsn.org>
> >> Asunto: Re: [MPlayer-dev-eng] [PATCH] deinterlace
> property fix
> >> Para: mplayer-dev-eng at mplayerhq.hu
> >> CC: "Vicente Sendra" <visenri at yahoo.es>
> >> Fecha: sábado, 20 de octubre, 2012 22:33
> >> Vicente Sendra wrote:
> >>> I've previously send a fix for command.c in:
> >>> Better double frame rate output and framedrop
> >>>
> >>> But there was a bug in my code.
> >>>
> >>> This new one fixes old problem:
> >>>
> >>> Better handling of deinterlace property,
> returns
> >> M_PROPERTY_ERROR if it can't be changed (or read),
> and
> >> displays osd value correctly (when change was not
> successful
> >> it showed the opposite value).
> >>>
> >>> And my bug:
> >>>
> >>> if VFCTRL_GET_DEINTERLACE was not successfull,
> >> deinterlace value was undefined.
> >>>
> >>> I send it as a separate fix, as it's unrelated
> to new
> >> framedrop system.
> >>
> >> I am interested in your work as I have been trying
> to get
> >> field rate = refresh to work recently (I am sure
> long ago it
> >> worked better than now, but this may be radeon/mesa
> related
> >> rather than mplayer - or perhaps my test cases
> were
> >> easier).
> >>
> >> Testing your framedrop patches + this one I see a
> problem
> >> with -vo gl (I am not deinterlacing).
> >>
> >> A 50fps progressive HD file speeded up to 60fps to
> match
> >> refresh works with vanilla mplayer, but drops lots
> of frames
> >> with your patches.
> >>
> >> vblank_mode=2 mplayer -cache 20000 -demuxer lavf
> -speed
> >> 30/25 -fs -lavdopts threads=4 -vo gl -framedrop
> samp50p.mkv
> >>
> >> One other thing - to deinterlace HD although I have
> 4x
> >> 3.4Ghz CPUs I only really expect to be able to use
> tfields=0
> >> or preferably -vo vdpau:deint=2 (radeon not nvidia
> - not
> >> available without mesa hack) so if you plan on
> continuing
> >> this good work maybe vdpau code needs a patch as
> well.
> >
> > Is it dropping frames if you play at it's normal speed
> (50fps)?
> 
> Yes and the sample below that I already had uploaded from a
> previous 
> issue is 24 fps and also shows it.
> 
> > What screen refresh rate are you using?, if you are
> using 60fps (and playing at 60fps), my new frame drop system
> drops frames every now and then (on my system, 1-2 frames
> every 2-3 seconds), this is normal, because mplayer timing
> is not exactly equal to the screen refresh rate, and we have
> to drop some frames to compensate for this little
> difference.
> 
> it is 60fps but I get a lot more than a few drops.
> 
> > New frame drop system assumes that page flip should
> take almost 0 time, if page flip takes too much compared to
> total frame time, it stats dropping frames.
> 
> Maybe this is the problem - could be a radeon r600 specific
> thing, but 
> then I haven't had time to test properly yet.
> 
> What little testing I have done it seems mpeg2 sd are OK,
> and a 720p 
> h264 avi is OK, but anything else HD I have is affected -
> h264 
> mov,ts,m2ts or mkv (made from ts).
> 
> > Can i have access to your samples?
> 
> http://www.andyqos.ukfsn.org/judder.m2ts
> 
> I am a bit short of space for anything bigger.
> 
> Here's the output I get for that sample before and after the
> four 
> patches in your other post (obviously this patch doesn't
> apply any more 
> now part of it is in).
> 
> You can see lots of drops and it looks terrible post
> patches.
> 
> mpn is a bash alias I use to run from source tree it's -
> /home/andy/Src/Mplayer-svn/mplayer/mplayer -ao alsa
> 
> The ATTENTIONs are just because I have vblank_mode set to 0
> in my ~/.drirc
> 
> bash-3.2$ vblank_mode=2 mpn -fs -vo gl -lavdopts threads=4
> -framedrop 
> judder.m2ts
> MPlayer SVN-r35265-4.2.3 (C) 2000-2012 MPlayer Team
> mplayer: could not connect to socket
> mplayer: No such file or directory
> Failed to open LIRC support. You will not be able to use
> your remote 
> control.
> 
> Playing judder.m2ts.
> libavformat version 54.33.100 (internal)
> TS file format detected.
> VIDEO H264(pid=4113) AUDIO A52(pid=4353) NO SUBS
> (yet)!  PROGRAM N. 1
> FPS seems to be: 23.976025
> Load subtitles in ./
> ATTENTION: default value of option vblank_mode overridden by
> environment.
> ATTENTION: default value of option vblank_mode overridden by
> environment.
> ATTENTION: option value of option vblank_mode ignored.
> [gl] using extended formats. Use -vo gl:nomanyfmts if
> playback fails.
> ==========================================================================
> Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec
> family
> libavcodec version 54.68.100 (internal)
> Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
> ==========================================================================
> ==========================================================================
> Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio
> decoders
> AUDIO: 48000 Hz, 2 ch, s16le, 640.0 kbit/41.67% (ratio:
> 80000->192000)
> Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
> ==========================================================================
> AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
> Starting playback...
> Unsupported PixelFormat 61
> Unsupported PixelFormat 53
> Unsupported PixelFormat 81
> Movie-Aspect is undefined - no prescaling applied.
> VO: [gl] 1920x1088 => 1920x1088 Planar YV12  [fs]
> Mesa: User error: GL_INVALID_ENUM in 
> glTexParameter(pname=GL_TEXTURE_STORAGE_HINT_APPLE)
> [ASPECT] Warning: No suitable new res found!
> [ASPECT] Warning: No suitable new res found!
> Movie-Aspect is 1.78:1 - prescaling to correct movie
> aspect.
> VO: [gl] 1920x1080 => 1920x1080 Planar YV12  [fs]
> A:  11.8 V:  11.9 A-V: -0.123 ct: 
> 0.000   8/  8 ??% ??% ??,?% 1 0
> Dropping frame with size not matching configured size
> A:  22.6 V:  22.7 A-V: -0.104 ct: -0.301
> 264/264  2% 35%  1.1% 2 0
> [ac3 @ 0x8a36260]incomplete frame
> A:  22.9 V:  23.5 A-V: -0.603 ct: -0.394
> 284/284  2% 35%  1.0% 2 0
> 
> 
> Exiting... (End of file)
> 
> 
> bash-3.2$ vblank_mode=2 mpn -fs -vo gl -lavdopts threads=4
> -framedrop 
> judder.m2ts
> MPlayer SVN-r35265-4.2.3 (C) 2000-2012 MPlayer Team
> mplayer: could not connect to socket
> mplayer: No such file or directory
> Failed to open LIRC support. You will not be able to use
> your remote 
> control.
> 
> Playing judder.m2ts.
> libavformat version 54.33.100 (internal)
> TS file format detected.
> VIDEO H264(pid=4113) AUDIO A52(pid=4353) NO SUBS
> (yet)!  PROGRAM N. 1
> FPS seems to be: 23.976025
> Load subtitles in ./
> ATTENTION: default value of option vblank_mode overridden by
> environment.
> ATTENTION: default value of option vblank_mode overridden by
> environment.
> ATTENTION: option value of option vblank_mode ignored.
> [gl] using extended formats. Use -vo gl:nomanyfmts if
> playback fails.
> ==========================================================================
> Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec
> family
> libavcodec version 54.68.100 (internal)
> Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
> ==========================================================================
> ==========================================================================
> Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio
> decoders
> AUDIO: 48000 Hz, 2 ch, s16le, 640.0 kbit/41.67% (ratio:
> 80000->192000)
> Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
> ==========================================================================
> AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
> Starting playback...
> Unsupported PixelFormat 61
> Unsupported PixelFormat 53
> Unsupported PixelFormat 81
> Movie-Aspect is undefined - no prescaling applied.
> VO: [gl] 1920x1088 => 1920x1088 Planar YV12  [fs]
> Mesa: User error: GL_INVALID_ENUM in 
> glTexParameter(pname=GL_TEXTURE_STORAGE_HINT_APPLE)
> [ASPECT] Warning: No suitable new res found!
> [ASPECT] Warning: No suitable new res found!
> Movie-Aspect is 1.78:1 - prescaling to correct movie
> aspect.
> VO: [gl] 1920x1080 => 1920x1080 Planar YV12  [fs]
> A:  11.8 V:  11.9 A-V: -0.133 ct: 
> 0.000   8/  8 ??% ??% ??,?% 1 0
> Dropping frame with size not matching configured size
> A:  22.7 V:  23.5 A-V: -0.790 ct: -1.001
> 284/284  2% 20%  1.0% 130 0
> [ac3 @ 0x8a365c0]incomplete frame
> A:  22.8 V:  23.5 A-V: -0.623 ct: -1.022
> 284/284  2% 20%  1.0% 130 0

I can't reproduce this behaviour on any of my machines:

My desktop is a little outdated cpu (single core p4 3Ghz), and doesn't have enough power to decode your file (drops a lot of frames, but not because of new framedrop system, it drops them to get correct a-v sync).

One of my laptops (core2 duo) play it flawlessly with :
-cache 2000  -vo gl -framedrop -lavdopts threads=2 judder.m2ts
or
-cache 2000  -vo directx -framedrop -lavdopts threads=2 judder.m2ts

The other laptop (celeron @2ghz) plays it but drops frames (same behaviour as desktop machine).
-cache 2000  -vo gl -framedrop -lavdopts fast:skiploopfilter=nonkey judder.m2ts


To better understand why your system drops so much frames:

Check cpu usage, i think it should not be a problem as long as you use threads=4.

To know the reason why each frame was dropped uncomment the lines following:

"// uncomment to debug framedropper"

To get more detailed information about framedropping change the lines that output video time usage by these ones¨:

search for line with comment "// CPU usage", around line 1260

    if (sh_video) {
        if (sh_video->timer > 0.5)
            saddf(line, &pos, width, "%3.0f %3.0f %3.0f ",
                  video_frame_time_usage*1000,
                  vflip_frame_time_usage*1000,
                  vout_frame_time*1000);


you'll get lines like this:

A:  14.2 V:  14.3 A-V: -0.164 ct: -0.192  62/ 62  34   0  39 31 0 50%

34   -> video_frame_time_usage (should be lower than frame time: 41.6ms)
0 -> vflip_frame_time_usage (should be close to 0)
39  -> vout_frame_time (should be close to frame time, but gets bigger when dropping frames, it shows the time between output frames).


vflip_frame_time_usage must be greater than 10% of frame time to start dropping frames, 4ms in this case.

If this time is normally bigger than this 10% i can change the code to get the lowest value of vflip_frame_time_usage and use the value of vflip_frame_time_usage - vflip_lowest_frame_time_usage to do the calculations. 

Please check the changes i suggest and give me some feedback.

I changed the subject to related patch ("Better double frame rate output and framedrop"), please use this one as this problem is not related to "[PATCH] deinterlace property fix".




More information about the MPlayer-dev-eng mailing list