Linux论坛
直播中

ty_shi

12年用户 50经验值
擅长:控制/MCU
私信 关注
[资料]

ubuntu下使用motion视频传输


Motion是一个开源的移动图像监控的程序

下载地址:



**********************************************


root@ubuntu:~# apt-get install motion

输出如下

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will beinstalled:

libjpeg62 libpq5

Suggested packages:

mysql-client postgresql-client

Recommended packages:

ffmpeg

The following NEW packages will beinstalled:

libjpeg62 libpq5 motion

0 upgraded, 3 newly installed, 0 to removeand 26 not upgraded.

Need to get 360 kB of archives.

After this operation, 1067 kB of additionaldisk space will be used.

Do you want to continue [Y/n]? y

Get:1 http://ports.ubuntu.com/ubuntu-ports/precise-security/main libjpeg62 ARMh                                                                                                             f 6b1-2ubuntu1.1 [72.6 kB]

Get:2 http://ports.ubuntu.com/ubuntu-ports/precise-updates/main libpq5 armhf 9.                                                                                                             1.18-0ubuntu0.12.04 [73.3 kB]

Get:3 http://ports.ubuntu.com/ubuntu-ports/precise/universe motion armhf 3.2.12                                                                                                             -3.1 [214 kB]

Fetched 360 kB in 3s (106 kB/s)

Preconfiguring packages ...

Selecting previously unselected packagelibjpeg62.

(Reading database ... 68981 files anddirectories currently installed.)

Unpacking libjpeg62 (from.../libjpeg62_6b1-2ubuntu1.1_armhf.deb) ...

Selecting previously unselected packagelibpq5.

Unpacking libpq5 (from .../libpq5_9.1.18-0ubuntu0.12.04_armhf.deb)...

Selecting previously unselected packagemotion.

Unpacking motion (from.../motion_3.2.12-3.1_armhf.deb) ...

Processing triggers for ureadahead ...

Setting up libjpeg62 (6b1-2ubuntu1.1) ...

Setting up libpq5 (9.1.18-0ubuntu0.12.04)...

Setting up motion (3.2.12-3.1) ...

Adding group `motion' (GID 115) ...

Done.

Adding system user `motion' (UID 109) ...

Adding new user `motion' (UID 109) withgroup `motion' ...

Not creating home directory `/home/motion'.

Adding user `motion' to group `video' ...

Adding user motion to group video

Done.

*Not starting motion daemon, disabled via /etc/default/motion

Processing triggers for libc-bin ...

ldconfig deferred processing now takingplace




完成后开启

root@ubuntu:~# motion -c motion-dist.conf

输出信息如下

[0] Configfile motion-dist.conf not found -trying defaults.: No such file or directory

[0] Processing thread 0 - config file/etc/motion/motion.conf

[0] Motion 3.2.12 Started

[0] ffmpeg LIBAVCODEC_BUILD 3482112LIBAVFORMAT_BUILD 3478528

[0] Thread 1 is from/etc/motion/motion.conf

[1] Thread 1 started

[1] cap.driver: "uvcvideo"

[1] cap.card: "PC Camera"

[1] cap.bus_info: "u***-sw-ehci-1"

[1] cap.capabilities=0x04000001

[1] - VIDEO_CAPTURE

[1] - STREAMING

[1] Config palette index 8 (YU12) doesn'twork.

[1] Supported palettes:

[1] 0: MJPG (MJPEG)

[1] 1: YUYV (YUV 4:2:2 (YUYV))

[1] Selected palette YUYV

[0] motion-httpd/3.2.12 running, acceptingconnections

[0] motion-httpd: waiting for data on portTCP 8080

[1] Test palette YUYV (320x240)

[1] Using palette YUYV (320x240)bytesperlines 640 sizeimage 153600 colorspace 00000008

[1] found control 0x00980900,"Brightness", range -255,255

[1]    "Brightness", default 0, current 0

[1] found control 0x00980901,"Contrast", range 0,30

[1]    "Contrast", default 15, current 15

[1] found control 0x00980902,"Saturation", range 0,127

[1]    "Saturation", default 32, current 32

[1] found control 0x00980903,"Hue", range -16000,16000

[1]    "Hue", default 0, current 0

[1] found control 0x00980910,"Gamma", range 20,250

[1]    "Gamma", default 100, current 100

[1] mmap information:

[1] frames=4

[1] 0 length=153600

[1] 1 length=153600

[1] 2 length=153600

[1] 3 length=153600

[1] Using V4L2

[1] Resizing pre_capture buffer to 1 items

[1] Started stream webcam server in port8081


在浏览器中输入192.168.1.122:8081

没有看到视频信息

手动安装ffmpeg

sudo apt-get install ffmpeg


再次运行还是不行

需要修改motion.conf文件

该文件在/etc/motion/motion.conf

vim /etc/motion/motion.conf


修改# Restrict webcam connections to localhost only (default: on)

webcam_localhost off

限制仅本地通过网页访问视频



再次运行:

root@ubuntu:/etc/motion# motion -cmotion.conf

在浏览器中输入192.168.1.1228081

成功看到视频



已退回1积分

更多回帖

发帖
×
20
完善资料,
赚取积分