Decoding RTSP stream fails with GstUDPSrc:udpsrc1: Internal data flow error

I’m trying to decode an RTSP stream created by an IP camera… I’m able to do so on a development PC, but not on the TX2.

Here’s the problem case of decoding the RTSP stream with GST_DEBUG=3 set:

logidelic@mytx2:~$ export GST_DEBUG=3
logidelic@mytx2:~$ gst-launch-1.0 rtspsrc location='rtsp://192.168.42.10/vid' ! rtph264depay ! h264parse ! omxh264dec ! nvoverlaysink
0:00:00.042800104  2976       0x588d80 WARN                     omx gstomx.c:2826:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs (searched in: /home/logidelic/.config:/etc/xdg as per GST_OMX_CONFIG_DIR environment variable, the xdg user config directory (or XDG_CONFIG_HOME) and the system config directory (or XDG_CONFIG_DIRS)
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.42.10/vid
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (request) SETUP stream 1
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
0:00:00.205467018  2976   0x7fa4035630 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Progress: (request) Sending PLAY request
0:00:00.206109678  2976   0x7fa4035680 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<fakesrc1:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Progress: (request) Sent PLAY request
0:00:00.342464070  2976   0x7f90004370 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc3> error: Internal data flow error.
0:00:00.342520838  2976   0x7f90004370 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc3> error: streaming task paused, reason not-linked (-1)
0:00:00.350205761  2976   0x7f78003230 FIXME           videodecoder gstvideodecoder.c:946:gst_video_decoder_drain_out:<omxh264dec-omxh264dec0> Sub-class should implement drain()
0:00:00.497926223  2976   0x7f900042d0 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc1> error: Internal data flow error.
0:00:00.497985296  2976   0x7f900042d0 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc1> error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.293162251
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
0:00:00.499698973  2976       0x5ca4f0 WARN                 rtspsrc gstrtspsrc.c:5510:gst_rtspsrc_try_send:<rtspsrc0> receive interrupted
0:00:00.499747069  2976       0x5ca4f0 WARN                 rtspsrc gstrtspsrc.c:7552:gst_rtspsrc_pause:<rtspsrc0> PAUSE interrupted
0:00:00.501402154  2976       0x5ca4f0 WARN                 rtspsrc gstrtspsrc.c:5483:gst_rtspsrc_try_send:<rtspsrc0> send interrupted
0:00:00.501447243  2976       0x5ca4f0 WARN                 rtspsrc gstrtspsrc.c:7020:gst_rtspsrc_close:<rtspsrc0> TEARDOWN interrupted
Freeing pipeline ...

Here’s an example of fetching and parsing (and saving) the RTSP stream on the TX2 without error:

logidelic@mytx2:~$ gst-launch-1.0 rtspsrc location='rtsp://192.168.42.10/vid' ! rtph264depay ! h264parse ! matroskamux ! filesink location=a.ts
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.42.10/vid
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (request) SETUP stream 1
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:19.988372229
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Any help would be greatly appreciated!

Thank you!

Hi,
Please check if the stream can be decoded by 3rdparty SW decoder:

$ gst-launch-1.0 rtspsrc location='rtsp://192.168.42.10/vid' ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink

Hi DaneLLL,

I tried your suggested pipeline on my desktop PC and it works correctly and displays video. However, on the TX2 itself it results in a similar error (below).

One thing worth noting is that on my PC I have a somewhat recent version of GStreamer that I built myself. Perhaps there is some fixes in the rtspsrc element in more recent versions of Gstreamer.

Is there anything special about the TX2 and its nvidia-custom elements that I need to know if I want to rebuild it myself with a more recent version?

Thanks!

logidelic@mytx2:~$ gst-launch-1.0 rtspsrc location='rtsp://192.168.42.10/vid' ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink
Setting pipeline to PAUSED ...
0:00:00.580415071  9444       0x65eea0 WARN                xcontext xvcontext.c:534:gst_xvcontext_check_xshm_calls: MIT-SHM extension check failed at XShmAttach. Not using shared memory.
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.42.10/vid
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (request) SETUP stream 1
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
0:00:01.270151480  9444   0x7f70007230 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<fakesrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Progress: (request) Sending PLAY request
0:00:01.270819202  9444   0x7f70007280 FIXME                default gstutils.c:3766:gst_pad_create_stream_id_internal:<fakesrc1:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Progress: (request) Sent PLAY request
0:00:01.384819938  9444   0x7f60004b70 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc2> error: Internal data flow error.
0:00:01.384887107  9444   0x7f60004b70 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc2> error: streaming task paused, reason not-linked (-1)
0:00:01.390993502  9444   0x7f50003230 WARN                   libav gstavcodecmap.c:2441:gst_ffmpeg_caps_to_pixfmt: ignoring insane framerate 1/0
Redistribute latency...
0:00:01.417459336  9444   0x7f50003230 WARN                GST_PADS gstpad.c:4092:gst_pad_peer_query:<avdec_h264-0:src> could not send sticky events
Redistribute latency...
0:00:01.515121973  9444   0x7f60004ad0 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
0:00:01.515252727  9444   0x7f60004ad0 WARN                 basesrc gstbasesrc.c:2948:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.245842667
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
0:00:01.519544471  9444       0x6560a0 WARN                 rtspsrc gstrtspsrc.c:5510:gst_rtspsrc_try_send:<rtspsrc0> receive interrupted
0:00:01.519612248  9444       0x6560a0 WARN                 rtspsrc gstrtspsrc.c:7552:gst_rtspsrc_pause:<rtspsrc0> PAUSE interrupted
Freeing pipeline ...

I’ll answer my own question: Rebuilding a newer version of GStreamer fixed the problem. Thanks much.