Problem with displaying h264 stream from web camera on Jetson Nano

Hello,

I’m trying to play stream from web camera

gst-launch-1.0 playbin uri=rtsp://<cam_ip>

When i set 264 in camera setting my Jetson Nano can’t play it. It stops after this logs

0:00:08.782972175 31492   0x7fac069450 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/mm/.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)
Opening in BLOCKING MODE 
0:00:08.796601468 31492   0x7fac069450 WARN                    v4l2 gstv4l2object.c:4408:gst_v4l2_object_probe_caps:<nvv4l2decoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:08.796662927 31492   0x7fac069450 WARN                    v4l2 gstv4l2object.c:2370:gst_v4l2_object_add_interlace_mode:0x7f8022a700 Failed to determine interlace mode
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261

Although it works on my PC.

It also works fine (both PC and Jetson) when i set 265 codec on camera setting.

Hi,
Please try following suggestion first and update test result.
https://devtalk.nvidia.com/default/topic/1070706/deepstream-sdk/managing-unstable-rtsp-stream/post/5424688/#5424688

I’ve tried

gst-launch-1.0 uridecodebin uri=rtsp://<cam_ip> ! nvoverlaysink sync=false

and result is the same

Hi,
It looks like rtsp://<cam_ip> is not valid. You may check with the web came vendor to get valid uri.

But it works fine on my PC with the same rtsp://<cam_ip>
I tried vlc media player and gstreamer.
I set GST_DEBUG=FACTORY:4 and found out that nvv4l2decoder is not created on desktop version
And nvv4l2decoder is the last created element on Jetson. Gstreamer stops atfer creating it.
May be I could get more information out of it

Hi,
Please set ‘export GST_DEBUG=FACTORY:4’ and share what elements are picked by uridecodebin. We can then construct the pipelines with specified elements instead of using uridecodebin. This should give some more information in debugging.

That’s what I get from

gst-launch-1.0 uridecodebin uri=rtsp://192.168.0.112 ! nvoverlaysink sync=false
0:00:00.055142959 26380   0x5586c54330 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "uridecodebin"
0:00:00.088922112 26380   0x5586c54330 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/mm/.config:/etc/xdg/xdg-unity:/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)
0:00:00.089480926 26380   0x5586c54330 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "nvoverlaysink"
0:00:00.089869319 26380   0x5586c54330 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "pipeline"
Setting pipeline to PAUSED ...
0:00:00.099921287 26380   0x5586c54330 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "rtspsrc" named "source"
0:00:00.102516286 26380   0x5586c54330 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtspreal"
0:00:00.103697872 26380   0x5586c54330 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtspwms"
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://admin:mm123q513P@192.168.0.112
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
0:00:00.677641187 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsrc"
0:00:00.679870502 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsrc"
Progress: (request) SETUP stream 0
0:00:00.722604623 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "rtpbin" named "manager"
0:00:00.724077569 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpsession"
0:00:00.725285145 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpssrcdemux"
0:00:00.727742172 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpstorage"
0:00:00.729666950 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:00.729908100 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:00.732224083 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsink"
0:00:00.733339366 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "fakesrc"
0:00:00.734621214 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsink"
0:00:00.735854259 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsrc"
0:00:00.736865633 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsrc"
0:00:00.737850652 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsrc"
Progress: (request) SETUP stream 1
0:00:00.771482303 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpsession"
0:00:00.771762100 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpssrcdemux"
0:00:00.771913770 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpstorage"
0:00:00.772077211 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:00.772167421 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:00.775097635 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsink"
0:00:00.775657385 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "fakesrc"
0:00:00.776492975 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "udpsink"
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
0:00:05.849997897 26380   0x5586cc8000 WARN                 rtspsrc gstrtspsrc.c:5427:gst_rtspsrc_reconnect:<source> warning: Could not receive any UDP packets for 5,0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.
WARNING: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Could not read from resource.
Additional debug info:
gstrtspsrc.c(5427): gst_rtspsrc_reconnect (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Could not receive any UDP packets for 5,0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.
0:00:05.995034552 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "rtpbin" named "manager"
0:00:05.996702866 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpsession"
0:00:05.997339857 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpssrcdemux"
0:00:05.997626634 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpstorage"
0:00:05.998151592 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:05.998614153 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:06.038498375 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpsession"
0:00:06.038928123 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpssrcdemux"
0:00:06.039195108 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpstorage"
0:00:06.039452456 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:06.039635481 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "funnel"
0:00:06.182385840 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpjitterbuffer"
0:00:06.183618990 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpptdemux"
0:00:06.209510749 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpjitterbuffer"
0:00:06.209740753 26380   0x5586cc8000 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtpptdemux"
0:00:08.166509656 26380   0x7fac054a30 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "decodebin"
0:00:08.167748899 26380   0x7fac054a30 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "typefind" named "typefind"
0:00:08.171021515 26380   0x7fac054850 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "decodebin"
0:00:08.171265687 26380   0x7fac054850 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:359:gst_element_factory_create: creating element "typefind" named "typefind"
0:00:08.182127150 26380   0x7fac054a30 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtph264depay"
0:00:08.182823154 26380   0x7fac054850 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "rtppcmudepay"
0:00:08.185042468 26380   0x7fac054a30 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "h264parse"
0:00:08.185646438 26380   0x7fac054850 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "mulawdec"
0:00:08.186870421 26380   0x7fac054a30 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "capsfilter"
0:00:08.192606471 26380   0x7fac054a30 INFO     GST_ELEMENT_FACTORY gstelementfactory.c:361:gst_element_factory_create: creating element "nvv4l2decoder"
Opening in BLOCKING MODE 
0:00:08.198403356 26380   0x7fac054a30 WARN                    v4l2 gstv4l2object.c:4408:gst_v4l2_object_probe_caps:<nvv4l2decoder0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:08.198477107 26380   0x7fac054a30 WARN                    v4l2 gstv4l2object.c:2370:gst_v4l2_object_add_interlace_mode:0x7f8c076f10 Failed to determine interlace mode
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261

Hi,
It is most likely an issue in network:

0:00:05.849997897 26380   0x5586cc8000 WARN                 rtspsrc gstrtspsrc.c:5427:gst_rtspsrc_reconnect:<source> warning: Could not receive any UDP packets for 5,0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.
WARNING: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Could not read from resource.
Additional debug info:
gstrtspsrc.c(5427): gst_rtspsrc_reconnect (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Could not receive any UDP packets for 5,0000 seconds, maybe your firewall is blocking it. Retrying using a tcp connection.

Please check if there is farewall or other network security check. Looks like Jetson Nano does not receive any video/audio stream.

Hi,
It’s ok, my camera is working by tcp. Uridecodebin retrys with tcp connection. I just don’t know how to specify using tcp in the first place