树莓派摄像头视频直播技术汇总

使用树莓派专用摄像头实现rtsp流的方法总结 对于树莓派专用摄像头,由于可以直接使用工具raspivid方便地对视频流进行获取,并支持多种输入输出格式,所以可以方便地实现摄像头实时rtsp流。 对于有效实现的方法总结如下 环境:树莓派3B+RaspiCam(排线连接) 1.raspivid获取+vlc实现rtsp服务器 实现rtsp流: 树莓派端:raspivid -o - -t 0 |cvlc -v strea 阅读详情


使用VLC, 延迟比较厉害,大概延迟2s,好处是支持RTSP协议,移动端方便实现


Here I'm documenting how to stream from the Raspberry Pi Camera board using VLC. Most of this is covered in the Raspberry Pi forums in this thread.

The camera needs to be setup using the various instructions on the Raspberry Pi website and the only additional software package that needs to be installed is VLC which can be installed by doing sudo apt-get install vlc with further details about it on the VideoLan website.

The most reliable streaming method seems to be via RTSP and the command line to launch it is.

raspivid -o - -t 0 |cvlc -v stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264

This causes the video from the camera to be streamed from port 8554 of your Raspberry Pi. This can then be viewed by launching VLC on your PC and open a 'Network Stream' with the address rtsp://<IPofRaspberryPi>:8554/

RTSP works well on a local network, but can be hard to expose through a router to allowing streaming over the internet. To over come this VLC can be configured to stream via HTTP, this seems to use a bit more CPU on the Raspberry Pi and can suffer from dropped frames however it only uses one port and can be easily port forwarded through most standard routers. The command for this configuration is

raspivid -o - -t 0 |cvlc -v stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8554}' :demux=h264

Once more this can be viewed on your PC by using VLC and opening a 'Network Stream' with the address http://<IPofRaspberryPi>:8554/

One final way of streaming the video is over HLS (HTTP Live Streaming). This, apparently, allows the video to be easily streamed to iOS devices. For this to work a web server needs to be installed on the Raspberry Pi. A popular choice is apache that can be installed using sudo apt-get install apache which will then serve the files stored in /var/www. To setup VLC to generate the HLS stream you can run

raspivid -o - -t 0 | cvlc -v -I "dummy" stream:///dev/stdin  :sout="#std{access=livehttp{seglen=10,delsegs=true,numsegs=5, index=/var/www/streaming/stream.m3u8, index-url=http://<IPofRaspberryPi>/streaming/stream-########.ts}, mux=ts{use-key-frames}, dst=/var/www/streaming/stream-########.ts}" :demux=h264

(Remembering to correctly set the IP address of your Raspberry Pi). Again this can be played back using VLC by opening a Network Stream ofhttp://<IPofRaspberryPi>/streaming/stream.m3u8 however HLS can consume all the CPU on the Raspberry Pi


使用gstreamer,延时200ms左右,坏处了

http://www.haodaima.net/art/2711642

1.获取树莓派的摄像头的视频源并且输出到 gstreamer中,并将数据传输到tcpserversink中,设定端口为5000

raspivid -t 0 -w 800 -h 600 -fps 25 -g 5 -b 4000000 -vf -n -o - | gst-launch-1.0 fdsrc ! h264parse ! gdppay ! tcpserversink host=127.0.0.1 port=5000

 

2.在gst-rtsp-server的example中test-launch,从本机的5000端口获取数据流作为服务器的源数据,建立rtsp的服务器。

  ./test-launch "( tcpclientsrc host=127.0.0.1 port=5000 ! gdpdepay ! rtph264pay name=pay0 pt=96 )" 

 

3.在ubuntu14.2 中安装gstreamer ,执行以下代码来获取摄像头的图像

 gst-launch-1.0 -v rtspsrc location=rtsp://192.168.11.22:8554/test ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink 



http://www.raspberry-projects.com/pi/pi-hardware/raspberry-pi-camera/streaming-video-using-gstreamer


gstreamer allows you to stream video with very low latency – a problem with VLC currently.  The catch is that you need need gstreamer on the client used to view the stream.  gstreamer is a development framework not a media player and there isn't a way to stream so that common players such as VLC can display the stream (without users having to install complex plugins).  So, gstreamer can provide an excellent low latency video link, which is great if you are techy enough to set it up at both ends, but its no good if you want to directly stream so that Joe public can see the video on a web site for instance.

Setting Up The Raspberry Pi To Use gstreamer

You need to edit the sources.list file so enter:


sudo nano /etc/apt/sources.list

and add the following to the end of the file:


deb http://vontaene.de/raspbian-updates/ . main

Press CTRL+X to save and exit

Now run an update (which will make use of the line just added):


sudo apt-get update 

Now install gstreamer


sudo apt-get install gstreamer1.0
To Stream The Video From the Raspberry Pi

Enter this on the command lne:


raspivid -t 0 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse !  rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=YOUR_RPI_IP_ADDRESS port=5000

Change YOUR_RPI_IP_ADDRESS to be the IP address of your  RPI.

To View The Stream

There's a lot of resources around for this.  Seems to be pretty easy on Linux, OK on a MAC and harder on Windows. Apparently streaming from RPi to PRi works really well.


http://raspberrypi.stackexchange.com/questions/27082/how-to-stream-raspivid-to-linux-and-osx-using-gstreamer-vlc-or-netcat


  • Netcat (nc) seems to be the one with the smallest delay.
  • In my experience, VLC has the biggest delay. On the other hand, there is a VLC client for Android, which is convenient.

  • <IP-OF-THE-CLIENT> is the IP of the computer that should receive the video stream.

  • <IP-OF-THE-RPI> is the IP of the Raspberry Pi.

Using Netcat:

On the client

(Run the command on the client first, and then on the server (RPi)).

Linux

nc -l 2222 | mplayer -fps 200 -demuxer h264es -

OS X

nc -l 2222 | mplayer -fps 200 -demuxer h264es -

On the RPi

/opt/vc/bin/raspivid -t 0 -w 300 -h 300 -hf -fps 20 -o - | nc <IP-OF-THE-CLIENT> 2222

Using GStreamer:

On the client

Linux

gst-launch-1.0 -v tcpclientsrc host=<IP-OF-THE-RPI> port=5000  ! gdpdepay !  rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

OS X

gst-launch-1.0 -v tcpclientsrc host=<IP-OF-THE-RPI> port=5000  ! gdpdepay !  rtph264depay ! avdec_h264 ! videoconvert ! osxvideosink sync=false

On the RPi

/opt/vc/bin/raspivid -t 0 -hf -fps 20 -w 300 -h 300 -o - | gst-launch-1.0 fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=<IP-OF-THE-RPI> port=5000

Using VLC

On the client

The client might even be on a mobile phone (I tried on Android).

Simply open from the network in the VLC client:

http://<IP-OF-THE-RPI>:8090

On the RPi

/opt/vc/bin/raspivid -o - -t 0 -hf -w 640 -h 360 -fps 25|cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264


  最后解决了
https://www.raspberrypi.org/forums/viewtopic.php?t=49278&p=664616
My solution to stream camera vid on RTSP:

Install GStreamer:
sudo apt-get install gstreamer-tools gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly

Make gst-rtsp:
wget  http://gstreamer.freedesktop.org/src/gs ... .8.tar.bz2
bzip2 -d gst-rtsp-0.10.8.tar.bz2
tar xvf gst-rtsp-0.10.8.tar
cd gst-rtsp-0.10.8/
./configure
make

Run gst-launch with raspivid input:
raspivid -t 0 -w 800 -h 600 -fps 25 -g 5 -b 4000000 -vf -n -o - | gst-launch -v fdsrc ! h264parse ! gdppay ! tcpserversink host=127.0.0.1 port=5000

In gst-rtsp-0.10.8/exemples run the RTSP server:
./test-launch "( tcpclientsrc host=127.0.0.1 port=5000 ! gdpdepay ! rtph264pay name=pay0 pt=96 )"

On RTSP player or on Android with RTSP Player:
rtsp://192.168.0.10:8554/test

Improvment for fixed latency and permit to lose frame on bad connection are wellcome.

基于树莓派与MJPG-Streamer构建低成本多机位视频直播系统 视频流媒体技术通过将连续的视频数据压缩并实时传输,实现了远程监控、在线直播等广泛应用。其核心原理在于对视频帧进行编码并通过网络协议传输,其中M-JPEG等格式因其低延迟和简单性,在嵌入式与物联网场景中备受青睐。这项技术的价值在于能够利用通用硬件和开源软件,构建高灵活性、可控且低成本的定制化解决方案,尤其适用于教育、活动直播、安防监控等对隐私和成本敏感的场景。本文聚焦于利用树莓派单板计算机和轻量级MJPG-Streamer服务器,实现多路USB摄像头视频流的采集与发布,并结合OBS Studio进行专业级的多 阅读详情

相关推荐

DesignCamera-95.zip rotato: 95.1585224957 生成所有App Store图像

从今天开始,您唯一需要的手机模型 展示设计是成功的一半。不要仅仅因为人们容易分心而浪费自己的辛苦工作。 即使您不了解3D的第一件事,也可以在一分钟内为iPhone,Android,笔记本电脑和iPad生成模型。新增:生成所有App Store图像。 随附的手机,笔记本电脑和手表模型,在任何这些设备的屏幕上查看您的应用程序设计。您可以使用屏幕截图或屏幕录像,甚至可以通过免费插件直接从Sketch和Adobe XD导入。从正面看到的iPhone X样机iPhone X和XS该样机非常详细,您可以放大并获得出色的拍摄效果。更多呈现iPhone 11 Pro样机的iPhone 11 Pro完美捕捉了背面的防雾玻璃和3个摄像头,请参见更中性的电话,看起来不像任何品牌的电话。中性电话没有缺口,没有按钮。只是一个简单而甜美的电话框架,可无限缩放查看适用于任何事物的更中性的设备样机通用此样机可适应您向其投掷的任何尺寸的视频或图像,并且仍可让您为静止图像和动画选择任何角度查看更多Samsung s9样机Android应用程序设计将完美地沿着三星精美的弧形屏幕流动。查看更多笔记本电脑模型Macbook Pro对于您的台式机网站模型,此笔记本电脑模型 具有完整的键盘-您可以调节盖子的开口!查看更多适用于平板电脑应用程序的ipad样机iPad Pro确保您在此平板电脑模型上尝试粘土模式。查看更多iphone 8实体模型iPhone 8更改此实体模型的设备颜色是强调您品牌色彩的绝好机会。查看更多Apple Watch实体模型Apple Watch所有细节,直至数字表冠上的涟漪。表带的深度很大。看更多

树莓派进行视频直播的几种方式

一、基于Flask创建流媒体服务器的方式 参考GitHub上面Marcelo Rovai的项目(项目地址) Python代码: #!/usr/bin/env python # -*- coding: utf-8 -*- # # camera_pi.py # # # import time import io import threading import picamera class Camera(object): thread = None # background t

weixin_42126140的博客 3358

树莓派4B(32Bit)编译的ffmpeg+x264库

树莓派4B(32Bit)编译的ffmpeg+x264库,在树莓派上可直接使用。截止2020-05-14 最新的版本。博客地址:https://blog.csdn.net/xiaolong1126626497/article/details/106112203

关于树莓派上使用gstreamer的问题

1.播放rtsp 播放成功 gst-launch-1.0 rtspsrc location=rtsp://XXXXXX:554/ISAPI/streaming/channels/101?auth=YWRtaW46MTIzNDU= ! rtph264depay ! h264parse ! omxh264dec ! videoscale ! video/x-raw, format=I420, wi

aphero的专栏 6665

Ollama安装教程

Ollama 是一个开源的大语言模型(LLM)部署工具,专为在本地机器部署和运行大模型而设计,通过简单的命令就可以在本地快速运行大模型(如DeepSeek、Llama、Gemma、QWQ等)。非常适合开发者、研究人员以及对数据安全和隐私有较高要求的企业和用户

学习AI应用开发,分享AI干货、获取最新AI咨询 3909

恶意流量检测数据集

对当前公开的恶意流量相关数据集进行归类总结,持续更新相关论文

tyutwuxuan的博客 1951

树莓派FFmpeg搭配rtmp服务器实现直播推流(一)

移步[原文网站](http://mjvvv.cn/blogBrowse?blogId=58),浏览最新博客。

Red_Fox___的博客 3847

OCR开发车架号识别vin码识别系统

一、vin码识别车架号识别系统简介   vin码识别车架号识别系统,结合VIN码主机厂数据库及自身多年文字识别经验,针对机动车配置参数等信息的查询及采集业务推出的一款VIN码自动识别产品。   车架号识别vin码识别,主要应用在智能手机IOS与Android两个平台中。前端扫描查询模式,无需联网,只需扫描汽车前挡风玻璃右下角的VIN玛(车架号),即可轻松识别出车辆产地、品牌、车

OCR13512721355的博客 1440

树莓派使用 HLS 实现视频流直播

说明 这次介绍一下基于上一篇文章“树莓派编译安装 FFmpeg ”的应用,即 HLS 视频流直播。原理是 FFmpeg 将 USB 摄像头的原始视频流压缩为 H.264 视频流,然后使用 FFmpeg 的 hls 切片工具将视频流分为 n 个切片和 1 个 m3u8 文件,具体原理可以看这篇文章。 准备工作 树莓派一个(1 至 3 代都可以) USB摄像头一个 已连接到网络 步骤 将树莓...

768

DiffusionDriveV2——强化学习约束的截断扩散模型

通过“截断扩散模型(Truncated Diffusion)”和“级联 Transformer 解码器”成功实现了高效的多模态轨迹生成。然而,V1 版本完全依赖于模仿学习,这导致了一个经典的困境:纯粹的模仿学习缺乏对危险行为的显式约束(例如碰撞),模型容易出现“模式崩溃 (Mode Collapse)”,生成的轨迹要么过于保守,要么同质化严重。为解决轨迹生成中“多样性”与“高质量”难以兼顾的问题,DiffusionDriveV2利用强化学习 (RL) 对扩散模型进行安全约束,并实现端到端规控.维度。

m0_68682181的博客 483

STM32F407标准库下ADC多通道DMA采集的配置与优化

本文详细介绍了STM32F407标准库下ADC多通道DMA采集的配置与优化方法。通过GPIO模拟输入配置、ADC时钟和模式设置、DMA传输参数配置等关键步骤,实现高效的多通道数据采集。文章还提供了性能优化技巧和常见问题排查指南,帮助开发者提升采样速率和稳定性。

weixin_29192141的博客 445

树莓派上实现基于v4l2的live55视频直播方法

本文主要介绍了在树莓派上使用live555直播树莓派上usb摄像头的方法。主要是参考了https://blog.csdn.net/li_wen01/article/details/59523963的代码。 目录 1.代码的编译 1.1 x264的编译 1.2 live555的编译 1.3 整个工程的编译 问题: 因为代码实在树莓派上使用的,所以代码要编译成树莓派平台上使用的固件。可以...

仗劍走天涯 1377

基于Python实现学习进度跟踪系统

{{ task }}: {{ "%.1f"|format(hours) }}小时

寒寒豆豆软件公司的博客 199

海康摄像头b/s架构下的视频直播

本文只讨论b/s架构,c/s架构的话,windows和linux的sdk在官网即可下载,ios和安卓的sdk可以和当地分公司联系,签保密协议就给,要注意的是截止2018-11-14,官方并没有arm版的sdk,已和官方确认,所以有些LoT设备无法使用sdk包直接做c/s的开发。下面开始说web端的开发。   场景1: IE浏览器,windows客户机 海康有一个官方的web端sdk,早已停...

q1392141448的博客 5134

YOLOv11改进 | Conv改进篇 | 含2种改进,引入DynamicConv替换普通Conv卷积下采样和C3k2_DynamicConv替换C3k2(来自CVPR2024)

本文提出了一种基于DynamicConv动态卷积优化的YOLOv11轻量化模型改进方案。通过引入多专家机制的动态卷积模块,在增加模型参数量的同时保持较低的计算复杂度(FLOPs),有效解决了低FLOPs模型在大规模预训练中的性能瓶颈问题。文章详细介绍了动态卷积的工作原理、核心代码实现,并提供了在YOLOv11中集成DynamicConv和C3k2_GhostModule_DynamicConv模块的完整教程,包括模块添加、配置文件修改和模型训练验证过程。实验结果表明,该方案在保持高效推理速度的同时显著提升了

Ai缝合怪、助力小伙伴高效发论文 542

[QMT量化交易小白入门]-六十九、ETF动量评分策略,历史年化收益率107%

C . bar_date } 跳过') returnC . bar_date } 跳过') returnC . bar_date } 跳过') return作用:如果当前不是回测模式且不是最后一根K线,则记录日志并跳过本次任务。这是为了避免在实时交易中对尚未完成的数据进行处理。

木头大左的博客 2239

树莓派ffmpeg直播推送,nginx视频流接受转码,客户端hls rtmp视

树莓派ffmpeg直播推送,nginx视频流接受转码,客户端hls rtmp视频流拉流 树莓派利用ffmpeg将摄像头视频流以rtmp视频流的格式,推送到安装有nginx,nginx-rtmp的云服务器端,在云服务器端会进行视频流的录制成flv格式或者转码成m3u8格式的hls视频流 ffmpeg,rtmp,hls简单了解 ffmpeg ffmpeg用于记录,转换和流传输音频和视频的完整的跨...

weiyang_tang的博客 3150

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

教你用树莓派和阿里云做一个在线直播服务

最近项目上自研了一个直播服务,让全国各地的人能通过客户端实时观看视频。技术原理和完成步骤简单分享在这里。 简单来讲,要完成这样一个直播服务,基本架构如下: 摄像头:用于采集视频信号。普通的 USB 摄像头即可。 树莓派:用于将视频信号转换成 rtmp 协议的推流,推送到阿里云直播中心。 阿里云直播中心:接收推流信号,并进行存储、转码、分发等。 WEB 客户端:从阿里云直播中心拉取直播流,并播放。 上述每个环节都可以找到开源软件实现基本功能,但相对来说,直播中心的实际复杂度会远远高于其他模块。因此,直

电气罐头 844

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

树莓派基于ffmpeg+阿里云流媒体服务器实现视频直播

一些基础理论知识准备 致敬雷神 [总结]FFMPEG视音频编解码零基础学习方法 https://blog.csdn.net/leixiaohua1020/article/details/15811977 http://bbs.eeworld.com.cn/thread-506472-1-1.html 总体框架图 音视频编码基本原理(理论部分) https://blog.csdn.net/leixiaohua1020/article/details/28114081 视频压缩编码的方式: 视频压缩的主要依

agentky的博客 2339

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

pistreaming终极教程:从安装到运行,5分钟实现树莓派摄像头Web直播

想要快速搭建树莓派摄像头Web直播系统吗?pistreaming项目为你提供了完美的解决方案!这个基于Python的树莓派摄像头Web直播工具,让你在短短5分钟内就能实现低延迟的视频流传输。无论是家庭监控、远程观察,还是项目展示,pistreaming都能满足你的需求。 ## 🚀 什么是pistreaming项目? pistreaming是一个专门为树莓派设计的摄像头Web直播演示项目,它利

gitblog_00705的博客 903

如何用树莓派打造低延迟摄像头直播系统:pistreaming项目完全指南

想要为你的树莓派摄像头打造一个低延迟的实时视频直播系统吗?🎥 pistreaming项目正是你需要的终极解决方案!这个开源项目通过巧妙的技术组合,让树莓派摄像头能够以极低的延迟将视频流传输到任何现代网页浏览器中,无需复杂的配置,简单几步即可搭建完整的直播系统。无论你是想制作家庭安防监控、宠物观察摄像头,还是远程教学演示,pistreaming都能帮你快速实现。 ## 🚀 pistreamin

gitblog_01047的博客 4012

树莓派摄像头Web直播神器pistreaming:原理、配置与优化全解析

pistreaming是一款专为树莓派设计的**低延迟摄像头Web直播工具**,它能将树莓派摄像头捕捉的实时画面高效传输到任何现代浏览器中,无需复杂配置即可实现流畅的视频直播体验。无论是家庭监控、远程项目展示还是教育演示,pistreaming都能提供简单可靠的解决方案。 ## 🚀 为什么选择pistreaming?核心优势解析 pistreaming之所以成为树莓派用户的首选直播工具,源于

gitblog_01115的博客 4288

python摄像头推流_树莓派使用python-librtmp实现rtmp推流h264的方法

目的是能使用Python进行rtmp推流,方便在h264帧里加入弹幕等操作。librtmp使用的是0.3.0,使用树莓派noir官方摄像头适配的。通过wireshark抓ffmpeg的包一点点改动,最终可以在red5和斗鱼上推流了。没怎么写过python,有不恰当的地方请包涵。上代码:# -- coding: utf-8 --# http://blog.csdn.net/luhangleiimpo...

weixin_39682697的博客 329

告别混乱教程:一张图讲清树莓派CSI摄像头驱动(Legacy vs Libcamera)该怎么选

本文详细对比了树莓派CSI摄像头的Legacy与Libcamera驱动,帮助用户根据应用场景做出最佳选择。通过决策流程图和具体配置步骤,解决OpenCV兼容性、系统版本适配等常见问题,提升树莓派摄像头使用效率。

weixin_33701251的博客 428

使用websocket做视频直播

最近在做的一个小项目需要用到相关技术,找到这篇文章貌似不错,于是就翻译转载上来了。 Recently I’m interesting in these technologies and I’m working on a project related to it. I’ve found this useful article so I translated and posted it here.

黄啊码 1万+
上一篇: Python高效率编程的8条箴言
下一篇: linux下解压缩*.tar.xz方法
offbye
offbye 领域专家: 操作系统技术领域 领域专家: 操作系统技术领域
博客等级 码龄24年 1309粉丝 252原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址