Help with getting audio and video synced

J dreadpiratejeff at gmail.com
Wed Oct 26 08:49:38 PDT 2011


First, let me preface this with this: I've never really messed with
gstreamer before, and I am currently trying to fix a bug in a test
tool that was written ages ago by someone else that happens to use the
gstreamer python bindings.

I'm working on updating a testing tool that essentially records a
brief video from a laptop webcam and audio from the onboard sound
device, combines them into an AVI and then replays to verify that they
work.

There are a couple issues with this:

The default video resolution is 640x480 and at that res the video is
very choppy and almost unusable.  I can fix this by reducing it to
320x240, however at this resolution the video playback is too fast (it
seems to be played at double speed)

The audio seems to record just fine but in the final avi file, the
audio is out of sync completely from the video.

I can recreate this manually using gst-launch as follows:

gst-launch autoaudiosrc ! audio/x-raw-int,rate=44100,channels=2 !
multiqueue ! mux. autovideosrc ! video/x-raw-yuv,width=320,height=240
! multiqueue ! mux. avimux name=mux ! filesink location=test.avi

Record for a few seconds then ctrl-c to quit, and play the video uisng totem.

For the record, I'm using gstreamer0.10 on Ubuntu 11.04 but this
occurs on many other versions so I'm pretty sure it's not an os issue,
but more an issue with how the file is being built.

So can someone help me tweak this to get the audio synced with the
video? As I mentioned before, I'm working on a bug in a python script
that does all this, but the issues I'm seeing are very easily
reproducible from CLI using gst-launch.

Thanks,

Jeff


More information about the gstreamer-devel mailing list