0

I need to create a GStreamer pipeline with an input-selector in it, to switch between multiple input sources, but every time I try to add such a component I get a completely undescript Bus error - and at this point I'm stuck, there's no useful information for me to follow through, I can monkey around with some trial and error debugging, but to no avail...

Also, the bus error only comes out when I actually try to consume the pipeline (further processed by something else - but that part is debugged), in my case by opening an outputted RTSP feed from later on with a player like IINA or VLC. This doesn't really matter though any other attempt at playback leads to same error...

I guess I'm missing some subtler points about how input-selector is to be used, so please point me to any relevant examples/documentation - what I need to implement in the end is a python service streaming a RTSP video feed, that on command (HTTP API) switches between various media files to stream.

Example pipeline:

gst-launch-1.0 --gst-debug-level=3 \
  input-selector name=iselect \
  filesrc location={INPUT_VIDEO_FILE_PATH} \
    ! qtdemux ! queue ! h264parse ! iselect. \
  filesrc location={PLACEHOLDER_FILE_PATH} \
    ! pngdec ! imagefreeze ! iselect. \
  iselect. ! gdppay ! shmsink socket-path=/tmp/shm1

Also constructing the pipeline in Python, either with Gst.parse_launch(...string like above...) or with manual piece-by-piece pipeline construction in Python.

Also, in Python I explicitly switch the input-selector to a stream, like this:

input_selector_video_file_sink_pad = input_selector.get_static_pad('sink_1')
input_selector.set_property("active-pad", input_selector_video_file_sink_pad)

For reference, this is a full "manual pipeline construction" sample that fails with non-descript Bus error: https://gist.github.com/NeuronQ/de24db937a4d5a28eeb46612914b8779 .

NeuronQ
  • 7,527
  • 9
  • 42
  • 60
  • you are directly replacing the sink_1 pad, what if this pad isnt active looking at the test app https://github.com/GStreamer/gst-plugins-base/blob/master/tests/icles/input-selector-test.c you first get the active pad and then switch, see if this helps. – Prabhakar Lad Aug 20 '19 at 11:08
  • @PrabhakarLad not sure what you mean... I see the example but both pads should be active here, and even if the assignment of sink_0 vs. sink_1 would not be deterministic (and I know these are their names from output of `gst-inspect-1.0 input-selector`...) it would just set as active the one already active... *...or is there some event/signal I need to wait for before being able to do the switch?* – NeuronQ Aug 20 '19 at 13:18

0 Answers0