我想将手机摄像头用作 Ubuntu 电脑的网络摄像头。我读到DroidCam是最简单的方法...
因此,我尝试按照官方脚本进行操作:https://www.dev47apps.com/droidcam/linuxx/
cd /tmp/
wget https://files.dev47apps.net/linux/droidcam_latest.zip
echo "fb7d7fa80a8e47a98868941939104636 droidcam_latest.zip" | md5sum -c --
# OK?
unzip droidcam_latest.zip -d droidcam && cd droidcam
sudo ./install
但是,视频设备未安装,如果我检查这个,什么也没发现:
lsmod | grep v4l2loopback_dc
我的终端正在请求公钥的路径但我按照建议将其留空:
$ sudo ./install
Webcam parameters: '640' and '480'
Building v4l2loopback-dc.ko
make: Entering directory '/tmp/droidcam/v4l2loopback'
make -C /lib/modules/5.4.0-33-generic/build M=/tmp/droidcam/v4l2loopback modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-33-generic'
CC [M] /tmp/droidcam/v4l2loopback/v4l2loopback-dc.o
Building modules, stage 2.
MODPOST 1 modules
CC [M] /tmp/droidcam/v4l2loopback/v4l2loopback-dc.mod.o
LD [M] /tmp/droidcam/v4l2loopback/v4l2loopback-dc.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-33-generic'
make: Leaving directory '/tmp/droidcam/v4l2loopback'
Secure Boot is enabled, attempting to sign the driver
please specify signing key location (or leave empty to sign manually later)
You can Google 'secure boot' for your distro
Enter the path of the public key:
Enter the path of the private key:
Adding uninstall script
Moving driver and executable to system folders
+ cp v4l2loopback/v4l2loopback-dc.ko /lib/modules/5.4.0-33-generic/kernel/drivers/media/video/
+ cp droidcam /usr/bin/
+ cp droidcam-cli /usr/bin/
+ set +x
Registering webcam device
insmod: ERROR: could not insert module /lib/modules/5.4.0-33-generic/kernel/drivers/media/video/v4l2loopback-dc.ko: Operation not permitted
warning: insmod failed
Running depmod
make: Entering directory '/tmp/droidcam/v4l2loopback'
make -C /lib/modules/5.4.0-33-generic/build M=/tmp/droidcam/v4l2loopback clean
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-33-generic'
CLEAN /tmp/droidcam/v4l2loopback/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-33-generic'
make: Leaving directory '/tmp/droidcam/v4l2loopback'
Done
如果我在手机上运行 DroidCam,然后在 Ubuntu 中运行……Ubuntu 中会弹出以下消息:
未找到 Droidcam 视频设备 (/dev/video[0-9])。是否正确安装?如果您进行了内核更新,则可能需要重新安装。
如何在 Ubuntu 20.04 中保护启动模块签名?这个问题可能与此有关吗?任何关于 Droidcam 的想法或替代解决方案都将不胜感激 : )
答案1
这对我来说是这样的:
sudo apt-get install linux-generic
sudo apt-get install v4l2loopback-dkms
sudo modprobe v4l2loopback
从这里得到解决方案modprobe v4l2loopback 在 Ubuntu 上失败
在安装 v4l2loopback-dkms 期间,我必须执行'报名参加 MOK' 过程(它自动引导我)。
此后,我卸载并重新安装了 Droidcam,网络摄像头注册成功,没有任何错误