Page 1 of 1

Desynchronization issue with FLV stream

Posted: 08 Feb 2011 15:11
by elesouef
Hi,

My goal is to stream from a bt878 acquisition card.

For testing purpose, I streamed really great a XVID file without desynchronization at all with the following command-line :

Code: Select all

--sout '#transcode{vcodec=FLV1,acodec=mp3,vb=2000,samplerate=44100,ab=96}:standard{access=http,mux=ffmpeg{mux=flv},dst=server.fqdn:8080/stream.flv}' --sout-keep
Now, I would like to stream from a bt878 card with the following command-line :

Code: Select all

cvlc -I dummy $VLC_DEV --sout '#transcode{vcodec=FLV1,acodec=mp3,vb=1000,samplerate=44100,ab=96,scale=0.5,vfilter={croppadd{cropbottom=10,cropleft=10,cropright=10}}}:standard{access=http,mux=ffmpeg{mux=flv},dst=server.fqdn:8080/stream.flv}' --sout-keep
with $VLC_DEV :

Code: Select all

VLC_DEV="v4l2:// :v4l2-dev='/dev/video0' :input-slave=alsa://hw:1,0 :v4l2-standard=0:v4l2-standard=0 :v4l2-chroma= :v4l2-input=3 :v4l2-audio-input=0 :v4l2-io=0 :v4l2-width=-1 :v4l2-height=-1 :v4l2-aspect-ratio=4\:3 :v4l2-fps=0 :v4l2-caching=1000 :v4l2-tuner=0 :v4l2-tuner-frequency=-1 :v4l2-tuner-audio-mode=0 :no-v4l2-controls-reset :v4l2-brightness=-1 :v4l2-contrast=-1 :v4l2-saturation=-1 :v4l2-hue=-1 :v4l2-black-level=-1 :v4l2-auto-white-balance=-1 :v4l2-do-white-balance=-1 :v4l2-red-balance=-1 :v4l2-blue-balance=-1 :v4l2-gamma=-1 :v4l2-exposure=-1 :v4l2-autogain=-1 :v4l2-gain=-1 :v4l2-hflip=-1 :v4l2-vflip=-1 :v4l2-hcenter=-1 :v4l2-vcenter=-1 :v4l2-audio-volume=-1 :v4l2-audio-balance=-1 :no-v4l2-audio-mute :v4l2-audio-bass=-1 :v4l2-audio-treble=-1 :v4l2-audio-loudness=-1 :v4l2-set-ctrls= :file-caching=300"
After almost half an hour, sound is in advance from 1 second to the image...

Do you know what can cause this ?

Thank you very much for your help.

Re: Desynchronization issue with FLV stream

Posted: 08 Feb 2011 18:50
by RĂ©mi Denis-Courmont
"Normally", if the desync comes from within VLC, the slowest of the two elementary stream will completely drop out of the mux. In this case, it looks more like you audio hardware is drifting away from system clock :-( Then I have no ideas how to fix it.

Re: Desynchronization issue with FLV stream

Posted: 09 Feb 2011 08:50
by elesouef
Thanks for replying.

An idea : is it possible, if I enable the rc interface, to tell vlc to "resync" or to "make the audio stream" be N seconds in advance, therefore getting a "false resync" ?

Re: Desynchronization issue with FLV stream

Posted: 09 Feb 2011 14:36
by elesouef
Ok, did some more tests :

Common basis : VLC 1.1.7 compiled under debian 6.0 with ffmpeg 0.6.1 source tree as PKG_PATH_AVCODEC.

Configuration 1 : Dell Precision T3500 with Asus MyCinema PCTV Acquisition Card. The FLV stream is desynchronized after 2 hours of streaming. Audio is late by 3 seconds.

Configuration 2 : Dell Precision T3500 with Hauppauge Acquisition Card and Motherboard Sound Card as sound acquisition. Almost the same latency.

What can I do to solve this issue ? Any idea would be greatly appreciated.

Re: Desynchronization issue with FLV stream

Posted: 09 Feb 2011 15:25
by Greg
There are several posts relating to audio sync (or desync )
Eg. This one
viewtopic.php?f=4&t=87254

Follow the threads and sub links in the above link for others. Might save you some time experimenting?
I don't think there is a solution at the moment