[gst-devel] Problem with adding cap to pipeline
zelalems at hotmail.com
Tue Jun 16 11:43:41 CEST 2009
Hi Sudarshan, thank you for your prompt response. In fact, I used the gst_caps_new_simple to create the caps. I used the GstCaps to define them before creating them. So, it was a mistake when I express it. I now used three link statements (please look at below. I used two link statements to link the two ends (leaving the caps in the m,iddle) and then used link filter to link the two links):
gst_element_link_many (udpsource, queue1, h263depay, NULL); //to link elements before the caps
gst_element_link_many (avimuxer, queue2, filedes, NULL); ////to link elements after the caps
//link two elements with a filter (i.e. h263depay and queue2 with caps2)
gboolean link_ok = gst_element_link_filtered (h263depay, avimuxer, caps2); //to link the above two links
Now the error related to the link is gone (I don't know whether I am still correct or not), but the "add element to bin" function still produced the same error. The following is the output when i run my code:
Starting program: /home/zelalem/videorecorder
[Thread debugging using libthread_db enabled]
[New Thread 0xb7bb66b0 (LWP 28219)]
(videorecorder:28219): GStreamer-CRITICAL **: gst_bin_add: assertion `GST_IS_ELEMENT (element)' failed
[New Thread 0xb7936b90 (LWP 28223)]
[New Thread 0xb7135b90 (LWP 28224)]
[New Thread 0xb67ffb90 (LWP 28225)]
Program exited normally.
So, I asume the problem is with adding teh cap into the pipeline.
- Zelalem S.
Date: Tue, 16 Jun 2009 14:15:08 +0530
From: bisht.sudarshan at gmail.com
To: gstreamer-devel at lists.sourceforge.net
Subject: Re: [gst-devel] Problem with adding cap to pipeline
Use gst_element_link_filtered to link two elements using caps and use gst_caps_new_simple to create the caps.
On Tue, Jun 16, 2009 at 1:55 PM, Zelalem Sintayehu <zelalems at hotmail.com> wrote:
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.
- Zelalem S.
check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net
More than messages–check out the rest of the Windows Live™.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel