GStreamer - RTPS stream to MJPEG pipeline

I’m trying to write a working pipeline for capturing an RTPS Stream using MJPEG instead of H264, currently I have a working pipeline using H264, thus I know that my stream is working properly. But when I try to adapt the new pipeline to MJPEG it fails, and I can’t see why.

My current H264 working pipeline looks like this:

gst-launch-1.0 rtspsrc location=myStreamIP ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=RGB ! autovideosink

And my attempt to adapt it to MJPEG looks like this:

gst-launch-1.0 rtspsrc location=myStreamIP ! rtpjpegdepay ! jpegparse ! avdec_mjpeg ! videoconvert ! video/x-raw,format=RGB ! autovideosink

And when I use the MJPEG pipeline the console gives me the following error:

Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Redistribute latency...
Progress: (request) Sending PLAY request
Redistribute latency...
Progress: (request) Sent PLAY request
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: Internal data stream error.
WARNING: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Delayed linking failed.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)
Additional debug info:
gst/parse/grammar.y(922): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
failed delayed linking some pad of GstRTSPSrc named rtspsrc0 to some pad of GstRtpJPEGDepay named rtpjpegdepay0
Execution ended after 0:00:00.077653600
Setting pipeline to NULL ...
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not write to resource.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6937): gst_rtspsrc_try_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not send message. (Received end-of-file)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not write to resource.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(9431): gst_rtspsrc_pause (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not send message. (Received end-of-file)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read from resource.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6851): gst_rtsp_src_receive_response (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not receive message. (System error)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not read from resource.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6951): gst_rtspsrc_try_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not receive message. (System error)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not write to resource.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(8743): gst_rtspsrc_close (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Could not send message. (System error)
Freeing pipeline ...

Does anyone know what I’m doing wrong or how to solve it ? I assume that my pipeline for MJPEG is not properly set, but I cannot se why or how.

Thank you.

It indicates that you have never received a pad that reduces JPEG. Are you sure you have changed your server configuration? You can let playbin assemble the pipeline and inspect the caps this way:

gst-play-1.0 -v rtsp://...

Yeah, the server was properly setup to work with MJPEG. At the end I’ve managed to make it work with the exact same line, it was some issue with the URL of my server.