Audio visualization video dump out of sync

Luis Garrido luisgarrido at users.sourceforge.net
Tue Jul 8 04:09:31 PDT 2014


Hi!

I have been experimenting with visualization capture using GStreamer 
0.10.36 for Ubuntu 12.04 LTS, based on this blog entry:

http://www.vidarholen.net/contents/blog/?p=23

The pipeline described there doesn't work for my gstreamer version, so I 
have adapted it until it looks like this:

gst-launch filesrc location=music.mp3 ! mp3parse ! avimux name=mux ! 
filesink location="output.avi" filesrc location=music.mp3 ! mp3parse ! 
mad ! audioconvert ! wavescope ! ffmpegcolorspace ! 
video/x-raw-yuv,width=256,height=128 ! x264enc ! mux.

It mostly works, save one small detail: the audio stream is 17.5 sec 
long, but the video stream is 26.7 sec, so it quickly falls out of sync 
with the audio.

I'll admit I'm far from grokking all the complexity involved in 
connecting all these modules. Anyway I have fiddled a bit with some 
options and modules that looked like they might be related, like 'sync', 
'framerate', audioresample, etc. I've also used GST_DEBUG=*:3 , but 
can't identify any clue.

Using monoscope will always generate a 35 sec video stream, so it is 
twice as slow as it should. Changing framerate doesn't have any effect.

Using wavescope I can accelerate the video by increasing framerate up to 
a certain poing. Using 76/1 I can get the closest, 17.6 sec of video, 
this is visually acceptable and I can decimate the stream to 24 fps 
afterwards. But 77/1 gets me again a 26.1 sec video stream.

Could someone kindly point me in the right direction?

Thanks in advance,

Luis



More information about the gstreamer-devel mailing list