[FFmpeg-devel] [RFC] [PATCH] ffmpeg vsync

Ivan Schreter schreter
Thu Jan 29 07:57:15 CET 2009

Baptiste Coudurier wrote:
> [...]
> 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 ?
Interlaced video maybe? Where two fields are possibly 0.5 frame duration 
apart? From my gut feeling, I'd say something like +- 0.6 would be correct.

OTOH, av_read_frame() should read whole frame (i.e., both fields) and 
thus assign only single DTS/PTS to a frame, so vdelta should be close to 
zero. Positively, H.264 decoder has IMHO a bug here, requiring two 
av_read_frames() to actually read enough data for one frame of 
interlaced video coded as field pictures. Second frame comes without 
DTS/PTS, which assigns DTS/PTS of the _next_ frame to the second field 
of current frame, thus bringing the timing out of sync.

I'm working on this, but I'm kind of stuck, since I'm missing answers to 
some of my questions, especially, if this is really a bug in H.264 
parser (not returning whole frames, but half-frames)...



More information about the ffmpeg-devel mailing list