[MPlayer-dev-eng] [PATCH] Better double frame rate output and frame limit option.

Vicente Sendra visenri at yahoo.es
Mon Dec 31 19:33:56 CET 2012


--- El sáb, 29/12/12, Andy Furniss <andyqos at ukfsn.org> escribió:
 
> I tried a longer version of the sample I previously uploaded
> and linked in previous reply -
> 
> http://www.andyqos.ukfsn.org/judder.m2ts
>  
> If I play it with -demuxer lavf (which I would always do for
> ts/m2ts as it tends to get the right sound track and better
> lipsync) it's quite broken.
> 
> Initially it starts by alternating 10 sec turns of sound
> then video - ie if there is sound video pauses, when video
> resumes sound stops this continues for the first 70 seconds,
> then both play together but well out of sync, which takes
> another minute to sort.
> 
> Without -demuxer lavf it seems Ok.
> 
> This happens regardless of -vo or vsync settings or audio
> track selected.
> 
> I have not tried any new options/filters yet, this is just
> playing a 24fps file on a 60Hz monitor with -framedrop.

I found the problem, it was related to my comment:

>  In correct-pts mode full_frame should be used to check if frame is 
>  complete and not an interlaced frame.

But it is not limited to interlaced frames, some times decode_video returns without a complete frame because it has decoded a frame it needs but it is not the actual frame.

I declared full_frame in generate_video_frame and changed code as follows:

decoded_frame  = decode_video(sh_video, start, in_size, drop_frame, pts, &full_frame);

        if (decoded_frame) {
            ....
        } else {
            if(full_frame){
                *frame_time = calculate_frame_time_by_pts(sh_video,0);
                process_framedrop(0,*frame_time,drop_frame);
                break;
            }
        }

We do frame stuff only if full frame.
In your sample, calculate_frame_time_by_pts was called for some frames that were not a full_frame, and this resulted in an incorrect mpctx->delay.

(note: the demuxer lavf activates correct_pts by default, so you get correct_pts mode even if not specified)

The file attached is the new updated patch.

PD: happy new year!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer.c.diff
Type: application/octet-stream
Size: 47431 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20121231/9e7e183f/attachment-0001.obj>


More information about the MPlayer-dev-eng mailing list