首先安装依赖
sudo apt-get install debhelper
sudo apt-get install libsdl1.2-dev
sudo apt-get install libv4l-dev
sudo apt-get install pkg-config
1、解压 tar -zxvf luvcview_0.2.6.orig.tar.gz
2、cd luvcview-0.2.6
3、make clean
4、make
会有报错:
1、uvcvideo.h:5:10: fatal error: linux/videodev.h: No such file or directory #include <linux/videodev.h>
修改:执行 命令sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h
2、出现如下错误:
修改:在luvcview.c和v4l2uvc.h中添加头文件#include <linux/videodev2.h>即可
插入usb摄像头
1、查看支持哪些摄像头命令:
./luvcview -d /dev/video0 -L
支持种类:
luvcview 0.2.6
SDL information:
Video driver: x11
A window manager is available
Device information:
Device path: /dev/video0
/dev/video0 does not support read i/o
{ pixelformat = ‘YUYV’, description = ‘YUYV 4:2:2’ }
{ discrete: width = 400, height = 400 }
Time interval between frame: 1/30,
{ pixelformat = ‘MJPG’, description = ‘Motion-JPEG’ }
{ discrete: width = 400, height = 400 }
Time interval between frame: 1/30,
2、打开看视频
./luvcview -d /dev/video0 -f MJPG -s 400x400 -i 30
其中-f MJPG代表摄像头输出格式
-s 400x400代表输出像素尺寸
-i 30 代表输出帧率
视频画面: