RBP as a streaming server(一)

1. Raspberry Pi camera software

一旦安装好Pi摄像头,RBP的开发者们提供了两个简单但强大的命令行工具,用来直接对摄像头获取的图像或视频流进行保存或分流

raspivid is a command line application that allows you to capture video with the camera module

raspistill allows you to capture images


Example Commands

 (http://www.raspberrypi.org/archives/3890)

Capture an image in jpeg format:

raspistill -o image.jpg

Capture a 5s video in h264 format:

raspivid -o video.h264

Capture a 10s video:

raspivid -o video.h264 -t 10000

Capture a 10s video in demo mode:

raspivid -o video.h264 -t 10000 -d

To see a list of possible options for running raspivid orraspistill, you can run:

raspivid | less

raspistill | less


How to install the Raspberry Pi camera module

http://www.techradar.com/news/computing-components/peripherals/how-to-install-the-raspberry-pi-camera-module-1172034

Display a five-second demo: raspivid -d
Display a 640x480 preview: raspivid -p 0,0,640,480
Capture 20s of h264 video: raspivid -t 20000 -o video.h264
Take a 640x480 shot: raspistill -o image.jpg -w 640 -h 480
Take a reduced quality JPEG: raspistill -o image.jpg -q 5


2. Streaming video in RBP native way (Without OpenCV)

RBP的作者们还演示了一种通过网络stream视频流的方式。
在Pi上需要用到raspivid和netcat
raspivid -t 999999 -o – | nc [insert the IP address of the client] 5001


在客户端(包括Linux, Windows和Mac)运行netcat和mplayer即可。比如Linux下只要:
nc -l -p 5001 | mplayer -fps 31 -cache 1024 -


但我如果运行上面命令则直接退出,

libavformat version 53.21.1 (external)
Mismatching header version 53.19.0

Exiting... (End of file)

运行
nc.traditional -l -p 5001 | mplayer -fps 31 -cache 1024 -

就一切正常。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值