mpromonet / v4l2rtspserver

RTSP Server for V4L2 device capture supporting HEVC/H264/JPEG/VP8/VP9
The Unlicense
1.86k stars 428 forks source link

RTSP Server With a V4l2Loopback camera #272

Open alecatalfamo opened 2 years ago

alecatalfamo commented 2 years ago

I'm trying to launch [v4l2rtspserver] passing a v4l2loopback camera in which a mp4 file is redirected. The problem is that that camera does not support any requested formats. Does exist a solution for this problem?. I attach the error returned by v4l2loopback but you can imagine it.

[ERROR] /home/pi/Desktop/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:207
        /dev/video3: Cannot set format:H264 Invalid argument
[ERROR] /home/pi/Desktop/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:207
        /dev/video3: Cannot set format:MJPG Invalid argument
[ERROR] /home/pi/Desktop/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:207
        /dev/video3: Cannot set format:JPEG Invalid argument
[ERROR] /home/pi/Desktop/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:83
        Cannot init device:/dev/video3
[NOTICE] /home/pi/Desktop/v4l2rtspserver/v4l2wrapper/src/V4l2MmapDevice.cpp:141
VIDIOC_STREAMOFF: Bad file descriptor
VIDIOC_REQBUFS: Bad file descriptor
mpromonet commented 2 years ago

Hi,

If this is a v4l2loopback, the capture format is fixed by the loopback input. Then it needs to be in a format supported by v4l2rtspserver or you can convert it with something like https://github.com/mpromonet/v4l2tools or some ffmpeg/gstreamer command.

Best Regards, Michel.