Issues with rtsp server Deepstream pipeline

Hello. I am having issues with the following pipeline:

docker-compose.yml:

version: '3.7'

networks:
  embedded_jetson_network:

services:
  rtsp-server-service:
    image: embedded_jetson_rtsp_server_service
    env_file:
      - rtsp_server/rtsp_server.env
    privileged: true
    volumes:
      - /dev/video0:/dev/video0
    ports:
      - 8554:8554
    networks:
      - embedded_jetson_network

Dockerfile:

FROM nvcr.io/nvidia/deepstream-l4t:5.1-21.02-base

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y ; \
    apt-get install -y --no-install-recommends \
        python3 \
        python3-pip \
        python3-dev \
        python3-gi \
        python3-gst-1.0 \
        python3-numpy \
        libgirepository1.0-dev \
        gobject-introspection \
        gir1.2-gst-rtsp-server-1.0 \
        libgstrtspserver-1.0-dev \
        gstreamer1.0-rtsp \
        netcat-traditional

# Install required python libraries
ADD requirements.txt requirements.txt
RUN pip3 install --upgrade pip setuptools
RUN pip3 install -r requirements.txt

# Intall Python bindings for DeepStream Metadata libraries
RUN cd /opt/nvidia/deepstream/deepstream/lib && python3 setup.py install

CMD /run.sh

# This should be the last thing in the dockerfile
RUN date >> /etc/image_build_date.txt ; chmod 444 /etc/image_build_date.txt

run.sh:

#!/bin/sh
wget https://raw.githubusercontent.com/GStreamer/gst-rtsp-server/1.14.5/examples/test-launch.c
gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
GST_DEBUG=3 ./test-launch "videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"

Error log after connecting with another system to the rtsp stream rtsp://192.168.2.205:8554/test:

docker-compose up rtsp-server-service
WARNING: The DISPLAY variable is not set. Defaulting to a blank string.
Recreating embeddedjetsonplatform_rtsp-server-service_1 ... done
Attaching to embeddedjetsonplatform_rtsp-server-service_1
rtsp-server-service_1                 | --2021-10-14 23:45:21--  https://raw.githubusercontent.com/GStreamer/gst-rtsp-server/1.14.5/examples/test-launch.c
rtsp-server-service_1                 | Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.108.133, ...
rtsp-server-service_1                 | Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
rtsp-server-service_1                 | HTTP request sent, awaiting response... 200 OK
rtsp-server-service_1                 | Length: 3031 (3.0K) [text/plain]
rtsp-server-service_1                 | Saving to: 'test-launch.c'
rtsp-server-service_1                 | 
rtsp-server-service_1                 |      0K ..                                                    100% 11.1M=0s
rtsp-server-service_1                 | 
rtsp-server-service_1                 | 2021-10-14 23:45:22 (11.1 MB/s) - 'test-launch.c' saved [3031/3031]
rtsp-server-service_1                 | 
rtsp-server-service_1                 | 0:00:00.570871238    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x120000: 'AVR (Audio Visual Research)' is not mapped
rtsp-server-service_1                 | 0:00:00.570923791    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x180000: 'CAF (Apple Core Audio File)' is not mapped
rtsp-server-service_1                 | 0:00:00.570946292    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x100000: 'HTK (HMM Tool Kit)' is not mapped
rtsp-server-service_1                 | 0:00:00.570964781    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xc0000: 'MAT4 (GNU Octave 2.0 / Matlab 4.2)' is not mapped
rtsp-server-service_1                 | 0:00:00.570978219    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xd0000: 'MAT5 (GNU Octave 2.1 / Matlab 5.0)' is not mapped
rtsp-server-service_1                 | 0:00:00.570990928    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x210000: 'MPC (Akai MPC 2k)' is not mapped
rtsp-server-service_1                 | 0:00:00.571006345    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0xe0000: 'PVF (Portable Voice Format)' is not mapped
rtsp-server-service_1                 | 0:00:00.571022074    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x160000: 'SD2 (Sound Designer II)' is not mapped
rtsp-server-service_1                 | 0:00:00.571041137    17   0x558c31e990 WARN                 default gstsf.c:98:gst_sf_create_audio_template_caps: format 0x190000: 'WVE (Psion Series 3)' is not mapped
rtsp-server-service_1                 | 0:00:00.609860419    17   0x558c31e990 WARN                  ladspa gstladspa.c:507:plugin_init:<plugin170> no LADSPA plugins found, check LADSPA_PATH
rtsp-server-service_1                 | 0:00:00.842449074    17   0x558c31e990 WARN                     omx gstomx.c:2826:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs (searched in: /root/.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)
rtsp-server-service_1                 | (Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 205)
rtsp-server-service_1                 | (Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)
rtsp-server-service_1                 | 0:00:00.879537592    17   0x558c31e990 WARN      GST_PLUGIN_LOADING gstplugin.c:792:_priv_gst_plugin_load_file_for_registry: module_open failed: /usr/lib/aarch64-linux-gnu/libnvinfer.so.7: file too short
rtsp-server-service_1                 | 
rtsp-server-service_1                 | (gst-plugin-scanner:17): GStreamer-WARNING **: 23:45:23.537: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_osd.so': /usr/lib/aarch64-linux-gnu/libnvinfer.so.7: file too short
rtsp-server-service_1                 | 0:00:00.924673305    17   0x558c31e990 WARN      GST_PLUGIN_LOADING gstplugin.c:792:_priv_gst_plugin_load_file_for_registry: module_open failed: /usr/lib/aarch64-linux-gnu/libnvinfer.so.7: file too short
rtsp-server-service_1                 | 
rtsp-server-service_1                 | (gst-plugin-scanner:17): GStreamer-WARNING **: 23:45:23.582: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': /usr/lib/aarch64-linux-gnu/libnvinfer.so.7: file too short
rtsp-server-service_1                 | 0:00:00.933041809    17   0x558c31e990 WARN      GST_PLUGIN_LOADING gstplugin.c:792:_priv_gst_plugin_load_file_for_registry: module_open failed: /usr/lib/aarch64-linux-gnu/libnvparsers.so.7: file too short
rtsp-server-service_1                 | 
rtsp-server-service_1                 | (gst-plugin-scanner:17): GStreamer-WARNING **: 23:45:23.590: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_infer.so': /usr/lib/aarch64-linux-gnu/libnvparsers.so.7: file too short
rtsp-server-service_1                 | 0:00:00.946519220    17   0x558c31e990 WARN      GST_PLUGIN_LOADING gstplugin.c:792:_priv_gst_plugin_load_file_for_registry: module_open failed: /usr/lib/aarch64-linux-gnu/libnvparsers.so.7: file too short
rtsp-server-service_1                 | 
rtsp-server-service_1                 | (gst-plugin-scanner:17): GStreamer-WARNING **: 23:45:23.604: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferaudio.so': /usr/lib/aarch64-linux-gnu/libnvparsers.so.7: file too short
rtsp-server-service_1                 | stream ready at rtsp://127.0.0.1:8554/test
rtsp-server-service_1                 | 0:00:27.433165806    16   0x7fa4007770 WARN                    v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x7fa40e5600 Failed to determine interlace mode
rtsp-server-service_1                 | 0:00:27.433266537    16   0x7fa4007770 WARN                    v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x7fa40e5600 Failed to determine interlace mode
rtsp-server-service_1                 | 0:00:27.433308882    16   0x7fa4007770 WARN                    v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x7fa40e5600 Failed to determine interlace mode
rtsp-server-service_1                 | 0:00:27.433358102    16   0x7fa4007770 WARN                    v4l2 gstv4l2object.c:2388:gst_v4l2_object_add_interlace_mode:0x7fa40e5600 Failed to determine interlace mode
rtsp-server-service_1                 | 0:00:27.433491177    16   0x7fa4007770 WARN                    v4l2 gstv4l2object.c:4476:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
rtsp-server-service_1                 | 0:00:27.434953395    16   0x7f9c005590 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
rtsp-server-service_1                 | NvMMLiteOpen : Block : BlockType = 4 
rtsp-server-service_1                 | ===== NVMEDIA: NVENC =====
rtsp-server-service_1                 | NvMMLiteBlockCreate : Block : BlockType = 4 
rtsp-server-service_1                 | 0:00:27.439741514    16   0x7f9c005590 WARN          v4l2bufferpool gstv4l2bufferpool.c:1065:gst_v4l2_buffer_pool_start:<nvv4l2h264enc0:pool:src> Uncertain or not enough buffers, enabling copy threshold
rtsp-server-service_1                 | H264: Profile = 66, Level = 0 
rtsp-server-service_1                 | NVMEDIA_ENC: bBlitMode is set to TRUE 
rtsp-server-service_1                 | 0:00:27.453189758    16   0x7f94002000 WARN          v4l2bufferpool gstv4l2bufferpool.c:1512:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:src> Driver should never set v4l2_buffer.field to ANY
rtsp-server-service_1                 | 0:00:27.455786426    16   0x5572d43e30 FIXME              rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
rtsp-server-service_1                 | 0:00:27.507384620    16   0x5572d43e30 ERROR             rtspclient rtsp-client.c:1718:handle_play_request: client 0x5572fa8150: media not found
rtsp-server-service_1                 | 0:00:27.508075467    16   0x5572d43e30 ERROR             rtspclient rtsp-client.c:1270:handle_teardown_request: client 0x5572fa8150: no media for uri
rtsp-server-service_1                 | Opening in BLOCKING MODE 
rtsp-server-service_1                 | 0:00:27.519625912    16   0x5572d43e30 WARN               rtspmedia rtsp-media.c:4156:gst_rtsp_media_set_state: media 0x7fa41032c0 was not prepared

Guidance would be appreciated. I have a montor connected if that matters

This seems to be an issue with my VLC. The follow gstreamer pipeline on my laptop worked fine.

gst-launch-1.0 rtspsrc location=rtsp://user:pass@192.168.2.205:8554/rtsp/camera latency=0 ! application/x-rtp,media=video,encoding-name=H264 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink

Glad to know issue resolved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.