# Micro-RTSP
This is a small library which can be used to serve up RTSP streams from
resource constrained MCUs. It lets you trivially make a $10 open source
RTSP video stream camera.
# Usage
This library works for ESP32/arduino targets but also for most any posixish platform.
## Example arduino/ESP32 usage
This library will work standalone, but it is _super_ easy to use if your app is platform.io based.
Just "pio lib install Micro-RTSP" to pull the latest version from their library server. If you want to use the OV2640
camera support you'll need to be targeting the espressif32 platform in your project.
See the [example platform.io app](/examples). It should build and run on virtually any of the $10
ESP32-CAM boards (such as M5CAM). The relevant bit of the code is included below. In short:
1. Listen for a TCP connection on the RTSP port with accept()
2. When a connection comes in, create a CRtspSession and OV2640Streamer camera streamer objects.
3. While the connection remains, call session->handleRequests(0) to handle any incoming client requests.
4. Every 100ms or so call session->broadcastCurrentFrame() to send new frames to any clients.
```
void loop()
{
uint32_t msecPerFrame = 100;
static uint32_t lastimage = millis();
// If we have an active client connection, just service that until gone
// (FIXME - support multiple simultaneous clients)
if(session) {
session->handleRequests(0); // we don't use a timeout here,
// instead we send only if we have new enough frames
uint32_t now = millis();
if(now > lastimage + msecPerFrame || now < lastimage) { // handle clock rollover
session->broadcastCurrentFrame(now);
lastimage = now;
// check if we are overrunning our max frame rate
now = millis();
if(now > lastimage + msecPerFrame)
printf("warning exceeding max frame rate of %d ms\n", now - lastimage);
}
if(session->m_stopped) {
delete session;
delete streamer;
session = NULL;
streamer = NULL;
}
}
else {
client = rtspServer.accept();
if(client) {
//streamer = new SimStreamer(&client, true); // our streamer for UDP/TCP based RTP transport
streamer = new OV2640Streamer(&client, cam); // our streamer for UDP/TCP based RTP transport
session = new CRtspSession(&client, streamer); // our threads RTSP session and state
}
}
}
```
## Example posix/linux usage
There is a small standalone example [here](/test/RTSPTestServer.cpp). You can build it by following [these](/test/README.md) directions. The usage of the two key classes (CRtspSession and SimStreamer) are very similar to to the ESP32 usage.
## Supporting new camera devices
Supporting new camera devices is quite simple. See OV2640Streamer for an example and implement streamImage()
by reading a frame from your camera.
# Structure and design notes
# Issues and sending pull requests
Please report issues and send pull requests. I'll happily reply. ;-)
# Credits
The server code was initially based on a great 2013 [tutorial](https://www.medialan.de/usecase0001.html) by Medialan.
# License
Copyright 2018 S. Kevin Hester-Chow, kevinh@geeksville.com (MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ESP32CAM-RTSP
需积分: 0 161 浏览量
更新于2023-03-21
收藏 11.57MB ZIP 举报
ESP32-CAM-RTSP 是一个基于Espressif ESP32微控制器的项目,它实现了实时流传输协议(RTSP)服务器的功能。这个项目主要适用于那些希望在物联网设备上集成摄像头并进行视频流传输的应用。在GitHub上,开发者通常会分享这样的项目,以便其他人可以学习、使用或改进。
我们需要理解ESP32-CAM模块。ESP32-CAM是一款集成了ESP32芯片的物联网开发板,内置Wi-Fi和蓝牙功能,并且配备了一颗用于图像捕捉的摄像头。它适用于各种智能硬件项目,如安全监控、智能家居和自动驾驶等。
RTSP(Real-Time Streaming Protocol)是一种网络协议,用于控制多媒体数据的实时传输。通过RTSP,客户端可以请求服务器播放、暂停、快进等操作,使得远程视频流的控制成为可能。在ESP32-CAM-RTSP项目中,ESP32作为服务器端,接收并响应来自客户端的RTSP请求,将摄像头捕获的视频流实时传输到网络上的其他设备。
在GitHub上,"整理GITHUB所需檔案"可能意味着开发者已经将所有必要的代码、配置文件和说明文档整理成一个仓库,便于用户下载和使用。这通常包括以下部分:
1. **源代码**:项目的主程序,通常用C++或MicroPython编写,实现RTSP服务器功能,处理网络连接和视频流的编码与传输。
2. **配置文件**:如WiFi设置、摄像头参数等,用于根据具体环境调整项目行为。
3. **README文件**:提供项目介绍、安装指南和使用说明。
4. **示例代码**:演示如何从客户端连接到ESP32-CAM-RTSP服务器并播放视频流。
5. **依赖库**:项目可能依赖于一些第三方库,如OpenCV用于图像处理,或者LittleFS用于文件系统管理。
标签“git”表明项目使用Git进行版本控制。Git是分布式版本控制系统,用于跟踪代码的修改历史,方便协作和回溯错误。在GitHub上,你可以看到项目的提交历史、分支管理和Pull Request流程。
在压缩包文件名称列表中,`ESP32-RTSP-master`可能是项目的主分支或最新稳定版本的下载包。"master"通常表示主分支,是项目的主要开发线,包含了最新的、可运行的代码。
ESP32-CAM-RTSP项目是一个利用ESP32-CAM模块实现RTSP服务器功能的开源项目,适合想要在物联网设备上进行视频流传输的开发者。通过GitHub,你可以获取到项目的源码、配置文件和其他资源,进行学习和二次开发。利用Git工具,可以跟踪项目更新并与社区互动,共同推动项目进步。
luckhy2882
- 粉丝: 0
- 资源: 1
最新资源
- 拳皇97.exe拳皇972.exe拳皇973.exe
- Matlab根据flac、pfc或其他软件导出的坐标及应力、位移数据再现云图 案例包括导出在flac6.0中导出位移的fish代码(也可以自己先准备软件导出的坐标数据及对应点的位移或应力数据,可根据需
- python-geohash-0.8.5-cp38-cp38-win-amd64
- 法码滋.exe法码滋2.exe法码滋3.exe
- 串联式、并联式、混联式混合动力系统simulink控制策略模型(串联式、并联式、混联式每个都是独立的需要单独说拿哪个,默认是混联式RB) 有基于逻辑门限值、状态机的规则控制策略(RB)、基于等效燃油
- 医药用品检测21-YOLO(v5至v11)、COCO、Paligemma、VOC数据集合集.rar
- 数据恢复软件 Apeaksoft Data Recovery for Mac v1.6.16
- 阅读工具 OmniReader Pro for Mac v3.0.3
- 数据恢复 Disk Drill Enterprise for Mac v5.7.1704
- 全自动批量建站快速养权重站系统【纯静态html站群版】:(GPT4.0自动根据关键词写文章+自动发布+自定义友链+自动文章内链+20%页面加提权词)
- 医药用品检测53-YOLO(v5至v11)、COCO、CreateML、Paligemma数据集合集.rar
- req-sign、bd-ticket-ree-public加密算法(JS)
- 船舶燃料消耗和二氧化碳排放分析数据集,燃料消耗和碳排放关联分析数据
- KUKA机器人安装包,与PROFINET软件包
- 非wine、原生Linux迅雷安装包deb文件,支持Ubuntu、UOS统信、深度Deepin、LinuxMint、Debain系通用
- VScode最新安装包macos版本