Consider the following gst-launch-1.0
command to play an input stream containing video and audio tracks:
gst-launch-1.0 \
uridecodebin uri=${INGRESS_URL} name=decodebin \
\
decodebin. ! "video/x-raw" ! queue name=decodebin_video_queue ! tee name=video_raw_tee \
video_raw_tee. ! queue name=video_play_raw_queue ! videoconvert ! autovideosink \
\
decodebin. ! "audio/x-raw" ! queue name=decodebin_audio_queue ! tee name=audio_raw_tee \
audio_raw_tee. ! queue name=audio_play_queue ! audioconvert ! autoaudiosink
If the stream actually contains both video and audio tracks, the command works correctly. However, if one track is missing (say audio), the command pipeline halts and displays the following error:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Setting pipeline to PLAYING ...
Buffering, setting pipeline to PAUSED ...
Done buffering, setting pipeline to PLAYING ...
Buffering, setting pipeline to PAUSED ...
Done buffering, setting pipeline to PLAYING ...
Redistribute latency...
Buffering, setting pipeline to PAUSED ...
WARNING: from element /GstPipeline:pipeline0/GstURIDecodeBin:decodebin: Delayed linking failed.
Additional debug info:
gst/parse/grammar.y(540): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstURIDecodeBin:decodebin:
failed delayed linking some pad of GstURIDecodeBin named decodebin to some pad of GstQueue named decodebin_audio_queue
Redistribute latency...
Redistribute latency...
Done buffering, setting pipeline to PLAYING ...
Is there a way to use gst-launch-1.0
command line to conditionally create the audio dataflow based on whether or not there is actually an audio track in the input stream? If there is no audio available, I want to omit this part of the pipeline
decodebin. ! "audio/x-raw" ! queue name=decodebin_audio_queue ! tee name=audio_raw_tee \
audio_raw_tee. ! queue name=audio_play_queue ! audioconvert ! autoaudiosink
I know I can do this using GStreamer API in code, but at the moment I'm limited to using the command line interface.