Hello, I've got this pipeline working as required: gst-launch v4l2src ! video/x-raw-yuv,width=352,height=288,framerate=15/1 ! ffmpegcolorspace ! tee name=t ! queue ! ffenc_flv ! udpsink host=127.0.0.1 port=8991 t. ! queue ! ffenc_mpeg4 ! udpsink host=127.0.0.1 port=8999 But when I implemented it in a c code I did not work and I got this error: Error: Internal data flow error. This is the relevant part gst_bin_add_many (GST_BIN (bin_1), source, vrate, filter, conv, tee , queue_1 , queue_2, NULL); gst_bin_add_many (GST_BIN (bin_2), flv_encoder, sink_1 , NULL); gst_bin_add_many (GST_BIN (bin_3), mpeg_encoder, sink_2 , NULL); /* add ghost pads */ gpad_1 = gst_element_get_static_pad (queue_1, "src"); gst_element_add_pad (bin_1, gst_ghost_pad_new ("src_1", gpad_1)); gst_object_unref (GST_OBJECT (gpad_1)); gpad_2 = gst_element_get_static_pad (queue_2, "src"); gst_element_add_pad (bin_1, gst_ghost_pad_new ("src_2", gpad_2)); gst_object_unref (GST_OBJECT (gpad_2)); gpad_3 = gst_element_get_static_pad (flv_encoder, "sink"); gst_element_add_pad (bin_2, gst_ghost_pad_new ("sink_1", gpad_3)); gst_object_unref (GST_OBJECT (gpad_3)); gpad_4 = gst_element_get_static_pad (mpeg_encoder, "sink"); gst_element_add_pad (bin_3, gst_ghost_pad_new ("sink_2", gpad_4)); gst_object_unref (GST_OBJECT (gpad_4)); /* add the bins to the pipeline */ gst_bin_add (GST_BIN (pipeline), bin_1); gst_bin_add (GST_BIN (pipeline), bin_2); gst_bin_add (GST_BIN (pipeline), bin_3); /* link the elements */ gst_element_link_many (source, vrate, filter, conv, tee, queue_1 , NULL); gst_element_link (tee, queue_2 ); gst_element_link (bin_1, bin_2 ); gst_element_link (bin_1, bin_3 ); /* Set the pipeline to "playing" state*/ g_print ("Now playing: \n"); gst_element_set_state (pipeline, GST_STATE_PLAYING); any suggestion will be appreciated..... Thank you Ibra _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On 11/11/2011 08:06 AM, ibrahim suliman wrote:
> > /* link the elements */ > gst_element_link_many (source, vrate, filter, conv, tee, queue_1 , NULL); > gst_element_link (tee, queue_2 ); > gst_element_link (bin_1, bin_2 ); > gst_element_link (bin_1, bin_3 ); Tee's don't link that way. You have to request a pad and then link the pads manually. Using google I found the following which has a C code example you can use. http://delog.wordpress.com/2011/06/06/gstreamer-pipeline-with-tee/ _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
You are right Nathanael, they need to be linked manually. Thanks for your help. I have another issue: I want to start the stream with only two bins in the pipeline which contain: gst_bin_add_many (GST_BIN (bin_1), source , colorspace, tee , queue_1 , queue_2, NULL); gst_bin_add_many (GST_BIN (bin_2), flv_encoder, sink_1 , NULL); and while streaming, I want to add the third one: gst_bin_add_many (GST_BIN (bin_3), mpeg_encoder, sink_2 , NULL); I tryed this and it is working for me but with setting the state of the pipeline to NULL as follows: bin_1_pad = gst_element_get_pad (bin_1, "src"); bin_3_pad = gst_element_get_pad (bin_3 , "sink"); gst_element_set_state (pipeline, GST_STATE_NULL); gst_bin_add (GST_BIN (pipeline), bin_3); gst_pad_link (bin_1_pad, bin_3_pad ); gst_element_set_state (pipeline, GST_STATE_PLAYING); is there other ways to do this without changing the state to NULL? Thank you Ibra From: Nathanael D. Noblet <[hidden email]> To: ibrahim suliman <[hidden email]>; Discussion of the development of and with GStreamer <[hidden email]> Cc: "Edwards, Christopher" <[hidden email]> Sent: Friday, 11 November 2011, 17:05 Subject: Re: a not working 'tee' pipeline On 11/11/2011 08:06 AM, ibrahim suliman wrote: > > /* link the elements */ > gst_element_link_many (source, vrate, filter, conv, tee, queue_1 , NULL); > gst_element_link (tee, queue_2 ); > gst_element_link (bin_1, bin_2 ); > gst_element_link (bin_1, bin_3 ); Tee's don't link that way. You have to request a pad and then link the pads manually. Using google I found the following which has a C code example you can use. http://delog.wordpress.com/2011/06/06/gstreamer-pipeline-with-tee/ _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
On 11/15/2011 11:11 AM, ibrahim suliman wrote:
> You are right Nathanael, they need to be linked manually. Thanks for > your help. > I have another issue: > I want to start the stream with only two bins in the pipeline which contain: > gst_bin_add_many (GST_BIN (bin_1), source , colorspace, tee , queue_1 , > queue_2, NULL); > gst_bin_add_many (GST_BIN (bin_2), flv_encoder, sink_1 , NULL); > and while streaming, I want to add the third one: > gst_bin_add_many (GST_BIN (bin_3), mpeg_encoder, sink_2 , NULL); > I tryed this and it is working for me but with setting the state of the > pipeline to NULL as follows: > bin_1_pad = gst_element_get_pad (bin_1, "src"); > bin_3_pad = gst_element_get_pad (bin_3 , "sink"); > gst_element_set_state (pipeline, GST_STATE_NULL); I don't fully get what you are trying to do, but NULL is for when you are done with the pipeline, try setting it to READY? > gst_bin_add (GST_BIN (pipeline), bin_3); > gst_pad_link (bin_1_pad, bin_3_pad ); > gst_element_set_state (pipeline, GST_STATE_PLAYING); > is there other ways to do this without changing the state to NULL? > Thank you > Ibra > > *From:* Nathanael D. Noblet <[hidden email]> > *To:* ibrahim suliman <[hidden email]>; Discussion of the development > of and with GStreamer <[hidden email]> > *Cc:* "Edwards, Christopher" <[hidden email]> > *Sent:* Friday, 11 November 2011, 17:05 > *Subject:* Re: a not working 'tee' pipeline > > On 11/11/2011 08:06 AM, ibrahim suliman wrote: >> >> /* link the elements */ >> gst_element_link_many (source, vrate, filter, conv, tee, queue_1 , NULL); >> gst_element_link (tee, queue_2 ); >> gst_element_link (bin_1, bin_2 ); >> gst_element_link (bin_1, bin_3 ); > > Tee's don't link that way. You have to request a pad and then link the > pads manually. > > > Using google I found the following which has a C code example you can use. > > http://delog.wordpress.com/2011/06/06/gstreamer-pipeline-with-tee/ > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > <mailto:[hidden email]> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > > > > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |