Mjpg-streamer

望见那地上的一棵草,那是大的无限.

Mjpg-streamer

来自森亮号航海见识 {SLboat Insight;}
跳转至: 导航搜索

音频想法


  • 对其图片进行索引放置到文件夹,看起来是可能的

有趣

[-l | --led ]..........: switch the LED "on", "off", let it "blink" or leave
it up to the driver using the value "auto"
  • 有个流控制界面,里面的东西很奇怪
http://192.168.1.90/webcam/index.html
JustCapIt3028.jpg

启动指令

最简单启动,这样似乎最不容易被误认为是 yuv
mjpg_streamer -i "input_uvc.so " -o "output_http.so"
最小分辨率
mjpg_streamer -i "input_uvc.so -r 352x288 -f 15 -n" -o "output_http.so "
640的分辨率,不知道叫啥子
mjpg_streamer -i "input_uvc.so -r 640x480 -f 15 -n" -o "output_http.so "
720p
mjpg_streamer -i "input_uvc.so -r 1280x720 -f 15 -n" -o "output_http.so "
网址
http://192.168.1.90:8080/?action=stream

服务操作

  • /etc/init.d/mjpg-streamer enable 是设置开机自动启动
  • /etc/init.d/mjpg-streamer disable 是禁止开机自动启动
  • /etc/init.d/mjpg-streamer start 是现在启动
  • /etc/init.d/mjpg-streamer restart 重启
  • /etc/init.d/mjpg-streamer stop 停止
  • service mjpg-streamer start,在通常*nuix是这样的,但是openwrt的busybox是精简版的,所以变成了直接调用服务启动
服务的好处就是托管在后面运行 如果直接运行的话 关闭shell就断了

被默认为yuv的处理

  • 开启-q质量控制会被强制为yuv
  • 如果加了-y,那也会的,去掉

作为服务启动

  • 配置文件位于
/etc/config/mjpg-streamer
  • 一个有效的配置像是这样
config mjpg-streamer core
        option enabled          "1"
        option device           "/dev/video0"
        option resolution       "640x480"
        option www              "/www"
        option fps              "15"
        option port             "8080"
    • 其中有趣的是www目录设置 /www/ 代表着是当前目录,而后面那玩意似乎只是一个demo程序的目录,这里很怪异
  • 设置开机自动启动服务
/etc/init.d/mjpg-streamer enable
  • 立即启动服务
/etc/init.d/mjpg-streamer start [1]
  • 很像ser2net,即便拔掉摄像头再插上也会识别。

困扰

  • 看起来无法直接做安全性的设置,真是奇怪 - 加个密码啥的

使用

UVC插件可用参数

  • 输入一个错误的指令就会激活这个,比如
mjpg_streamer -i "input_uvc.so -r 640x480 -f 15 -q 90 -n --rgb" -o " output_http.so "
---------------------------------------------------------------
 Help for input plugin..: UVC webcam grabber
 ---------------------------------------------------------------
 The following parameters can be passed to this plugin:

 [-d | --device ].......: video device to open (your camera)
 [-r | --resolution ]...: the resolution of the video device,
                          can be one of the following strings:
                          QSIF QCIF CGA QVGA CIF VGA 
                          SVGA XGA SXGA 
                          or a custom value like the following
                          example: 640x480
 [-f | --fps ]..........: frames per second
 [-y | --yuv ]..........: enable YUYV format and disable MJPEG mode
 [-q | --quality ]......: JPEG compression quality in percent 
                          (activates YUYV format, disables MJPEG)
 [-m | --minimum_size ].: drop frames smaller then this limit, useful
                          if the webcam produces small-sized garbage frames
                          may happen under low light conditions
 [-n | --no_dynctrl ]...: do not initalize dynctrls of Linux-UVC driver
 [-l | --led ]..........: switch the LED "on", "off", let it "blink" or leave
                          it up to the driver using the value "auto"
 ---------------------------------------------------------------

项目官方网址

http://sourceforge.net/projects/mjpg-streamer/
http://sourceforge.net/apps/mediawiki/mjpg-streamer/index.php?title=Main_Page

Openwrt中安装

Installing mjpg-streamer (r148-4) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-beta/ar71xx/generic/packages/mjpg-streamer_r148-4_ar71xx.ipk.
Installing libpthread (0.9.33.2-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-beta/ar71xx/generic/packages/libpthread_0.9.33.2-1_ar71xx.ipk.
Installing libjpeg (6b-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-beta/ar71xx/generic/packages/libjpeg_6b-1_ar71xx.ipk.
Configuring libjpeg.
Configuring libpthread.
Configuring mjpg-streamer.

见识

qingtiano00 的经验

qingtiano00 船长安装mjpeg-stream后,直接在shell里启动,(已经设置配置文件)不带参数启动后,在浏览器里打开访问页面,出现缺少插件(也就是找寻不到视频驱动).

在其中的尝试包括
昨天搞了一晚上 没头绪 以为没装kmod-usb-video 后来强制降级安装低版本的kmod-usb-video 也没起作用 安装之后就自动运行 并启动mjpg-streamer了 然后就一切正常了
后来的突然顿悟是
之前我启动的时候 是在putty里面 直接输入mjpg-streamer 这是启动的是 /usr/bin/mjpg-streamer 是没有参数启动 后来启动的时候输入: /etc/init.d/mjpg-streamer 就可以了 这是启动的时候有参数
中途遇到的第三方见识包括有
我遇到的问题与这个帖子上的问题一样 http://www.openwrt.org.cn/bbs/forum.php?mod=viewthread&tid=11151

votata 的思考

这摄像头配上703n最高能支持多高分辨率和帧率?1280 30帧有吗,还是960 30帧?
320 240画面破碎,现在是640x480 15帧。我不知道这玩意性能瓶颈在哪里,应该不是摄像头的芯片,我相信pc接了这个肯定不会卡。但是看看703n的cpu占用率,也就五六十,也不是那个400mhz芯片的问题。我的手机安卓作为mjpg-streamer客户端,也不应该是瓶颈,看高清也没这么卡。看来这问题看似简单,也要很有经验的才能判断。
我有点怀疑是mjpg-streamer到浏览器解析这个过程中的问题,浏览器连续播放mjpg画面的瓶颈,因为用过firefox和vlc,比现在的chrome还要卡得多,说明这段过程影响是非常大的。
编码在摄像头芯片,输出jpeg给路由器,路由器只负责转发jpeg给我手机的浏览器,解码成视频流在我手机,有点怀疑问题在手机上。
这么说有点启发我了,一会用nexus7连上去试试,流畅了的话就是手机问题了。兄弟你最近在玩些什么东西,那个蓝牙定位器还在搞?

远程摄像头软件mjpg-streamer使用指南 - 凌阳教育 Leo Chin - 博客园 沿途见识[2]

3. 配置用户名和密码

mjpg-streamer 还可以使用用户名和密码来**访问。
修改 /etc/init.d/mjpg-streamer 中的
[ $enabled -gt 0 -a -c $device ] && sleep 3 && $SSD -S -m -p $PIDF -q -x $PROG -- --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so --port $port" &

[ $enabled -gt 0 -a -c $device ] && sleep 3 && $SSD -S -m -p $PIDF -q -x $PROG -- --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so --port $port -c user:pass" &

最后添加的部分就是用户名和密码,中间用冒号分割。重新启动mjpg-streamer,保证配置生效。
/etc/init.d/mjpg-streamer restart

远程摄像头软件mjpg-streamer使用指南 - 凌阳教育 Leo Chin - 博客园 沿途见识[3]

3. 配置用户名和密码

mjpg-streamer 还可以使用用户名和密码来**访问。
修改 /etc/init.d/mjpg-streamer 中的
[ $enabled -gt 0 -a -c $device ] && sleep 3 && $SSD -S -m -p $PIDF -q -x $PROG -- --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so --port $port" &

[ $enabled -gt 0 -a -c $device ] && sleep 3 && $SSD -S -m -p $PIDF -q -x $PROG -- --input "input_uvc.so --device $device --fps $fps --resolution $resolution" --output "output_http.so --port $port -c user:pass" &

最后添加的部分就是用户名和密码,中间用冒号分割。重新启动mjpg-streamer,保证配置生效。
/etc/init.d/mjpg-streamer restart

引用信息

以下是[Mjpg-streamer]所有用到的引用信息,向这些伟大的家伙致敬:
  1. ^ 作为没有chkconfig的openwrt,真有点长不是嘛...
  2. ^ http://www.cnblogs.com/hnrainll/archive/2011/06/08/2074909.html
  3. ^ http://www.cnblogs.com/hnrainll/archive/2011/06/08/2074909.html
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值