Encoded RTSP streaming examples

Dear Gstreamer experts,

I am not familiar with Gstreamer as well as H264/H265 accelerated encoding by Jetson hardware. Could you help to share some example of working pipeline to stream the video from the Sony FCB-EV9500M to remote laptop/desktop, please ?

Below is the info of the video devices in the running system (based on Jetpack-5.0.2) :

$ v4l2-ctl --list-devices
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
	/dev/media0

vi-output, ev9500m 8-0010 (platform:tegra-capture-vi:0):
	/dev/video0

vi-output, adv7280 8-0020 (platform:tegra-capture-vi:4):
	/dev/video1

Thanks in advance

Hi,
Please check the examples in Jetson Nano FAQ

Q: Is there any example of running RTSP streaming?
Q: Is there an example for running UDP streaming?

Hi @DaneLLL,

Thank you for your instruction. I was able to stream the test pattern with :

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

on the Jetson NX side and visualize with VLC software (rtsp://<SERVER_IP_ADDRESS>:8554/test ).

However, I tried to do the same thing with my CSI camera /dev/video0 as below:

$ v4l2-ctl --list-devices
NVIDIA Tegra Video Input Device (platform:tegra-camrtc-ca):
	/dev/media0

vi-output, ev9500m 8-0010 (platform:tegra-capture-vi:0):
	/dev/video0
$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'UYVY' (UYVY 4:2:2)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.017s (60.000 fps)
	[1]: 'NV16' (Y/CbCr 4:2:2)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.017s (60.000 fps)
	[2]: 'UYVY' (UYVY 4:2:2)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.017s (60.000 fps)

with below command for Jetson NX side :

./test-launch "nvarguscamerasrc ! video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=NV12 ! nvvidconv ! nvv4l2h265enc ! h265parse ! rtph265pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test

When I launch the VLC with rtsp

://<SERVER_IP_ADDRESS>:8554/test, the following error:

Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 8 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 16.000000; Exposure Range min 34000, max 550385000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 0 
   Output Stream W = 1920 H = 1080 
   seconds to Run    = 0 
   Frame Rate = 59.999999 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadExecute:694 NvBufSurfaceFromFd Failed.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, threadFunction:247 (propagating)
GST_ARGUS: Cleaning up

Could you help to troubleshoot, please?
Khang

Hi,
Please use v4l2src(or nvv4l2camerasrc) for UYVY format. You may check Jetson Nano FAQ

Q: I have a USB camera. How can I launch it on Jetson Nano?

Hi @DaneLLL ,

For Jetson Xavier NX side, I tried

./test-launch "nvv4l2camerasrc device=/dev/video0 ! video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=UYVY ! nvvidconv ! nvv4l2h265enc ! h265parse ! rtph265pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 8 
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 
NVMEDIA: H265 : Profile : 1 
NVMEDIA: Need to set EMC bandwidth : 141000 
NVMEDIA: Need to set EMC bandwidth : 141000 
NVMEDIA_ENC: bBlitMode is set to TRUE

But on client side, VLC could not visualize even-though it reported no error.

Best,
Khang

Hi,
Please tryv4l2src. See if the plugin works.

Hi,
I got following error when starting VLC :

$ ./test-launch "v4l2src device=/dev/video0 ! video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=UYVY ! nvvidconv ! nvv4l2h265enc ! h265parse ! rtph265pay name=pay0 pt=96"
stream ready at rtsp://127.0.0.1:8554/test
Opening in BLOCKING MODE 
Opening in BLOCKING MODE 
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 1920 x 1080 ; Framerate = 59.999999; Analog Gain Range Min 1.000000, Max 16.000000, Exposure Range Min 34000, Max 550385000

DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
Not Implemented
Segmentation fault (core dumped)

Try removing (memory:NVMM). v4l2src uses system memory.

1 Like

Hi @Honey_Patouceul ,

Your solution works for me. Thank you very much!

Just last question : I cannot use nvarguscamerasrc, can I ?

Hi,

No. The nvarguscamerasrc plugin is for Bayer sensors using ISP engine. It supports RAW formats such as BG10.

1 Like

Hi @DaneLLL ,

Thanks very much. We are going to use many RAW Bayer sensors and this information is really useful.

Best Regards,
Khang

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