您的位置:首页 > 理论基础 > 计算机网络

VLC获取Raspberry Pi使用UV4L HTTP Streaming Server 提供的实时视频流

2015-06-03 16:11 776 查看
如果网络条件允许,建议看原文。

原文地址:

http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=14
http://www.linux-projects.org/modules/sections/index.php?op=viewarticle&artid=16#example11

在Raspberry Pi上安装或更新UV4L

打开终端,输入以下命令:

$ curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo
apt-key add –

把以下内容添加到/etc/apt/sources.list文件中:

deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy
main

安装UV4L。如果已经安装过UV4L,下面的两条命令会把它更新到最新版:

$ sudo apt-get update

$ sudo apt-get install uv4l uv4l-raspicam

如果你想让驱动在开机的时候被加载,那就安装下面的包:

$ sudo apt-get install uv4l-raspicam-extras

为了方便,上面的包提供了以服务的方式去开始和停止驱动:

$ sudo service uv4l_raspicam restart

在服务开启的时候,uv4l会去解析配置文件/etc/uv4l/uv4l-raspicam.conf以获取 驱动选项的默认值。所以,更改这个文件,以改变驱动选线的默认值。

此时,已经安装了UV4L的核心组件和Video4Linux2驱动,如果有错误发生,可以考虑更新固件,运行以下命令:

$ sudo rpi-update

可以使用以下两条命令获取更多的使用信息:

$ man uv4l

$ man uv4l-raspicam

获取命令选项列表:

$ uv4l --help--driver raspicam --driver-help

如果你没有安装可选包uv4l-raspicam-extras,又想要快速测试uv4l,可以手动加载:

$ uv4l --driver raspicam --auto-video_nr --width 640 --height 480 --encoding mjpeg(或者h264、jpeg)

拍一张JPEG的图片:

$ ddif=/dev/video0 of=snapshot.jpeg bs=11M count=1

结束正在运行的uv4l:

$sudo pkill uv4l

安装uv4l-server模块:

$ sudo apt-get install uv4l-server

可以选择安装以下模块:

$ sudo apt-getinstall uv4l-uvc

$ sudo apt-getinstall uv4l-xscreen

$ sudo apt-getinstall uv4l-mjpegstream

使用VLC获取实时视频流

使用网页配置UV4L选项:
http://raspberrypi:8080

从服务器获取HTTP/MJPEG(Video) 视频流:
client ~ $ cvlc http://raspberrypi:8080/stream/video.mjpeg
从服务器获取HTTP/raw H264 视频流:
client ~ $ cvlc http://raspberrypi:8080/stream/video.h264 --demuxh264
从服务器获取HTTP/JPEG从服务器获取:
client ~ $ cvlc http://raspberrypi:8080/stream/video.jpeg

更多的内容请参考原文。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: