How stream_id hash is generated from input name?

Tomy Elrond tomyelrond at gmail.com
Tue Aug 23 16:32:38 UTC 2022


The stream-id from the source pad of the funnel is also the SHA256 of the
URI.

Is there any way how to get indexes of the streams (for example I mean:
"file:///tmp/input_video_1.mp4" -> stream-id=0,
"file:///tmp/input_video_2.mp4" -> stream-id=1)?
When I link *decodebin* element with *funnel* element, I request *pads*
from the *funnel* element sequentially like this:
"
First input stream: "file:///tmp/input_video_1.mp4" -> sinkpad =
gst_element_get_request_pad(funnel, "sink_0");
Second input stream: "file:///tmp/input_video_2.mp4" -> sinkpad =
gst_element_get_request_pad(funnel, "sink_1");
"
So it means that the funnel element could store some indexes depending on
which input was requested as the first one, second one and etc.
Can I find these indexes somewhere in the pipeline after (downstream) the
funnel element?
Thank you
Tommy

út 23. 8. 2022 v 8:27 odesílatel Sebastian Dröge <sebastian at centricular.com>
napsal:

>
> On Mon, 2022-08-22 at 15:04 +0200, Tomy Elrond via gstreamer-devel wrote:
>
> "
> *// ------- Method 1: my previous solution -------*
> gchar *opaque_stream_id = gst_pad_get_stream_id(pad);
> *g_print("opaque_stream_id: %s\n", opaque_stream_id); // prints the SHA256
> of the URI*
>
> *// ------- Method 2: your proposed method -------*
> GstEvent *sticky_event = NULL;
> sticky_event = gst_pad_get_sticky_event(pad, GST_EVENT_STREAM_START, 0);
> const gchar *stream_id = NULL;
> gst_event_parse_stream_start(sticky_event, &stream_id);
> *g_print("stream_id: %s\n", stream_id); // Also prints the SHA256 of the
> URI*
> "
> But your proposed method also prints the same hash as the previous method,
> so I'm still not able to distinguish the input streams. Or isn't my code
> correct?
> My question is still the same: How do I find out which stream_id belongs
> to which video input?
>
>
> You'd get the stream-id from the source pad of the funnel in your case.
> You probably want to use a pad probe to get notified about whenever the
> STREAM_START event changes and a new stream-id is in use.
>
> --
>
> Sebastian Dröge, Centricular Ltd · https://www.centricular.com
> <http://www.centricular.com>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220823/8b6adb75/attachment.htm>


More information about the gstreamer-devel mailing list