[FFmpeg-devel] [RFC] [PATCH] ffmpeg vsync
Sun Feb 8 04:24:01 CET 2009
Alexander Strange wrote:
> On Jan 28, 2009, at 5:41 PM, Baptiste Coudurier wrote:
>> Hi guys,
>> I was looking an do_video_out function in ffmpeg lately, and I spoted
>> this FIXME here since a long time.
>> I was wondering what exactly the goal to achieve for vdelta was.
>> In the perfect scenario, vdelta should be 0, this is what happen if
>> first pts == 0
>> Am I forgetting something ?
> I noticed the default vsync does the wrong thing for input files using
> h264 + B-pyramid;
In mp4 ? Ie with correct PTS information ?
> it duplicates the first frame because it thinks 2
> frames of decoder delay means a dropped frame. With this patch it does
> 2 duplicates instead, which is even worse. I didn't send a patch
> because I'm not quite sure what it's meant to do, or what the
> different -vsync options do.
Well with b pyramid, oftenly you have 2 frames delay. This might explain
the 2 duplicates, which is better than 1.
>> - else if (vdelta > 1.1)
>> - nb_frames = lrintf(vdelta);
>> + else if (vdelta > 0.5)
>> + nb_frames += lrintf(vdelta);
> Did you mean the +=?
Yes, nb_frames is 1, meaning it outputs 1 one frame.
If vdelta is 0, it adds no frames, if vdelta is 1 (which should mean 1
frame sync delta according to the code), it must duplicate 1 frame, ie
output 2 frames (nb_frames needs to be 2).
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer http://www.ffmpeg.org
More information about the ffmpeg-devel