[Ffmpeg-devel] [PATCH] New grabbing interface
Wed Jan 31 22:23:14 CET 2007
On Wed, 2007-01-31 at 17:56 -0200, ramiro at lisha.ufsc.br wrote:
> I have a question regarding input_sync in ffmpeg.c:
> What does it do?
If I remember well, I was the one introducing it.
It helps audio-video synchronization (avoiding skipped video frames)
when capturing from video4linux and OSS. In this case, audio and video
come from two different inputs, so when reading an input frame ffmpeg
must decide which input to read from. Generally, it use output PTSs to
decide, but in this cases input PTSs are more appropriate.
video4linux2 input provides a better synchronization (because v4l2
associates a proper timestamp to video frames), so when using
video4linux2 input_sync is less important.
> , and why isn't it initialized to 0?
Well, I think the real question is: why are all the other static
variables initialized to 0? AFAIK, a static global variable is stored in
the BSS, so it is automatically zeroed on program loading...
So, initializing it to 0 only increases the executable file size.
> It's not used anymore
> (it was only by prepare_grab, and not by -grab), but I don't know if I
> should adapt it or remove it.
It should be set to 1 when capturing audio and video from 2 different
devices (for example, from video4linux(2) and OSS, but not from DV)
I do not kno what -grab does, so I cannot comment on it...
More information about the ffmpeg-devel