[gst-devel] video playback fast (record with v4l2src)

Thomas Vander Stichele thomas at apestaart.org
Thu Sep 21 10:47:34 CEST 2006


Hi,


> I also have a TV tuner here, and v4l2 set the caps correctly 30000/1001 
> for NTSC. (so where is the problem? with drops?)

While the exact number sounds comforting, don't forget that this doesn't
mean all that much.  The card will be aproximately giving you this
framerate according to *its internal clock* which at the end of the day
is just a crystal that doesn't know about all its crystal friends out in
the world.  Your sound card has the same thing.

So in a nutshell - if you trust your TV card to give you 30000/1001
frames per second, and your sound card 44100 samples per second, but
they do not agree on how long a second is (which you are pretty much
guaranteed), you *will* go out of sync.

The only way to do this correctly is to timestamp captures from separate
devices according to a common clock.  These can be:
- "imaginary" clocks: you can timestamp using the system clock (but then
you need to take into account the deltas between start of capture and
getting the sample in user space)
- slaved clocks: you can take either source as a "master clock" and
trust its view of a second, then timestamp the other devices using
samples from this master clock (again, you need to take into account
various deltas)
- synchronized real clocks: higher-end hardware allows being driven by
an external clock, like an SMPTE word clock

Hope that explains it,

Thomas





More information about the gstreamer-devel mailing list