audio/video out of sync

Tim Müller tim at centricular.com
Thu Jan 28 02:06:32 PST 2016


On Wed, 2016-01-27 at 16:32 -0800, Robert Armstrong wrote:

Hi,

> The audio is about half a second behind with this pipeline. I've
> tried removing and adding queues in various places but nothing seems
> to resolve it.
> 
> gst-launch-1.0 -e v4l2src device=/dev/video1 do-timestamp=true !
> queue ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse
> ! queue ! mux.video_0 alsasrc device="plughw:2,0" ! audioconvert !
> lamemp3enc ! queue ! mux. mp4mux name=mux ! filesink sync=true
> location=camera.mp4
> 
> What else can I do to fix it?

Which version of GStreamer is this with?

Pipeline looks fine in principle. You shouldn't need the do-
timestamp=true on v4l2src.

Is the video in sync if you capture video/x-raw from the camera and
then encode it with x264enc tune=zerolatency ?

How far off is it? And is it a constant offset or does it increase over
time?

I suspect perhaps there's an encoding delay inside the device if the
camera outputs H264 that's not taken into account.

You could also try a different audio encoder such as voaacenc, I seem
to remember an issue where lamemp3enc would timestamp things wrongly
over time (but it's unlikely you're using a version that old I think,
it was fixed in 1.2).

Cheers
 -Tim
-- 
Tim Müller, Centricular Ltd - http://www.centricular.com




More information about the gstreamer-devel mailing list