Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

classic Classic list List threaded Threaded
13 messages Options
R C
Reply | Threaded
Open this post in threaded view
|

Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

R C

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Huh?: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

R C

so while messing with it,  I forgot to change teh second part, and even though it seems incosistent, can someone explain why this works?  (I am just putting the declarations here,  rewritting to ugly got's into something nicr is not the problem)


in the main part the declarations I had are:

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");


and I forgot to make the changes in the second part (pad_added_handler), surprised it worked, and seems counter-intuitive?

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert, "sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert, "sink");


but  ..  why??  How can it even find the right GstElement, since none of the are named "sink"?


docs:

******************************************************************

gst_element_get_static_pad ()

GstPad *
gst_element_get_static_pad (GstElement *element,
                            const gchar *name);

Retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.

Parameters

element a GstElement to find a static pad of.

name the name of the static GstPad to retrieve.

Returns

the requested GstPad if found, otherwise NULL. unref after usage.

MT safe.

************************************************************************



thanks,


Ron



On 5/15/19 8:33 PM, R C wrote:

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Huh?: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

Vinod Kesti
Hi RC

"sink" is not element name. It is pad name of of videoconvert and
audioconvert.




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Huh?: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

Matthew Waters
In reply to this post by R C
On 16/5/19 1:11 pm, R C wrote:

so while messing with it,  I forgot to change teh second part, and even though it seems incosistent, can someone explain why this works?  (I am just putting the declarations here,  rewritting to ugly got's into something nicr is not the problem)


in the main part the declarations I had are:

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");


and I forgot to make the changes in the second part (pad_added_handler), surprised it worked, and seems counter-intuitive?

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert, "sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert, "sink");


"sink" is the name of the pad on the element you're retrieving from (audio/videoconvert in this case) not the name of the element.

but  ..  why??  How can it even find the right GstElement, since none of the are named "sink"?


The element is the 'data->audio/videoconvert' parameters you pass into 'gst_element_get_static_pad'.

Cheers
-Matt

docs:

******************************************************************

gst_element_get_static_pad ()

GstPad *
gst_element_get_static_pad (GstElement *element,
                            const gchar *name);

Retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.

Parameters

element a GstElement to find a static pad of.

name the name of the static GstPad to retrieve.

Returns

the requested GstPad if found, otherwise NULL. unref after usage.

MT safe.

************************************************************************



thanks,


Ron



On 5/15/19 8:33 PM, R C wrote:

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

Nicolas Dufresne-5
In reply to this post by R C


Le mer. 15 mai 2019 22 h 40, R C <[hidden email]> a écrit :

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.
I'm not really able to see all steps that lead you to this, but I can give you a trick to help. G_DEBUG=fatal_criticals will make it abort on the assertion, run this in gdb, and analyse the context that lead to that pad being null.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Huh?: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

Nicolas Dufresne-5
In reply to this post by R C


Le mer. 15 mai 2019 23 h 25, R C <[hidden email]> a écrit :

so while messing with it,  I forgot to change teh second part, and even though it seems incosistent, can someone explain why this works?  (I am just putting the declarations here,  rewritting to ugly got's into something nicr is not the problem)


in the main part the declarations I had are:

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");


and I forgot to make the changes in the second part (pad_added_handler), surprised it worked, and seems counter-intuitive?

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert, "sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert, "sink");

The names in the first part are the element names, while in this callback, you are handling pad names. Pad names are chosen by the elements and follow the pattern in the pad template (see gst-inspect-1.0 element to see the template).



but  ..  why??  How can it even find the right GstElement, since none of the are named "sink"?


docs:

******************************************************************

gst_element_get_static_pad ()

GstPad *
gst_element_get_static_pad (GstElement *element,
                            const gchar *name);

Retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.

Parameters

element a GstElement to find a static pad of.

name the name of the static GstPad to retrieve.

Returns

the requested GstPad if found, otherwise NULL. unref after usage.

MT safe.

************************************************************************



thanks,


Ron



On 5/15/19 8:33 PM, R C wrote:

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: Huh?: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

R C
So basically one would never have  two elements that are the same, and only differ in the name you made/created them with?

On Thu, May 16, 2019 at 7:19 AM Nicolas Dufresne <[hidden email]> wrote:


Le mer. 15 mai 2019 23 h 25, R C <[hidden email]> a écrit :

so while messing with it,  I forgot to change teh second part, and even though it seems incosistent, can someone explain why this works?  (I am just putting the declarations here,  rewritting to ugly got's into something nicr is not the problem)


in the main part the declarations I had are:

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");


and I forgot to make the changes in the second part (pad_added_handler), surprised it worked, and seems counter-intuitive?

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert, "sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert, "sink");

The names in the first part are the element names, while in this callback, you are handling pad names. Pad names are chosen by the elements and follow the pattern in the pad template (see gst-inspect-1.0 element to see the template).



but  ..  why??  How can it even find the right GstElement, since none of the are named "sink"?


docs:

******************************************************************

gst_element_get_static_pad ()

GstPad *
gst_element_get_static_pad (GstElement *element,
                            const gchar *name);

Retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.

Parameters

element a GstElement to find a static pad of.

name the name of the static GstPad to retrieve.

Returns

the requested GstPad if found, otherwise NULL. unref after usage.

MT safe.

************************************************************************



thanks,


Ron



On 5/15/19 8:33 PM, R C wrote:

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Huh?: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

Nicolas Dufresne-5


Le jeu. 16 mai 2019 09 h 25, R C <[hidden email]> a écrit :
So basically one would never have  two elements that are the same, and only differ in the name you made/created them with?

Element names must unique per GstBin only. You'd get an error from gst_bin_add() if you had a duplicate. Always check your return values, there is no exception in C to save the day.



On Thu, May 16, 2019 at 7:19 AM Nicolas Dufresne <[hidden email]> wrote:


Le mer. 15 mai 2019 23 h 25, R C <[hidden email]> a écrit :

so while messing with it,  I forgot to change teh second part, and even though it seems incosistent, can someone explain why this works?  (I am just putting the declarations here,  rewritting to ugly got's into something nicr is not the problem)


in the main part the declarations I had are:

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");


and I forgot to make the changes in the second part (pad_added_handler), surprised it worked, and seems counter-intuitive?

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert, "sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert, "sink");

The names in the first part are the element names, while in this callback, you are handling pad names. Pad names are chosen by the elements and follow the pattern in the pad template (see gst-inspect-1.0 element to see the template).



but  ..  why??  How can it even find the right GstElement, since none of the are named "sink"?


docs:

******************************************************************

gst_element_get_static_pad ()

GstPad *
gst_element_get_static_pad (GstElement *element,
                            const gchar *name);

Retrieves a pad from element by name. This version only retrieves already-existing (i.e. 'static') pads.

Parameters

element a GstElement to find a static pad of.

name the name of the static GstPad to retrieve.

Returns

the requested GstPad if found, otherwise NULL. unref after usage.

MT safe.

************************************************************************



thanks,


Ron



On 5/15/19 8:33 PM, R C wrote:

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

R C
In reply to this post by Nicolas Dufresne-5
Ok,  cool I try that.

btw:  is there a tool that can be used to display what's going on in a pipe created with gst-launch?  (what I mean is, that shows the  pipeline and branches).  Is there 'something'  that would optimize a pipeline?

thanks,

Ron

On Thu, May 16, 2019 at 7:15 AM Nicolas Dufresne <[hidden email]> wrote:


Le mer. 15 mai 2019 22 h 40, R C <[hidden email]> a écrit :

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.
I'm not really able to see all steps that lead you to this, but I can give you a trick to help. G_DEBUG=fatal_criticals will make it abort on the assertion, run this in gdb, and analyse the context that lead to that pad being null.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

building a gstreamer pipeline in C

R C
In reply to this post by Nicolas Dufresne-5
Hello all,


I am using the examples from the Gstreamer basic tutorial to see if I
can build a c program that streams  some IP cameras.

The reason why I want to use C code is that is seems the ryn 'faster',
less lag/latency.  I have a working example that streams the camera to a
"gstreamer window" and the timestamps on the stream are only 3-4 secs
behind, while running the same stream with the gst launch cmd line (into
browser) is about 20 - 30 secs behind.

(although I am streaming into a web page with gst-launch


This is the gst-launch pipeline I am using:

gst-launch-1.0 uridecodebin
uri=rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream
name=d ! queue ! theoraenc ! oggmux name=m ! tcpserversink
host=192.168.q.r port=8080 d. ! queue ! audioconvert ! audioresample !
flacenc ! m.


Being a rookie, using gstreamer, I assume that he names, d and m, are
used to ID the video and audio stream?


I "adapted"  a gstreamer example a little and so far I can stream the
video and audio to a gstreamer window., like (some excerpts) :

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert",
"audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert",
"videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");

I connect the audioconvert to the audio sink, same for video.

and when the stream starts, I connect the source (uridecodebin) to the
rest of the pipeline:

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert,
"sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert,
"sink");

gst_pad_link (new_pad, audiosink_pad);

gst_pad_link (new_pad, videosink_pad);


where "new_pad"  are the pads that are created, by source/uridecodebin
when the stream starts.


So I assume, in the C code I don't really have to use the names, since I
can directly connect those elements, while in gst-launch one needs to 
ID what elements go where?  right?

The gst-launch command I used seems to work,  I don't know if it is the
most efficient way to do that though, but wondering how the elements
should be linked in C code


would it be something like?:

video:  uridecodebin -> queue -> theoraenc -> oggmux -> tcpserversink

audio: uridecodebin -> queue -> audioconvert -> audioresample -> flacenc
-> tcpserversink


In the reference manual I see that the tcpserversink element has 1 sink,
so I need the element for both the audio stream and video stream?

(or do the two streams need to be combined before I  connect them to the
tcpserversink element?)


thanks,


Ron


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: building a gstreamer pipeline in C

Michael Gruner
Hi

There is no reason why a C app would have less lag/latency than a gst-launch-1.0 pipeline (assuming the pipes are exactly the same). After all, gst-launch-1.0 is a C application as well. Network streaming will typically have more latency than local display, and that’s the reason gst-launch-1.0 seems more laggy.

Here’s a tip that may simplify your application development. Take a look at gst_parse_launch, you can pass in the same line as in gst-launch-1.0 and it will handle all the complexities automatically. In fact, that’s what gst-launch-1.0 uses underneath.


Roughly, it would look something like:

const gchar * description = "uridecodebin uri=<a href="rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" class="">rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream name=d ! queue ! theoraenc ! oggmux name=m ! tcpserversink host=192.168.q.r port=8080 d. ! queue ! audioconvert ! audioresample ! flacenc ! m."

GError *error = NULL;
GstElement * pipeline = gst_parse_launch (description, &error);

If (!pipeline) {
g_printerr (“Unable to create pipeline: %s\n”, error->message);
g_error_free (error);
}

Hope it helps!

Michael


On May 17, 2019, at 10:49 AM, R C <[hidden email]> wrote:

Hello all,


I am using the examples from the Gstreamer basic tutorial to see if I can build a c program that streams  some IP cameras.

The reason why I want to use C code is that is seems the ryn 'faster', less lag/latency.  I have a working example that streams the camera to a "gstreamer window" and the timestamps on the stream are only 3-4 secs behind, while running the same stream with the gst launch cmd line (into browser) is about 20 - 30 secs behind.

(although I am streaming into a web page with gst-launch


This is the gst-launch pipeline I am using:

gst-launch-1.0 uridecodebin uri=<a href="rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" class="">rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream name=d ! queue ! theoraenc ! oggmux name=m ! tcpserversink host=192.168.q.r port=8080 d. ! queue ! audioconvert ! audioresample ! flacenc ! m.


Being a rookie, using gstreamer, I assume that he names, d and m, are used to ID the video and audio stream?


I "adapted"  a gstreamer example a little and so far I can stream the video and audio to a gstreamer window., like (some excerpts) :

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");

I connect the audioconvert to the audio sink, same for video.

and when the stream starts, I connect the source (uridecodebin) to the rest of the pipeline:

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert, "sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert, "sink");

gst_pad_link (new_pad, audiosink_pad);

gst_pad_link (new_pad, videosink_pad);


where "new_pad"  are the pads that are created, by source/uridecodebin when the stream starts.


So I assume, in the C code I don't really have to use the names, since I can directly connect those elements, while in gst-launch one needs to  ID what elements go where?  right?

The gst-launch command I used seems to work,  I don't know if it is the most efficient way to do that though, but wondering how the elements should be linked in C code


would it be something like?:

video:  uridecodebin -> queue -> theoraenc -> oggmux -> tcpserversink

audio: uridecodebin -> queue -> audioconvert -> audioresample -> flacenc -> tcpserversink


In the reference manual I see that the tcpserversink element has 1 sink, so I need the element for both the audio stream and video stream?

(or do the two streams need to be combined before I  connect them to the tcpserversink element?)


thanks,


Ron


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer Basic Tutorial / API (3: Dynamic pipelines)

Michael Gruner
In reply to this post by R C
Yes. GStreamer can render a diagram of your pipeline. Take a look at:

https://developer.ridgerun.com/wiki/index.php?title=How_to_generate_a_Gstreamer_pipeline_diagram_(graph)

Michael


On May 16, 2019, at 13:19, R C <[hidden email]> wrote:

Ok,  cool I try that.

btw:  is there a tool that can be used to display what's going on in a pipe created with gst-launch?  (what I mean is, that shows the  pipeline and branches).  Is there 'something'  that would optimize a pipeline?

thanks,

Ron

On Thu, May 16, 2019 at 7:15 AM Nicolas Dufresne <[hidden email]> wrote:


Le mer. 15 mai 2019 22 h 40, R C <[hidden email]> a écrit :

Hello,

I am trying to get a little more familiar with gstreamer, and thought I'd do some

of the "basic" programming tutorial examples.


I did play with the 3rd example:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/dynamic-pipelines.html?gi-language=c


If I copy the example, and compile it, it works, no surprise there. But when I change it and do the "exercise", I get some weirdness.


What I noticed is (well I probably missed something)...  but the function call:

data.sink = gst_element_factory_make ("autoaudiosink", "sink");

According to the docs, the 2nd parameter can be 'whatever' you want to name it.
Since I wanted to do the video part too, I figure I should change the name to
"audio-something", and changed the second function call to:

  data.convert = gst_element_factory_make ("audioconvert", "convert");   (original)
  data.sink = gst_element_factory_make ("autoaudiosink", "audiosink");   (changed name)

of course in the even handler (pad_added_handler), the name needs to be changed in to:

GstPad *sink_pad = gst_element_get_static_pad (data->convert, "audiosink");

Browsing through the code, that should be it, BUT it seems "sink_pad" always is NULL
 and the pipeline elements don't/can't be linked. (see errors below)

since this is supposed to be a simple example,  what am I missing?

thanks,

Ron


errors:
# ./basic-tutorial-3
Pipeline state changed from NULL to READY:
Received new pad 'src_0' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.991: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed
It has type 'video/x-raw' which is not raw audio. Ignoring.
I'm not really able to see all steps that lead you to this, but I can give you a trick to help. G_DEBUG=fatal_criticals will make it abort on the assertion, run this in gdb, and analyse the context that lead to that pad being null.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Received new pad 'src_1' from 'source':

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_is_linked: assertion 'GST_IS_PAD (pad)' failed

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_pad_link_full: assertion 'GST_IS_PAD (sinkpad)' failed
Type is 'audio/x-raw' but link failed.

(basic-tutorial-3:14679): GStreamer-CRITICAL **: 20:22:54.992: gst_object_unref: assertion 'object != NULL' failed
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2950): gst_base_src_loop (): /GstPipeline:test-pipeline/GstURIDecodeBin:source/GstSoupHTTPSrc:source:
streaming stopped, reason not-linked (-1)

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
R C
Reply | Threaded
Open this post in threaded view
|

Re: building a gstreamer pipeline in C

R C
In reply to this post by Michael Gruner

I have been playing with that,  and that works.

(btw:  I want to write some c code, because at some point I want it to run as a deamon, and do some trickery with it, like switching cameras etc)


I see some "weird" msgs, don't know what they really mean, but the stream video/audio, seems to work.


this is what I see (I called the  little program basic-ipcam, 'a la' the  basic gstreamer API example. :

# ./basic-ipcam
DtsGetHWFeatures: Create File Failed
DtsGetHWFeatures: Create File Failed
Running DIL (3.22.0) Version
DtsDeviceOpen: Opening HW in mode 0
DtsDeviceOpen: Create File Failed
On 5/17/19 11:46 AM, Michael Gruner wrote:
Hi

There is no reason why a C app would have less lag/latency than a gst-launch-1.0 pipeline (assuming the pipes are exactly the same). After all, gst-launch-1.0 is a C application as well. Network streaming will typically have more latency than local display, and that’s the reason gst-launch-1.0 seems more laggy.

Here’s a tip that may simplify your application development. Take a look at gst_parse_launch, you can pass in the same line as in gst-launch-1.0 and it will handle all the complexities automatically. In fact, that’s what gst-launch-1.0 uses underneath.


Roughly, it would look something like:

const gchar * description = "uridecodebin uri=<a href="rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" class="" moz-do-not-send="true">rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream name=d ! queue ! theoraenc ! oggmux name=m ! tcpserversink host=192.168.q.r port=8080 d. ! queue ! audioconvert ! audioresample ! flacenc ! m."

GError *error = NULL;
GstElement * pipeline = gst_parse_launch (description, &error);

If (!pipeline) {
g_printerr (“Unable to create pipeline: %s\n”, error->message);
g_error_free (error);
}

Hope it helps!

Michael


On May 17, 2019, at 10:49 AM, R C <[hidden email]> wrote:

Hello all,


I am using the examples from the Gstreamer basic tutorial to see if I can build a c program that streams  some IP cameras.

The reason why I want to use C code is that is seems the ryn 'faster', less lag/latency.  I have a working example that streams the camera to a "gstreamer window" and the timestamps on the stream are only 3-4 secs behind, while running the same stream with the gst launch cmd line (into browser) is about 20 - 30 secs behind.

(although I am streaming into a web page with gst-launch


This is the gst-launch pipeline I am using:

gst-launch-1.0 uridecodebin uri=<a href="rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream" class="" moz-do-not-send="true">rtsp://192.168.x.y:554/user=admin_password=XXXXXXXX_channel=1_stream=0.sdp?real_stream name=d ! queue ! theoraenc ! oggmux name=m ! tcpserversink host=192.168.q.r port=8080 d. ! queue ! audioconvert ! audioresample ! flacenc ! m.


Being a rookie, using gstreamer, I assume that he names, d and m, are used to ID the video and audio stream?


I "adapted"  a gstreamer example a little and so far I can stream the video and audio to a gstreamer window., like (some excerpts) :

// Create the elements
data.source = gst_element_factory_make("uridecodebin", "source");
data.audioconvert = gst_element_factory_make("audioconvert", "audioconvert");
data.audiosink = gst_element_factory_make("autoaudiosink", "audiosink");
data.videoconvert = gst_element_factory_make("videoconvert", "videoconvert");
data.videosink = gst_element_factory_make("autovideosink", "videosink");

I connect the audioconvert to the audio sink, same for video.

and when the stream starts, I connect the source (uridecodebin) to the rest of the pipeline:

GstPad *audiosink_pad = gst_element_get_static_pad(data->audioconvert, "sink");
GstPad *videosink_pad = gst_element_get_static_pad(data->videoconvert, "sink");

gst_pad_link (new_pad, audiosink_pad);

gst_pad_link (new_pad, videosink_pad);


where "new_pad"  are the pads that are created, by source/uridecodebin when the stream starts.


So I assume, in the C code I don't really have to use the names, since I can directly connect those elements, while in gst-launch one needs to  ID what elements go where?  right?

The gst-launch command I used seems to work,  I don't know if it is the most efficient way to do that though, but wondering how the elements should be linked in C code


would it be something like?:

video:  uridecodebin -> queue -> theoraenc -> oggmux -> tcpserversink

audio: uridecodebin -> queue -> audioconvert -> audioresample -> flacenc -> tcpserversink


In the reference manual I see that the tcpserversink element has 1 sink, so I need the element for both the audio stream and video stream?

(or do the two streams need to be combined before I  connect them to the tcpserversink element?)


thanks,


Ron


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel