在我的Raspberry pi上我安装了ffmpeg。在开始我输入
uv4l --driver raspicam --auto-video_nr --width 640 --height 480 --encoding jpeg
运行驱动程序。然后我检查devoce0是否已注册:
ls -la /dev/video*
它返回video0所以它被注册。然后我输入命令来运行服务器:
ffmpeg -v verbose -r 5 -s 640x480 -f video4linux2 -i /dev/video0 http://localhost/webcam.ffm
并且相机亮了一会儿然后关闭我得到的错误如下:
[video4linux2, v4l2] mmap: No such device /dev/video0: No such device
我应该怎么做才能解决它?它看起来像内部错误这些库之一。
此命令有效:
uv4l --driver raspicam --auto-video_nr --encoding h264 --width 640 --height 480 --enable-server on
尝试在文件/etc/modules
的底部添加以下行并重新启动Raspberry Pi。
bcm2835-v4l2
我现在看起来像这样:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
bcm2835-v4l2
这可确保在所有后续重新启动时加载Broadcom Video For Linux 2(v4l2)驱动程序。