Issue with RTSP streaming and decoding to v4l2loopback

It may be related to your v4l2loopback version.

It works in my case using 0.12.3 built with dkms such as Gstreamer v4l2loopback hw mjpeg stream - #5 by Honey_Patouceul. (this post was building 0.12.5).

I made RTSP server with test-launch:

./test-launch "videotestsrc ! nvvidconv ! nvv4l2h265enc insert-sps-pps=1 insert-vui=1 idrinterval=15 ! h265parse ! rtph265pay name=pay0"

Then installed v4l2loopback. Note that if you change format, framerate or else you may have to unload the module with rmmod and reinstall.
Then launched a pipeline connecting to RTSP server, decoding and sending to v4l2sink. Note that you would use identity with drop-allocation property set:

sudo rmmod v4l2loopback
sudo modprobe v4l2loopback

#My AGX had no camera, so the virtual node is video0
gst-launch-1.0 rtspsrc latency=0 location=rtsp://127.0.0.1:8554/test ! rtph265depay ! queue ! h265parse ! nvv4l2decoder ! nvvidconv ! videoconvert ! identity drop-allocation=1 ! v4l2sink device=/dev/video0

v4l2-ctl -d0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)

and using the virtual video node works, although a bit slow:

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! autovideosink

The messages failed to open /dev/video4: No such file or directory… are because you gave number 41 to your virtual node, but there are many available nodes with lower number. Probably using /dev/video4 for v4l2loopback would fix this.

1 Like