[gst-devel] Problem with adding cap to pipeline

Zelalem Sintayehu zelalems at hotmail.com
Tue Jun 16 10:25:24 CEST 2009


Hi all, I had a command line code to record video into file that I receive from the network. The following is the code:

gst-launch 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 !
avimux ! queue ! filesink location=test1.avi

As I was preparing this to include in an application, when I changed the above command into a C code, I got an error. I traced back the error and understand that the error relates to adding the cap (that is located between the h263depay and the second queue (before avimux), please look at it above). The following is what I did to add the elements into the pipeline:

  gst_bin_add_many (GST_BIN (pipeline), udpsource, queue1, h263depay, caps2, avimuxer, queue2, filedes, NULL);        

I created caps2 using GstCaps. The others are created using GstElement. To link the elements, I used the following:

  gst_element_link_many(udpsource, queue1, h263depay,caps2,avimuxer, queue2, filedes, NULL);

So, the above two statments created the following errors. 
(videorecorder:19632): GStreamer-CRITICAL **: gst_bin_add: assertion `GST_IS_ELEMENT (element)' failed
(videorecorder:19632): GStreamer-CRITICAL **: gst_element_link_pads_filtered: assertion `GST_IS_ELEMENT (dest)' failed

So, I want you to help me on how to add caps into pipeline and also link it to other elements.

I have attached the whole code herewith.

Thank you.

- Zelalem S. 






_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090616/a38fc5e6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: videorecorder.c
Type: text/x-csrc
Size: 2341 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090616/a38fc5e6/attachment.c>


More information about the gstreamer-devel mailing list