RTSP sink does not show picture on connect

I wrote a simple pipeline in C.
nvarguscamerasrc → nvv4l2h264enc → h264parse → rtph264pay ->udpsink.
I can compile and execute it, but when I connect to the stream with VLC, I cannot see a picture, but the “timer” of VLC is running.

I exported GST_DEBUG=3 for better debugging.
This is the output until I connect to the stream:

 *** RTSP STREAM at rtsp:localhost:8554/gt ***

Opening in BLOCKING MODE
Opening in BLOCKING MODE 
0:00:00.132187637  7766   0x55b4e5c0c0 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x55b4e29d90 Failed to determine interlace mode
0:00:00.132285350  7766   0x55b4e5c0c0 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x55b4e29d90 Failed to determine interlace mode
0:00:00.132344520  7766   0x55b4e5c0c0 WARN                    v4l2 gstv4l2object.c:2375:gst_v4l2_object_add_interlace_mode:0x55b4e29d90 Failed to determine interlace mode
0:00:00.132454370  7766   0x55b4e5c0c0 WARN                    v4l2 gstv4l2object.c:4434:gst_v4l2_object_probe_caps:<encode:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
Running...
0:00:00.134016222  7766   0x55b4e22280 FIXME                default gstutils.c:3981:gst_pad_create_stream_id_internal:<source:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
NvMMLiteOpen : Block : BlockType = 4 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
0:00:00.139545834  7766   0x55b4e22280 WARN          v4l2bufferpool gstv4l2bufferpool.c:1065:gst_v4l2_buffer_pool_start:<encode:pool:src> Uncertain or not enough buffers, enabling copy threshold
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 2 
   Output Stream W = 1920 H = 1080 
   seconds to Run    = 0 
   Frame Rate = 29.999999 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
H264: Profile = 66, Level = 0 
0:00:01.064447748  7766   0x55b4e221e0 WARN          v4l2bufferpool gstv4l2bufferpool.c:1512:gst_v4l2_buffer_pool_dqbuf:<encode:pool:src> Driver should never set v4l2_buffer.field to ANY

And when I connect to it, I also get this.

sensor:7766): GLib-GObject-WARNING **: 08:01:47.172: g_object_get_is_valid_property: object class 'GstUDPSrc' has no property named 'pt'
0:01:16.368927264  7766   0x7f8c018630 WARN              rtspstream rtsp-stream.c:3538:gst_rtsp_stream_get_rtpinfo: Could not get payloader stats
0:01:16.369057476  7766   0x7f8c018630 FIXME              rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:01:16.955577333  7766   0x7f8c018630 FIXME              rtspmedia rtsp-media.c:3841:gst_rtsp_media_suspend: suspend for dynamic pipelines needs fixing
0:01:16.955655355  7766   0x7f8c018630 WARN               rtspmedia rtsp-media.c:3867:gst_rtsp_media_suspend: media 0x7f6000d2c0 was not prepared
0:01:18.307973796  7766   0x7f8c018630 FIXME             rtspclient rtsp-client.c:1657:handle_play_request:<GstRTSPClient@0x7f8c019db0> Add support for seek style (null)
0:01:18.308637927  7766   0x7f8c018630 FIXME              rtspmedia rtsp-media.c:2437:gst_rtsp_media_seek_full:<GstRTSPMedia@0x7f6000d2c0> Handle going back to 0 for none live not seekable streams.

It is also very strange that htop shows around 15 /usr/sbin/nvargus-deamon processes and responsiveness gets really bad.

For the RTSP server code I adapted the code from this post.
Do you have an idea why I cannot see the stream?

Hi,
For running RTSP. we suggest try test-launch. Please refer to
Jetson Nano FAQ
[Q: Is there any example of running RTSP streaming?]

For setting up UDP, please refer to this topic:
Gstreamer TCPserversink 2-3 seconds latency - #13 by Bazziil

Hello,
The test launch application in the link you provided, does not compile:

gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)
test-launch.c: In function ‘main’:
test-launch.c:77:3: warning: implicit declaration of function ‘gst_rtsp_media_factory_set_enable_rtcp’; did you mean ‘gst_rtsp_media_factory_set_latency’? [-Wimplicit-function-declaration]
   gst_rtsp_media_factory_set_enable_rtcp (factory, !disable_rtcp);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   gst_rtsp_media_factory_set_latency
/tmp/cc1gcbI4.o: In function `main':
test-launch.c:(.text+0x154): undefined reference to `gst_rtsp_media_factory_set_enable_rtcp'
collect2: error: ld returned 1 exit status

This is my current pipeline that is running, but not showing anything on the stream, as I said in my original post.

Hi,
Probably you miss this step:

sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev

Unfortunately not.

$ sudo apt-get install libgstrtspserver-1.0 libgstreamer1.0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libgstrtspserver-1.0-0' for regex 'libgstrtspserver-1.0'
Note, selecting 'libgstrtspserver-1.0-0-dbg' for regex 'libgstrtspserver-1.0'
Note, selecting 'libgstrtspserver-1.0-dev' for regex 'libgstrtspserver-1.0'
Note, selecting 'libgstrtspserver-1.0-doc' for regex 'libgstrtspserver-1.0'
libgstreamer1.0-dev is already the newest version (1.14.5-0ubuntu1~18.04.2).
libgstrtspserver-1.0-0 is already the newest version (1.14.5-0ubuntu1~18.04.1).
libgstrtspserver-1.0-0-dbg is already the newest version (1.14.5-0ubuntu1~18.04.1).
libgstrtspserver-1.0-dev is already the newest version (1.14.5-0ubuntu1~18.04.1).
libgstrtspserver-1.0-doc is already the newest version (1.14.5-0ubuntu1~18.04.1).
The following packages were automatically installed and are no longer required:
  cmake-data libcurl4 librhash0 libuv1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I looked into the source of the rtsp library and there is no function called
gst_rtsp_media_factory_set_enable_rtcp in rtsp-media-factory.h. This function is used in the test-launch example and this function is also the reason why I can’t compile it.

Maybe you are trying to compile a newer version such as master branch.
You would check out tag 1.14.5, and use this source.

2 Likes

Thank you this one works. I was just using the version that was linked in the FAQ

Thank Honey_Patouceul for pointing out the issue. Have updated the link in FAQ.

1 Like

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