[gst-devel] Video and Audio Synchronization Problem.

Zelalem Sintayehu zelalems at hotmail.com
Fri Jun 19 14:51:42 CEST 2009


Hi all, I have been trying to write a program to record video and audio over a network. Independently (I mean creating the video and audio files alone) they are working very nicely, but when I mix them and tried to to save them in one file, I got a very unsynchronized file. The audio finishes almost 3 second ahead of the video (un synchronized by 3 seconds). I even used the sync=true option for the filesink element, but the result is the same. Please give me your ideas on what I should do to get a synchronized video file. Do you think the result will be different if I use a different file container (like mp4) instead of avi? The following is the source and destination commands:

Source commands:
for the audio channel
gst-launch-0.10 -v alsasrc ! queue ! audio/x-raw-int,rate=8000,channels=1,depth=8 ! audioconvert ! alawenc !  rtppcmapay ! queue ! udpsink port=5002
for the video channel;
gst-launch v4l2src ! video/x-raw-rgb,width=320,height=240 ! queue ! videorate ! video/x-raw-rgb,rate=15/1 ! ffmpegcolorspace! ffenc_h263p ! rtph263ppay ! udpsink port=5000

Output command
gst-launch-0.10 -v avimux name=mux ! filesink location=videoandaudio.avi sync=true {udpsrc port=5000 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H263-1998" num-buffers=5000 ! queue ! rtph263pdepay ! 'video/x-h263,width=320,height=240,framerate=(fraction)25/1' ! queue} ! mux.video_0 {udpsrc port=5002 caps="application/x-rtp,media=(string)audio,payload=(int)96, rate=(int)8000, encoding-name=(string)PCMA" ! queue ! rtppcmadepay ! 'audio/x-alaw, rate=(int)8000, channels=(int)1' ! queue} ! mux.audio_0;

Thank you.

- Zelalem S. 





_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090619/397da2fa/attachment.htm>


More information about the gstreamer-devel mailing list