[gst-devel] How to syncronize audio and video

Thabelo Mmbengeni thabelo at gmail.com
Mon Jun 22 16:17:19 CEST 2009


Here are the sinks and sources of the gstrtpbin, each session has its own
id.
Also look at script file attached for example


GObject
 +----GstObject
       +----GstElement
             +----GstBin
                   +----GstRtpBin

Implemented Interfaces:
  GstChildProxy

Pad Templates:
  SINK template: 'recv_rtp_sink_%d'
    Availability: On request
      Has request_new_pad() function: gst_rtp_bin_request_new_pad
    Capabilities:
      application/x-rtp

  SINK template: 'recv_rtcp_sink_%d'
    Availability: On request
      Has request_new_pad() function: gst_rtp_bin_request_new_pad
    Capabilities:
      application/x-rtcp

  SINK template: 'send_rtp_sink_%d'
    Availability: On request
      Has request_new_pad() function: gst_rtp_bin_request_new_pad
    Capabilities:
      application/x-rtp

  SRC template: 'recv_rtp_src_%d_%d_%d'
    Availability: Sometimes
    Capabilities:
      application/x-rtp

  SRC template: 'send_rtcp_src_%d'
    Availability: On request
      Has request_new_pad() function: gst_rtp_bin_request_new_pad
    Capabilities:
      application/x-rtcp

  SRC template: 'send_rtp_src_%d'
    Availability: Sometimes
    Capabilities:
      application/x-rtp




On Mon, Jun 22, 2009 at 2:11 PM, Zelalem Sintayehu <zelalems at hotmail.com>wrote:

>  Hi Thabelo, thank you for your response. BTW, my problem is not on the
> source side. It is on the receiver side. You know when i see the file that i
> saved in it is very unsynchronized. Eventually I want to use my program to
> save streams that are comming from the network. So, I am only intersting on
> the recieving side.  Anyway, I will try to use gstrtpbin if it solves the
> problem. BTW, how can i put the two differnet streams in teh bin?
>
> Thank you again.
>
> - Zelalem S.
>
> ------------------------------
> Date: Mon, 22 Jun 2009 12:14:41 +0200
> From: thabelo at gmail.com
> To: gstreamer-devel at lists.sourceforge.net
> Subject: Re: [gst-devel] How to syncronize audio and video
>
>
> Try using the "gstrtpbin" it works, checkout the documentation on the
> gstreamer site.
>
> eg  Your source can be something like
>
> source -> encode -> payload -> gstrtpbin -> rtpsink(udp)
>
>
> On Mon, Jun 22, 2009 at 9:45 AM, Zelalem Sintayehu <zelalems at hotmail.com>wrote:
>
>  Hi all, I wanted to save a networked stream in an avi file and I got a
> very unsynchronized file. The audio finishes almost 3 second ahead of the
> video. I even used the sync=true option for the filesink element, but the
> result is the same. So, I want to ask an advice on how to get a synchronized
> video file. The following is the source and destination commands that I
> used:
>
> 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;
>
> Do you think the result will be different if I use a different file
> container (like mp4) instead of avi?
>
> Thank you.
>
> - Zelalem S.
>
>
>
>
>
> ------------------------------
> See all the ways you can stay connected to friends and family<http://www.microsoft.com/windows/windowslive/default.aspx>
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge
> conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference:
> $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
>
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
> ------------------------------
> What can you do with the new Windows Live? Find out<http://www.microsoft.com/windows/windowslive/default.aspx>
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge
> conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference:
> $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
>
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090622/8d3a6413/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client-H264-PCMA.sdp
Type: application/vnd.stardivision.impress
Size: 235 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090622/8d3a6413/attachment.sdd>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server-v4l2-H264-alsasrc-PCMA.sh
Type: application/x-sh
Size: 4161 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090622/8d3a6413/attachment.sh>


More information about the gstreamer-devel mailing list