[gst-devel] A/V sync issues with multiple dv1394src sources

Jerome Alet alet at librelogiciel.com
Tue Apr 3 14:02:20 CEST 2007

Hi there,

as part of my Boxtream project (http://cortex.unice.fr/~jerome/boxtream/)
I've encountered an A/V sync problem which happens in some cases only,
but is easily reproductible.

Basically I've got one dv1394src which is always active and onto which
is plugged both the output of a scan converter and an audio feed.
I've got another dv1394src onto which is plugged the very same audio
feed (through an Y cable), and the output of a composite video switcher
(through an analog-to-dv converter)

Both DV input streams are first saved into DV files (filesink) and
at the same time split (tee) and feed into a set of Ogg/Theora + 
Ogg/Vorbis encoders and streamers.

Whenever I use both DV inputs, and I switch from one input to another 
one on the video switcher, a small A/V sync problem is introduced,
which grows each time I switch to another input. This is probably
because despite me setting the analog-to-dv converter into always-on
mode, the video switch introduces a glitch in the stream but only
on only one of the DV inputs, so both of them are from then on not in sync
anymore. It is remarkable to note that both DV files on disk are
perfectly in sync.

When I use a single dv1394src there's no problem at all, even if I 
switch analog inputs on the switcher like I'm crazy, so clearly
the problem seems to be in gstreamer sync handling somewhere where several
dv1394src are used.

Alternatively, if instead of using two dv1394src I use a single one 
and an analog frame grabber through v4l2src (even if it is not the 
one used to capture the output of the composite video switcher),
then there's no problem either.

Finally, if I still use the two dv1394src inputs but don't switch
anymore on the video switcher, there's no A/V sync issue either.

So the problem is linked to the use of two (or more?) dv1394src.

I've noticed a big improvement on the situation when using better
analog-to-dv converters, where the A/V sync gap is much smaller
with more costly products, but still not perfect.

The obvious but costly solution is to genlock all sources before 
plugging them into the composite video switcher, and in fact it 
works perfectly fine with no A/V sync issue if I plug them into a 
video mixer (Panasonic MX50) and use the mixer's output as the
input to my analog-to-dv converter. So I could genlock all inputs
or add a TBC stage and all would be fine, excepted for one thing :
the cost. Also not all sources we want to use have genlock input,
so the multi-input TBC might be the only hardware solution possible,
just in front of the composite video switcher.

So my question is : I know the problem might be more an hardware 
problem than a gstreamer-only problem, but anyway is there a 
gstreamer solution for such a problem ? 

Could this be that one of the dv1394src is not temporarily stopped
while the other receives a new input from the video switcher (which
probably arrives sometimes during a frame because there's no genlock) ?

Thanks in advance for any help on this issue.


Jerome Alet

More information about the gstreamer-devel mailing list