SUNROC1 发表于 2014-5-4 13:53:27

cubieboard mjpg-streamer 开机启动 lubuntu

本帖最后由 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


创建文件:sudo vi /etc/init.d/webcam输入内容:#! /bin/sh
# /etc/init.d/webcam

# Carry out specific functions when asked to by the system
case "$1" in
start)
    echo "Starting webcam script"
    export LD_LIBRARY_PATH="/home/linaro/mjpg-streamer/mjpg-streamer"
    /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" &
    ;;
stop)
    echo "Stopping webcam script"
    killall mjpg_streamer
    ;;
*)
    echo "Usage: /etc/init.d/webcam {start|stop}"
    exit 1
    ;;
esac

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

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

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

输入:<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:}

zixi0007 发表于 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
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
404Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main libxmlrpc-core-c3 armhf 1.16.33-3.1ubuntu6
404Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main emacsen-common all 2.0.3
404Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main cmake-data all 2.8.9-0ubuntu1
404Not Found
Err http://ports.ubuntu.com/ubuntu-ports/ quantal/main cmake armhf 2.8.9-0ubuntu1
404Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/curl/libcurl3_7.27.0-1ubuntu1_armhf.deb404Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/x/xmlrpc-c/libxmlrpc-core-c3_1.16.33-3.1ubuntu6_armhf.deb404Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/e/emacsen-common/emacsen-common_2.0.3_all.deb404Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/cmake/cmake-data_2.8.9-0ubuntu1_all.deb404Not Found
Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/cmake/cmake_2.8.9-0ubuntu1_armhf.deb404Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

SUNROC1 发表于 2014-7-26 15:28:31

zixi0007 发表于 2014-7-16 21:32 static/image/common/back.gif
mjpg-streamer需要编译官方的lubuntu没有cmake 且安装不上提示
linaro@cubieboard2:/usr/mjpgstreamer/m ...

不需要cmake吧
页: [1]
查看完整版本: cubieboard mjpg-streamer 开机启动 lubuntu