About to start a streaming server with RTSP and gstreamer on ubuntu 18.04 on the jetson nano

Hello to everyone.

Im working on this project :

At some point I will need to mount my camera (waveshare ; IMX219-77IR) on top of the drone and I would like to use Windows or Linux outside of nomachine (because the nano will be in headless mode),to display what the camera sees when the drone is flying. For this reason I’m trying to configure a gstreamer with RTSP to start a streaming server on the Ubuntu 18.04 that I have installed on the jetson nano. (Keep in consideration that I will attach to the nano the “huawei e3372 4g” dongle to provide to the drone a mobile connection,instead of a wi-fi connection and this may have an impact on the performance of the encoder used).

To achieve my goal this is the thread that I’m following :

At some point DaneLLL says :

Please also try test-launch.c @ https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-launch.c 136

Target

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

gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)

./test-launch “videotestsrc ! omxh265enc ! rtph265pay name=pay0 pt=96”

Host

Open network stream rtsp://<TARGET_IP_ADDRESS>:8554/test via VLC

it seems that it worked :

root@ziomario-desktop:/home/ziomario/Desktop/Tools2# gcc test-launch.c -o test-launch $(pkg-config --cflags --libs gstreamer-1.0 gstreamer-rtsp-server-1.0)

root@ziomario-desktop:/home/ziomario/Desktop/Tools2# ./test-launch “videotestsrc ! omxh265enc ! rtph265pay name=pay0 pt=96”

stream ready at rtsp://127.0.0.1:8554/test

but only on the server side. I’m not able to connect to it using VLC…below you can see some screenshots that show you how I have configured VLC…

https://drive.google.com/drive/folders/1hene2_WM8Qym1VsRzlMOUpeyHH1syR5B?usp=sharing

I tried both places : I tried to connect VLC to 127.0.0.1 locally,inside ubuntu where it runs nomachine server and outside,in windows,trying to connect VLC to 192.168.1.3 that’s the internal IP of nano / ubuntu on my LAN. It does not connect.

Please give me a suggestion about how to fix it,thanks. Can you tell me where the error is ? thanks.

Hi,
We have deprecated omx plugins and have updated steps in

Jetson Nano FAQ
Q: Is there any example of running RTSP streaming?

Please take a look and give it a try.

I tried some examples on the site that u have suggested and this is what I’ve got :

ziomario@ziomario-desktop:~$ v4l2-ctl -d /dev/video0

ziomario@ziomario-desktop:~$ gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvoverlaysink

nvbuf_utils: Could not get EGL display connection

Setting pipeline to PAUSED …

Pipeline is live and does not need PREROLL …

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.

Additional debug info:

gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

streaming stopped, reason not-negotiated (-4)

ERROR: pipeline doesn’t want to preroll.

Setting pipeline to PAUSED …

Setting pipeline to READY …

Setting pipeline to NULL …

Freeing pipeline …


with the HDMI monitor attached I get the following error :


gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvoverlaysink

Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

ziomario@ziomario-desktop:~$ gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! video/x-raw(memory:NVMM),format=UYVY,width=640,height=480,framerate=30/1 ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvoverlaysink

bash: syntax error near unexpected token `(’

instead,when i give this command :

$ ./test-launch “videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96”
stream ready at rtsp://127.0.0.1:8554/test

nvbuf_utils: Could not get EGL display connection
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 0

in headless mode and with the HDMI monitor attached,this is what I see on VLC,when I open this address outside of the jetson nano (I’m on windows 10 and the IP address 192.168.1.3 is the IP number assigned to the nano,that’s running in headless mode) : rtsp://192.168.1.3:8554/test

it does not work even locally. When I open the address : rtsp://127.0.0.1:8554/test or rtsp://192.168.1.3:8554/test,with VLC,it closes itself.

Hi,
It seems like you may miss some drivers in kernel, or some packages are mismatched in release versions. On a good system, this print should not be seen:

nvbuf_utils: Could not get EGL display connection

So we would suggest do clean re-flash and run

$ ./test-launch "videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96"

See if the print disappears.

And on the same Jetson Nano, you may open the other console and run this pipeline to decode the RTSP stream:

$ gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! nvoverlaysink

The error message “nvbuf_utils: Could not get EGL display connection” does appear because I’ve logged into ubuntu with nomachine ? anyway,today finally has come to my home an HDMI to DVI cable and I can use the nano also without nomachine,because it works with an old VGA/DVI monitor that I had. Yes,you are right,when I run this command " ./test-launch “videotestsrc ! nvvidconv ! nvv4l2h264enc ! h264parse ! rtph264pay name=pay0 pt=96” I don’t get the error message “nvbuf_utils: Could not get EGL display connection” and this is the proof that this error happens when I use the nano in headless mode,as I have told you in the previous message. Anyway,your command print on the screen of the terminal 1 this message :

opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
NVMEDIA : NVENC
H264: profile = 66 , level = 0

I have also opened another terminal window where I have issued your second command,like this :

gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! nvoverlaysink

Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://127.0.0.1:8554/test
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
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
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
^Chandling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:00:38.665120593
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

and I’ve got the same picture as before.

Hi,
The picture is from videotestsrc plugin. If you see it, it works fine with the test source. If you replace videotestsrc with your source, it should work fine.

it didn’t work. check the image below :

tried also :

./test-launch “v4l2src device=/dev/video0 ! nvvidconv ! nvv4l2h264enc ! h264parse ! queue ! rtph264pay name=pay0 pt=96”

error is :

ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unhandled error
Additional debug info:
gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Service Unavailable (503)
ERROR: pipeline doesn’t want to preroll.

Hi,
Please check if you can run the command line in

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1' ! nvoverlaysink -e

IF the TV does not support 4K, please try

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1' ! nvvidconv ! 'video/x-raw(memory:NVMM), width=1920, height=1080' ! nvoverlaysink -e

Seems like it is a Bayer sensor and need to use nvarguscamerasrc.

it works,but what I want to do is to start a streaming server with RTSP and gstreamer on the nano…your command does not allow to do that.

Hi,
Please try this command:

$ ./test-launch "nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM),width=3280,height=2464,format=NV12,framerate=20/1 ! video/x-raw(memory:NVMM),width=1920,height=1080 ! nvv4l2h264enc insert-sps-pps=true ! h264parse ! rtph264pay name=pay0 pt=96"

this is what happens. when I start your command only,without the second one (gst-launch-1.0 uridecodebin uri=rtsp://127.0.0.1:8554/test ! nvoverlaysink) :

(test-launch:22940): GStreamer-CRITICAL **: 14:31:10.754: gst_element_make_from_uri: assertion ‘gst_uri_is_valid (uri)’ failed
Opening in BLOCKING MODE
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.
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success

vlc can’t connect to rtsp://127.0.0.1:8554/test

instead if I ran also the second command,this is the error :

ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unhandled error
Additional debug info:
gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Service Unavailable (503)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

Hi,
You should run the command on Jetson Nano:

$ ./test-launch "nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM),width=3280,height=2464,format=NV12,framerate=20/1 ! video/x-raw(memory:NVMM),width=1920,height=1080 ! nvv4l2h264enc insert-sps-pps=true ! h264parse ! rtph264pay name=pay0 pt=96"

And on another host PC, if it is in Window system, you can install/open VLC, choose [Media] → [Open Network Stream] and enter

rtsp://_IP_ADDRRESS_OF_NANO_:8554/test

If it is Linux, you can run

$ gst-launch-1.0 uridecodebin uri=rtsp://_IP_ADDRRESS_OF_NANO_:8554/test ! xvimagesink

Hi.

I follow all the conversation because I have the same problem. The solution didn’t work for me. I tried

gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), width=1920, height=1080’ ! nvoverlaysink -e

And it’s work. But when I try the command in the solution didn’t work, the error it’s the same:

(test-launch:11312): GStreamer-CRITICAL **: 10:38:06.922: gst_element_make_from_uri: assertion ‘gst_uri_is_valid (uri)’ failed
Opening in BLOCKING MODE
Opening in BLOCKING MODE
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.
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success

(test-launch:11312): GStreamer-CRITICAL **: 10:38:08.105: gst_element_make_from_uri: assertion ‘gst_uri_is_valid (uri)’ failed
Opening in BLOCKING MODE
Opening in BLOCKING MODE
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.
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success

I’m using Jetson Nano with the camera IMX219-77.

Thanks.

You may try one of the sensor’s native modes listed instead.

Anyway, it seems running (using native mode 1920x1080@30). Your issue may be that nvoverlaysink is displaying to HDMI display while you may use a DP monitor. In such case, you would try setting display-id property of nvoverlaysink:

... ! nvoverlaysink display-id=1

Hi, I have connected the jetson to HDMI monitor and I’m trying open the streaming in a laptop. I don’t want to see the streaming in the same device.

Thanks.

I found the solution, I tried with this line

./test-launch “nvarguscamerasrc ! video/x-raw(memory:NVMM), format=NV12, width=1920, height=1080, framerate=30/1 ! nvvidconv ! video/x-raw, width=640, height=480, format=NV12, framerate=30/1 ! omxh265enc ! rtph265pay name=pay0 pt=96 config-interval=1”

2 Likes