gst-launch: 2 sources and auto EOS when first source finish

info at mbsoft.biz info at mbsoft.biz
Wed Jan 18 20:21:47 UTC 2023


Is it possible to have an automatic pipeline shutdown when 1 of the sources end?

I have this pipeline 1 source video + 1 source audio:

gst-launch-1.0.exe -e videotestsrc is-live=true ! x264enc tune=zerolatency option-string=nal-hrd=cbr:force-cfr=1:keyint=250 bitrate=1024 ! matroskamux name=mux ! filesink location=e:\test.mkv filesrc location="z:\\canzoni\\canzoni\\elisa - luce.mp3" ! decodebin ! audioresample ! audioconvert ! mux.

I want the pipeline to automatically shutdown when the filesrc has finished to read the file.

In ffmpeg there is the option -shortest that finish encoding when the shortest output stream ends. 

How I can achieve the same?

Note that in this example I used the filesrc but in my real usage I get audio samples with fdsrc like this:

gst-launch-1.0.exe -e videotestsrc is-live=true ! x264enc tune=zerolatency option-string=nal-hrd=cbr:force-cfr=1:keyint=250 bitrate=1024 ! matroskamux name=mux ! filesink location=e:\test.mkv fdsrc ! rawaudioparse format=pcm pcm-format=s16le sample-rate=44100 num-channels=2 ! audioresample ! audioconvert ! opusenc bitrate=128000 ! opusparse ! queue ! mux

when the stdin source has been closed the pipeline continue to run unfortunately

Thank you




More information about the gstreamer-devel mailing list