v4l2rtspserver
v4l2rtspserver copied to clipboard
Linux issue or v4l2 issue? ioctl issues as script
I got the v4l2rtspserver working with a USB camera and wrote a bash script that kicks the video feed off for me. The below is the bash script:
modprobe v4l2loopback video_nr=20
v4l2-ctl --set-fmt-video=width=1024,height=768 --set-ctrl=exposure_time_absolute=220
v4l2compress_omx /dev/video0 /dev/video20 &
v4l2rtspserver -W 954 -H 540 -F 15 -P 8554 /dev/video20 &
This works great if I ssh into my Raspberry Pi and kick it off manually. But I want this to run at reboot. I set up a cron job to run at reboot and launch this script, but I'm getting various weird errors, all of which are likely Linux security issues. I didn't know if anyone had ways to work around this though?
First of all, as a at boot script, for some reason bash as root can not find modprobe?
Then the subsequent errors are as follows:
VIDIOC_REQBUFS: Inappropriate ioctl for device 2020-02-10 19:16:04,340 [NOTICE] - src/V4l2MmapDevice.cpp:141 Device /dev/video20 VIDIOC_STREAMOFF: Inappropriate ioctl for device VIDIOC_REQBUFS: Inappropriate ioctl for device 2020-02-10 19:16:04,340 [WARN ] - src/v4l2compress_omx.cpp:146 Cannot create V4L2 output interface for device:/dev/video20