[gst-devel] Problem with changing command line command to code

Zelalem Sintayehu zelalems at hotmail.com
Tue Jun 23 16:02:40 CEST 2009

Hi Thabelo, thank you for your response. I requested a sink for both audio and video and linked it to avimux as follows:
gst_pad_link (gst_element_get_pad (h263depay, "src"),
        gst_element_get_pad (avimuxer, "video_0"));

gst_pad_link (gst_element_get_pad (pcmadepay, "src"),
        gst_element_get_pad (avimuxer, "audio_0"));

But the result is the same. It creates the file but the file is empty.  BTW, i had used gst_element_link_filtered instead of the above statements previously.

- Zelalem S. 

Date: Tue, 23 Jun 2009 13:42:09 +0200
From: thabelo at gmail.com
To: gstreamer-devel at lists.sourceforge.net
Subject: Re: [gst-devel] Problem with changing command line command to code

request Sink pad of your avimux, link it to your audiobin.

use gst-inspect "ELEMENT_TO_VIEW"  to view your element pads, some of them aren't always available. some are dynamic. 
Hope that helps.  

On Tue, Jun 23, 2009 at 1:00 PM, Zelalem Sintayehu <zelalems at hotmail.com> wrote:

Hi all, I had a command line command that copies video streams from a network into a file. When I try to change it to a code I face with problem. There is no error and the file is created but the content of the file is empty. I have also used sync=FALSE for the filesink element. I used two bins one for the audio and another for the video and then put the two bins and the avimux and filesink in the pipeline and started the pipepline. I even checked the state of the pipeline and it is in running state, but the file is empty. Pease help me. The following is the case:

I wanted to change the following into a code:
gst-launch-0.10 -v avimux
name=mux ! filesink location=videoandaudio.avi sync=true {udpsrc
num-buffers=5000 ! queue ! rtph263pdepay !
'video/x-h263,width=320,height=240,framerate=(fraction)25/1' ! queue} !
mux.video_0 {udpsrc port=5002
rate=(int)8000, encoding-name=(string)PCMA" ! queue ! rtppcmadepay !
'audio/x-alaw, rate=(int)8000, channels=(int)1' ! queue} ! mux.audio_0;

And the following is what I did:
 gst_bin_add_many (GST_BIN (audbin),
            udpsource_audio, queue_audio, pcmadepay, NULL);

  gst_bin_add_many (GST_BIN (vidbin),
            udpsource_video, queue_video_1, h263depay, NULL);
  gst_bin_add_many (GST_BIN (pipeline), vidbin, audbin,
            avimuxer, filedes,  NULL);

  gst_element_link_many (udpsource_video, queue_video_1, h263depay, NULL);

  gboolean link_ok_video = gst_element_link_filtered (h263depay, avimuxer, caps_video_2);  

 gst_element_link_many (udpsource_audio, queue_audio, pcmadepay, NULL);
 gboolean link_ok_audio = gst_element_link_filtered (pcmadepay, avimuxer, caps_audio_2);

 gst_element_link_many (avimuxer, filedes, NULL);

 gboolean pipstate=gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);

Thank you.

- Zelalem S. 

Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it!


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!


gstreamer-devel mailing list

gstreamer-devel at lists.sourceforge.net


Windows Live™: Keep your life in sync. Check it out!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090623/0054881b/attachment.htm>

More information about the gstreamer-devel mailing list