惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
博客园 - 叶小钗
Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
美团技术团队
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
H
Heimdal Security Blog
有赞技术团队
有赞技术团队
The Cloudflare Blog
S
Secure Thoughts
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
The Blog of Author Tim Ferriss
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
小众软件
小众软件
C
Cybersecurity and Infrastructure Security Agency CISA
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - Franky
T
Tenable Blog
The Last Watchdog
The Last Watchdog
腾讯CDC
量子位
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
雷峰网
雷峰网
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyberwarzone
Cyberwarzone
S
Securelist
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
D
Darknet – Hacking Tools, Hacker News & Cyber Security
I
InfoQ
Spread Privacy
Spread Privacy
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - forrestsun

问题整理 weedfs getsockopt: connection timed out 利用cubieboard设置samba打印服务器 devexpress bandgridview使用总结(14.2) WeedFS0.6.8-引用库列表 NSQ的消息订阅发布测试 WeedFS问题收集 WeedFS依赖库 0.6.1 golang 前置补0 MongoDB-MMS使用总结 golang 格式化时间为字符串 格式化字符串为时间学习总结 mgo-后续测试(指定字段,获取id) mgo中DBRef-数据查询测试 mgo中DBRef-数据添加测试 weed-fs 基础测试 weed-fs 压力测试 weed-fs参数列表 mgo like的两种写法
CubieTruck上安装mjpg_streamer
forrestsun · 2015-11-25 · via 博客园 - forrestsun

最近手头项目需要用到一个上位机,需要在上位机上实现远程访问及视频监控。其中视频监控采用了网上资料较多的mjpg_streamer进行视频处理。在使用中遇到许多坑也一并记录下来。

首先安装依赖环境和检测环境,装全点没坏处:)  

sudo apt-get install subversion 
sudo apt-get install libv4l-dev
sudo apt-get install libjpeg8-dev
sudo apt-get install imagemagick
sudo apt-get install fswebcam
sudo apt-get install v4l-utils
sudo apt-get install build-essential make

安装完成后,开始下载代码并进行编译

cd ~/
mkdir code
cd code
svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/
cd mjpg-streamer/mjpg-streamer
make USE_LIBV4L2=true clean all
sudo make DESTDIR=/usr install

执行完sudo make DESTDIR=/usr install 后信息如下:

mjpg-streamer# sudo make DESTDIR=/usr install
install --mode=755 mjpg_streamer /usr/bin
install --mode=644 input_uvc.so output_file.so output_udp.so output_http.so input_testpicture.so input_file.so /usr/lib/
install --mode=755 -d /usr/www
install --mode=644 -D www/* /usr/www   

如遇编译失败再装下面的依赖包,有的人说要下依赖包重新编译,具体是否好用未测试,发现有这个方法就不用做那么多事了

sudo apt-get install libjpeg-dev

 现在就可以进行测试了:

  • 首先需要检测摄像头是否已加载
# ls /dev/video*
/dev/video0
  • 确认摄像头支持的类型:

 

  • 运行命令
mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -r 320x240  -f 15" -o "/usr/lib/output_http.so  -w /usr/www"
mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -r 640x480  -f 15" -o "/usr/lib/output_http.so  -w /usr/www"
mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -r 640x480  -f 25" -o "/usr/lib/output_http.so  -w /usr/www"
mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -r 1024x768 -f 15" -o "/usr/lib/output_http.so  -w /usr/www"
mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -r 1024x768 -f 30" -o "/usr/lib/output_http.so  -w /usr/www"

结果

MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 15
 i: Format............: MJPEG
。。。。。。
 o: www-folder-path...: /usr/www/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

访问(注意用FireFox或chrome,其它浏览器支持不是很好),看到下面的就对了:

http://ip:8080 (这个端口取决于你的设置 -p 如果未设置默认为8080)

参数:

-i : uses input_uvc.so (the USB Webcam) as input
-o : output_http.so for the output (sending the images to a Web server
-w : the directory, which has the HTML, CSS, and JS files:   /usr/local/www
You can cancel the stream by pressing Ctrl+C.  If you want to experiment with some other options, some are listed below:

-b : runs in the background
-p : set a default port instead of the default 8080
-c : prompts for username:password
-yYUYV : enables YUYV format and disables MJPEG mode
-f : framerate (in seconds)

 遇到的问题:

1、CPU居高不下:

两种原因:(1)参数内加入了 -y 开启了 yuv模式,我测试结果是一个CPU跑到了90% ,可以看到程序启动后的信息:

       (2)摄像头不支持mjpeg,这样的话CPU也会居高不下。采用上面的fswebcam -v进行检测,如果不支持mjpeg的话就不要用了

       i: Format............: MJPEG 如果不是这个就是有可能你带Y参数或是摄像头不支持
测试:使用支持MJPEG摄像头开启 -y参数:

关闭-y参数:


2、找不到网页

路径问题,在参数 -w后面跟的要么应该指向你建立的code文件夹下的www目录或是编译过程结果中的目录,我的结果显示的是/var/www

3、其它机器访问不了默认端口:

检测系统默认安装的ufw是否已启动,启动的话先关了再试

基本上就这很多了:)

转载请注明:http://www.cnblogs.com/forrestsun/p/4995083.html