我试图将我的手机网络摄像头变成树莓派 400 的“假网络摄像头”,但出现错误:
Anas@raspberrypi:~/Downloads/server/v4l2loopback $ make
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/Anas/Downloads/server/v4l2loopback modules
make[1]: *** /lib/modules/5.10.17-v7l+/build: No such file or directory. Stop.
make: *** [Makefile:46: v4l2loopback.ko] Error 2
Anas@raspberrypi:~/Downloads/server/v4l2loopback $
请帮忙解决这个问题。
答案1
您可能需要构建一次内核。当你有一个时你会看到什么ls -la /lib/modules/5.10.17-v7l+/
?
您可以按照此处的这些说明进行操作,因为他们的相机模块也需要相同的说明:https://www.arducam.com/docs/cameras-for-raspberry-pi/pivariety/how-to-access-and-program-the-pivariety-camera-using-command-line-python-opencv-and- gstreamer/#22-create-a-virtual-video-node-access-by-python
长话短说:
cd ~
sudo apt install git bc bison flex libssl-dev python2
sudo wget https://raw.githubusercontent.com/RPi-Distro/rpi-source/master/rpi-source -O /usr/local/bin/rpi-source && sudo chmod +x /usr/local/bin/rpi-source && /usr/local/bin/rpi-source -q --tag-update
mkdir $(uname -r)
rpi-source -d $(uname -r)
配置 v4l2loopback 之前
答案2
我遇到了同样的问题,安装内核头为我解决了这个问题
sudo apt install raspberrypi-kernel-headers