Open dfbills opened 5 years ago
/dev/video1
is created by the v4l2loopback kernel extension and is needed to allow multiple access to the camera stream.
If /dev/video1
is not available, please verify that the camera is correctly connected to the RPi as shown in the wiki.
I have the exact same issue with both my v2 v1 pi camera I’m sure that the camera is connected to the RPi It is able to see video and take picture with the “raspistill -o image.png” command
@xd94402002 Did you install the pre-configured Raspbian image or just installed the hkcam binary?
I installed on my pi3 through playbook I found that it doesn’t install the v4l2loopback module After manually install v4l2loopback the cam start streaming
Additionally,the FPS just 5. Is that the performance limit on rpi ? The average cpu usage is under 5%. It seem like it doesn’t make full use of the resources.
I've got the same /dev/video1 error, the camera cable wasn't plugged correctly.
I facing the same issue. camera is plugged in correctly. I'm using the provided Image 0.0.8. I guess it happened after I expanded the disk
@benbeton - I also expanded my disk as I'm running on a 64GB card. I haven't had a chance to rebuild from scratch yet.
hello @brutella I have the same problem with these specs:
I could connect it to wifi and ssh, I also could add the camera in “Home” but no image is shown. Then I connected another USB camera and that one did create the video1 and could stream from there, but the raspi cam seems to fail to work.
So, a quick update. I've got this error a couple of times on a working camera after the reboot. The solution I found was to kill the hkcam processes:
pi@raspicam:~ ps aux | grep hkcam root 558 0.0 0.0 1684 364 ? Ss 14:15 0:00 runsv hkcam root 564 0.0 0.0 1828 324 ? S 14:15 0:00 svlogd -tt /var/log/hkcam root 565 0.7 1.3 801948 10256 ? Sl 14:15 0:00 hkcam --min_video_bitrate=2048 --data_dir=/var/lib/hkcam/data --verbose=true pi 736 0.0 0.0 3492 396 pts/1 S+ 14:17 0:00 tail -f /var/log/hkcam/current pi 742 0.0 0.0 4368 536 pts/0 S+ 14:17 0:00 grep --color=auto hkcam
pi@raspicam:~ sudo kill -9 558 564 565
hkcam will restart by itself and the error disappeared
after killing the processes, did u rerun again the process?
No, it restarts by itself. But now I have to do it after each reboot. It looks like a wrong order of operations.
I'm seeing the same thing, and raspistill
gets the image just fine. I -also- did a disk expansion followed by an apt-get update/dist-upgrade. The loopback module is not being loaded properly in the kernel. The problem is that the version supplied with raspbian stretch is incompatible with the current raspbian-stretch kernel (the kernel developers removed a backwards compatible kernel API (setup_timer) during a linux point release).
@brutella solved this by picking up a new version from GitHub, instead of using v4l2loopback-dkms.
I think the correct solution, really, is to upgrade this whole mess to buster, since stretch is ancient anyway (and it will ensure we continue to get security updates).
However, the temporary way to solve this is to use the ansible playbook, or issue the commands from the playbook to download the version from GitHub and compile/install that version of v4l2loopback. You'll need to do this any time you update the kernel (which is an annoying problem).
After manually install v4l2loopback the cam start streaming
Did this as well (on top of apt-get upgrade/update, and expanding my SD card) and that brought the camera back to life. Pretty much what @pleasantone said here.
Yeah, getting the v4l2loopback kernel extension working is no fun.
@pleasantone Is there any chance you could detail your fix a little more?
I flashed my Pi Zero W with the latest pre-built from this repo. Added Wifi and SSH to remote manage it. After first boot, I expanded the filesystem and ran apt-get update/upgrade.
I wound up with OP's problem but I'm having trouble following your repair steps. I've never used ansible and after installing it on the Pi and copying over the ansible folder-- it fails to run.
The error I get is:
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.
The error appears to have been in '/home/pi/hkcam-master/ansible/roles/hkcam/tasks/configure.yml': line 41, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Reboot
^ here
The error appears to have been in '/home/pi/hkcam-master/ansible/roles/hkcam/tasks/configure.yml': line 41, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Reboot
^ here
After getting everything working 100% again, I started tinkering around with the core Pi software and somehow managed to break it again. After expanding my disk size in raspi-config, I know that I: updated the locale, WiFi frequencies, time zone, cleared apt update files, updated Pi firmware, and renamed the host back to raspberrypi.local from raspberrypi-2.local.
Log files show obvious error of:
/dev/video1: No such file or directory
Checking the devices, I see:
video0 video10 video11 video12
But, obviously no video1. Not sure how to re-assign device IDs
Raw log:
pi@raspberrypi:/var/log/hkcam $ vcgencmd get_camera supported=1 detected=1 pi@raspberrypi:/var/log/hkcam $ tail -f current 2019-06-01_20:12:47.95427 libavcodec 57. 64.101 / 57. 64.101 2019-06-01_20:12:47.95448 libavformat 57. 56.101 / 57. 56.101 2019-06-01_20:12:47.95467 libavdevice 57. 1.100 / 57. 1.100 2019-06-01_20:12:47.95487 libavfilter 6. 65.100 / 6. 65.100 2019-06-01_20:12:47.95528 libavresample 3. 1. 0 / 3. 1. 0 2019-06-01_20:12:47.95553 libswscale 4. 2.100 / 4. 2.100 2019-06-01_20:12:47.95574 libswresample 2. 3.100 / 2. 3.100 2019-06-01_20:12:47.95593 libpostproc 54. 1.100 / 54. 1.100 2019-06-01_20:12:47.99827 [video4linux2,v4l2 @ 0x1cfa310] Cannot open video device /dev/video1: No such file or directory 2019-06-01_20:12:47.99890 /dev/video1: No such file or directory 2019-06-01_20:12:54.66859 DEBUG 2019/06/01 16:12:54 resource.go:43: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 POST /resource 2019-06-01_20:12:56.13406 ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers 2019-06-01_20:12:56.13542 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 2019-06-01_20:12:56.13626 configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared 2019-06-01_20:12:56.13944 libavutil 55. 34.101 / 55. 34.101 2019-06-01_20:12:56.14053 libavcodec 57. 64.101 / 57. 64.101 2019-06-01_20:12:56.14159 libavformat 57. 56.101 / 57. 56.101 2019-06-01_20:12:56.14281 libavdevice 57. 1.100 / 57. 1.100 2019-06-01_20:12:56.14389 libavfilter 6. 65.100 / 6. 65.100 2019-06-01_20:12:56.14663 libavresample 3. 1. 0 / 3. 1. 0 2019-06-01_20:12:56.14836 libswscale 4. 2.100 / 4. 2.100 2019-06-01_20:12:56.14945 libswresample 2. 3.100 / 2. 3.100 2019-06-01_20:12:56.15053 libpostproc 54. 1.100 / 54. 1.100 2019-06-01_20:12:56.16087 [video4linux2,v4l2 @ 0x9101e0] Cannot open video device /dev/video1: No such file or directory 2019-06-01_20:12:56.16240 /dev/video1: No such file or directory 2019-06-01_20:12:56.19036 DEBUG 2019/06/01 16:12:56 ffmpeg.go:181: Active sesssions map[E??;Mͦ???b8?:0x14b2500] 2019-06-01_20:12:56.19139 INFO 2019/06/01 16:12:56 resource.go:45: r.imgFn() exit status 1 2019-06-01_20:13:06.26429 DEBUG 2019/06/01 16:13:06 resource.go:43: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 POST /resource 2019-06-01_20:13:07.72437 ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers 2019-06-01_20:13:07.72576 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 2019-06-01_20:13:07.72659 configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared 2019-06-01_20:13:07.72987 libavutil 55. 34.101 / 55. 34.101 2019-06-01_20:13:07.73099 libavcodec 57. 64.101 / 57. 64.101 2019-06-01_20:13:07.73207 libavformat 57. 56.101 / 57. 56.101 2019-06-01_20:13:07.73366 libavdevice 57. 1.100 / 57. 1.100 2019-06-01_20:13:07.73600 libavfilter 6. 65.100 / 6. 65.100 2019-06-01_20:13:07.73708 libavresample 3. 1. 0 / 3. 1. 0 2019-06-01_20:13:07.73816 libswscale 4. 2.100 / 4. 2.100 2019-06-01_20:13:07.74082 libswresample 2. 3.100 / 2. 3.100 2019-06-01_20:13:07.74401 libpostproc 54. 1.100 / 54. 1.100 2019-06-01_20:13:07.75213 [video4linux2,v4l2 @ 0xdf71e0] Cannot open video device /dev/video1: No such file or directory 2019-06-01_20:13:07.75419 /dev/video1: No such file or directory 2019-06-01_20:13:07.78219 DEBUG 2019/06/01 16:13:07 ffmpeg.go:181: Active sesssions map[E??;Mͦ???b8?:0x14b2500] 2019-06-01_20:13:07.78323 INFO 2019/06/01 16:13:07 resource.go:45: r.imgFn() exit status 1 2019-06-01_20:13:14.75006 DEBUG 2019/06/01 16:13:14 characteristics.go:48: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 PUT /characteristics 2019-06-01_20:13:14.75258 DEBUG 2019/06/01 16:13:14 characteristic_controller.go:76: {"characteristics":[{"aid":1,"iid":18,"value":"ARUCAQABEEWM5ok7EU3NpskZP7xiOLQ="}]} 2019-06-01_20:13:14.75868 DEBUG 2019/06/01 16:13:14 setup.go:53: {Command:{Identifier:[69 140 230 137 59 17 77 205 166 201 25 63 188 98 56 180] Type:0} Video:{CodecType:0 CodecParams:{Profiles:[] Levels:[] Packetizations:[]} Attributes:{Width:0 Height:0 Framerate:0} RTP:{PayloadType:0 Ssrc:0 Bitrate:0 Interval:0 ComfortNoisePayloadType:0 MTU:0}} Audio:{CodecType:0 CodecParams:{Channels:0 Bitrate:0 Samplerate:0} RTP:{PayloadType:0 Ssrc:0 Bitrate:0 Interval:0 ComfortNoisePayloadType:0 MTU:0} ComfortNoise:false}} 2019-06-01_20:13:14.76144 DEBUG 2019/06/01 16:13:14 stream.go:28: stop stream 2019-06-01_20:13:14.76376 DEBUG 2019/06/01 16:13:14 ffmpeg.go:113: Stopping loopback 2019-06-01_20:13:17.81144 DEBUG 2019/06/01 16:13:17 resource.go:43: [2604:2000:1483:4ee:9540:20e7:836f:7841]:49162 POST /resource 2019-06-01_20:13:19.78472 ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers 2019-06-01_20:13:19.79914 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 2019-06-01_20:13:19.80006 configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared 2019-06-01_20:13:19.80183 libavutil 55. 34.101 / 55. 34.101 2019-06-01_20:13:19.80329 libavcodec 57. 64.101 / 57. 64.101 2019-06-01_20:13:19.80417 libavformat 57. 56.101 / 57. 56.101 2019-06-01_20:13:19.80503 libavdevice 57. 1.100 / 57. 1.100 2019-06-01_20:13:19.80602 libavfilter 6. 65.100 / 6. 65.100 2019-06-01_20:13:19.80689 libavresample 3. 1. 0 / 3. 1. 0 2019-06-01_20:13:19.80780 libswscale 4. 2.100 / 4. 2.100 2019-06-01_20:13:19.80868 libswresample 2. 3.100 / 2. 3.100 2019-06-01_20:13:19.81025 libpostproc 54. 1.100 / 54. 1.100 2019-06-01_20:13:20.57459 Input #0, video4linux2,v4l2, from '/dev/video0': 2019-06-01_20:13:20.57895 Duration: N/A, start: 771.007976, bitrate: 283115 kb/s 2019-06-01_20:13:20.58114 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x768, 283115 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc 2019-06-01_20:13:20.58485 [v4l2 @ 0x69e010] Unable to open V4L2 device '/dev/video1' 2019-06-01_20:13:20.59651 Could not write header for output file #0 (incorrect codec parameters ?): No such file or directoryStream mapping: 2019-06-01_20:13:20.59775 Stream #0:0 -> #0:0 (copy) 2019-06-01_20:13:20.75031 Last message repeated 1 times 2019-06-01_20:13:20.99638 ffmpeg version 3.2.14-1~deb9u1+rpt1 Copyright (c) 2000-2019 the FFmpeg developers 2019-06-01_20:13:20.99766 built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516 2019-06-01_20:13:20.99847 configuration: --prefix=/usr --extra-version='1~deb9u1+rpt1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-omx-rpi --enable-mmal --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared 2019-06-01_20:13:21.00183 libavutil 55. 34.101 / 55. 34.101 2019-06-01_20:13:21.00295 libavcodec 57. 64.101 / 57. 64.101 2019-06-01_20:13:21.00402 libavformat 57. 56.101 / 57. 56.101 2019-06-01_20:13:21.00517 libavdevice 57. 1.100 / 57. 1.100 2019-06-01_20:13:21.00628 libavfilter 6. 65.100 / 6. 65.100 2019-06-01_20:13:21.00736 libavresample 3. 1. 0 / 3. 1. 0 2019-06-01_20:13:21.00844 libswscale 4. 2.100 / 4. 2.100 2019-06-01_20:13:21.00951 libswresample 2. 3.100 / 2. 3.100 2019-06-01_20:13:21.01059 libpostproc 54. 1.100 / 54. 1.100 2019-06-01_20:13:21.01751 [video4linux2,v4l2 @ 0x145b1e0] Cannot open video device /dev/video1: No such file or directory 2019-06-01_20:13:21.01907 /dev/video1: No such file or directory 2019-06-01_20:13:21.04581 DEBUG 2019/06/01 16:13:21 ffmpeg.go:186: Stopping loopback 2019-06-01_20:13:21.04655 INFO 2019/06/01 16:13:21 resource.go:45: r.imgFn() exit status 1 ^C