CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 10360|回复: 2

cubieboard mjpg-streamer 开机启动 lubuntu

[复制链接]
发表于 2014-5-4 13:53:27 | 显示全部楼层 |阅读模式
本帖最后由 SUNROC1 于 2015-10-5 10:12 编辑

注意:
操作系统:
cb官方lubuntu
mjpg安装请参考:
http://forum.cubietech.com/forum.php?mod=viewthread&tid=526&extra=
我的mjpg安装目录如下:
/home/linaro/mjpg-streamer


创建文件:
  1. sudo vi /etc/init.d/webcam
复制代码
输入内容:
  1. #! /bin/sh
  2. # /etc/init.d/webcam

  3. # Carry out specific functions when asked to by the system
  4. case "$1" in
  5.   start)
  6.     echo "Starting webcam script"
  7.     export LD_LIBRARY_PATH="/home/linaro/mjpg-streamer/mjpg-streamer"
  8.     /home/linaro/mjpg-streamer/mjpg-streamer/mjpg_streamer -i "input_uvc.so -r 640x480 -f 15 -n" -o "output_http.so -p 8080 -w /home/linaro/mjpg-streamer/mjpg-streamer/www" &
  9.     ;;
  10.   stop)
  11.     echo "Stopping webcam script"
  12.     killall mjpg_streamer
  13.     ;;
  14.   *)
  15.     echo "Usage: /etc/init.d/webcam {start|stop}"
  16.     exit 1
  17.     ;;
  18. esac

  19. exit 0
复制代码
上面代码里面,把目录换成你的安装目录即可

在终端中输入:
  1. <span style="line-height: 1.5;">sudo</span><span style="line-height: 1.5;"> </span>/etc/init.d/webcam start
复制代码
即可启动mjpg

在终端中输入:
  1. <span style="line-height: 1.5;">sudo</span><span style="line-height: 1.5;"> </span>/etc/init.d/webcam stop
复制代码
即可关闭mjpg

输入:
  1. <span style="line-height: 1.5;">sudo</span><span style="line-height: 1.5;"> </span>update-rc.d webcam defaults
复制代码
设置开机启动

好了,不出意外的话,开机后,自动启用mjpg-streamer  ,再也不用输入命令了,只要知道ip地址,加上8080就能访问了

如果你没有屏幕,不想每次看输命令看ip地址,可以找一个路由器,把板子插在路由器的一号口,查询一次IP地址,以后就是固定的 了,不联网的前提下,

有什么问题请留言!



欢迎访问俺的网站:{:soso_e157:}{:soso_e121:}{:soso_e157:}http://www.heartiot.com/ {:soso_e157:}{:soso_e182:}{:soso_e157:}
回复

使用道具 举报

发表于 2014-7-16 21:32:28 | 显示全部楼层
mjpg-streamer  需要编译官方的lubuntu没有cmake 且安装不上提示
linaro@cubieboard2:/usr/mjpgstreamer/mjpg-streamer-code-182$ sudo apt-get install cmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  cmake-data emacsen-common libcurl3 libxmlrpc-core-c3
Suggested packages:
  gcc make
The following NEW packages will be installed:
  cmake cmake-data emacsen-common libcurl3 libxmlrpc-core-c3
0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
Need to get 5098 kB of archives.
After this operation, 11.3 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  libcurl3 libxmlrpc-core-c3 emacsen-common cmake-data cmake
Authentication warning overridden.
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main libcurl3 armhf 7.27.0-1ubuntu1
  404  Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main libxmlrpc-core-c3 armhf 1.16.33-3.1ubuntu6
  404  Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main emacsen-common all 2.0.3
  404  Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main cmake-data all 2.8.9-0ubuntu1
  404  Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main cmake armhf 2.8.9-0ubuntu1
  404  Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-p ... -1ubuntu1_armhf.deb  404  Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-p ... .1ubuntu6_armhf.deb  404  Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-p ... ommon_2.0.3_all.deb  404  Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-p ... .9-0ubuntu1_all.deb  404  Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-p ... -0ubuntu1_armhf.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-7-26 15:28:31 | 显示全部楼层
zixi0007 发表于 2014-7-16 21:32
mjpg-streamer  需要编译官方的lubuntu没有cmake 且安装不上提示
linaro@cubieboard2:/usr/mjpgstreamer/m ...

不需要cmake吧
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-11-22 21:43 , Processed in 0.023009 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部