简体   繁体   English

C ++ RTSP视频捕获实现

[英]C++ RTSP video capture implementation

I would like to develop a very tiny and small RTSP client to get the video stream from network cameras. 我想开发一个非常小巧的RTSP客户端,以从网络摄像机获取视频流。 Does anybody know where can I find a simple explanation of the protocol and some good examples? 有人知道在哪里可以找到该协议的简单说明和一些很好的示例吗?

Best regards, 最好的祝福,

You connect to the camera via RTSP protocol to query its capabilities, identify streams and prepare/start transmission. 您通过RTSP协议连接到摄像机以查询其功能,识别流并准备/开始传输。

As a part of initialization and handshaking, you will discover available streams. 作为初始化和握手的一部分,您将发现可用的流。

Then you will set up RTP session(s) to receive data, over UDP or sharing the same TCP connection. 然后,您将设置RTP会话以通过UDP或共享同一TCP连接来接收数据。

To decode media streams you will convert the payload into pure data you need for further processing. 要解码媒体流,您需要将有效负载转换为需要进一步处理的纯数据。 With IP cameras your primary interest is perhaps MPEG-4 AVC (H.264): 使用IP摄像机,您的主要兴趣也许是MPEG-4 AVC(H.264):

This looks like some (introductory) reading. 这看起来像一些(入门)阅读。

Try GStreammer library. 尝试使用GStreammer库。 It is modular, wery flexible library, which can be used for streamming (both client and server). 它是模块化的wery灵活库,可用于流(客户端和服务器)。 Just check the docs and pick right plugins. 只需检查文档并选择合适的插件即可。

GStreammer could be used in two ways: as a commandline tool or as a library in your project, depending on your requirements. GStreammer可以以两种方式使用:根据您的要求,用作命令行工具或项目中的库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM