C++ RTSP video capture implementation

与世无争的帅哥 提交于 2019-12-25 14:25:28

问题


I would like to develop a very tiny and small RTSP client to get the video stream from network cameras. Does anybody know where can I find a simple explanation of the protocol and some good examples?

Best regards,


回答1:


You connect to the camera via RTSP protocol to query its capabilities, identify streams and prepare/start transmission.

  • RFC 2326 - Real Time Streaming Protocol (RTSP)

As a part of initialization and handshaking, you will discover available streams.

  • RFC 4566 - SDP Session Description Protocol

Then you will set up RTP session(s) to receive data, over UDP or sharing the same TCP connection.

  • RFC 3550 - RTP A Transport Protocol for Real-Time Applications
  • RFC 4571 - Framing Real-time Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over Connection-Oriented Trans

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):

  • RFC 3984 - RTP Payload Format for H.264 Video
  • RFC 6184 - RTP Payload Format for H.264 Video

This looks like some (introductory) reading.




回答2:


Try GStreammer library. It is modular, wery flexible library, which can be used for streamming (both client and server). 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.



来源:https://stackoverflow.com/questions/13027062/c-rtsp-video-capture-implementation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!