fallbacksrc: support multiple video and audio tracks
I'm using the fallbacksrc
element to consume two SRT sources as:
export GST_DEBUG_DUMP_DOT_DIR=/tmp
gst-launch-1.0 fallbacksrc uri="srt://SOME_IP:10001?mode=caller" fallback-uri="srt://SOME_IP:10005?mode=caller" timeout=500000000 name="decodebin" \
decodebin.video ! queue ! fakesink \
decodebin.audio ! queue ! fakesink
The fallbacksrc
works as expected in this case.
However, if my SRT sources contain more than one video or audio track, I'm not able to collect the decoded data out of the fallbacksrc
as there are no video_%u
nor audio_%u
pads I could use to request the data. Ideally, I would like:
export GST_DEBUG_DUMP_DOT_DIR=/tmp
gst-launch-1.0 fallbacksrc uri="srt://SOME_IP:10001?mode=caller" fallback-uri="srt://SOME_IP:10005?mode=caller" timeout=500000000 name="decodebin" \
decodebin.video_0 ! queue ! fakesink \
decodebin.video_1 ! queue ! fakesink \
decodebin.video_2 ! queue ! fakesink \
decodebin.video_3 ! queue ! fakesink \
decodebin.video_4 ! queue ! fakesink \
decodebin.audio_0 ! queue ! fakesink \
decodebin.audio_1 ! queue ! fakesink
Here's a diagram with the pipeline when there are 5 video and 2 audio tracks. The underlying uridecodebin3
is detecting all the tracks, but it is decoding video_0
and audio_0
only.
The enhancement I propose is to expose all available tracks as source pads of the fallbacksrc
element as audio_%u
, video_%u
. Looking at the documentation of the element, the pad templates are audio
and video
, without the typical _%u
suffix of multiple pads. Not sure if they can be modified without breaking the current element API, or if this will require a new fallbacksrc2
element.
I'm happy to contribute to enhancing the element if needed.