Having a (RTSP) fallback source without decoding

Hello hackers!

We have an application that receive audio and video via RTP then feeds that via rtppassthroughpay payloaders to the gst-rtsp-server library, using different fancy sub classes.

Sometime the RTP streams to the application can take a while to appear, and we want to be able to give out a link to our RTSP stream fairly quickly.

A dream scenario for us would be if we could have something (an image, a video loop or whatever) streaming on the RTSP server before we have incoming data to the application and then switch over when data arrives. Pretty much what the gst-plugin-fallbackswitch elements facilitate … but … we do not want to encode / decode H.26x in our application. It would become expensive for us and use too much CPU.

Is there anyway to either use RTSP tricks to have a stream dynamically appear and dissapear? Or to have fallback behavior using encoded data? If so what codec parameters need to match? Does this get too complicated to quickly?

Does my question make sense? Thank you for reading!

Not sure for your case, but you may try using switchbin element with a fallback case such as:

gst-launch-1.0 rtspsrc location=rtsp://your_rtsp_uri ! switchbin num-paths=3 \
 path0::caps="application/x-rtp,encoding-name=JPEG,clock-rate=90000,payload=26" path0::element="rtpjpegdepay ! jpegdec ! autovideoconvert"\
 path1::caps="application/x-rtp,encoding-name=H264,clock-rate=90000,payload=96" path1::element="rtph264depay ! h264parse ! openh264dec ! autovideoconvert"\
 path2::caps="ANY" path2::element="fakesink   videotestsrc pattern=snow ! autovideoconvert" \ 
! autovideosink