mirror of
https://github.com/aler9/rtsp-simple-server
synced 2026-04-22 23:17:11 +08:00
docs: update (#5570)
This commit is contained in:
@@ -9,7 +9,7 @@ Live streams can be published to the server with the following protocols and cod
|
||||
| [WebRTC clients](04-webrtc-clients.md) | WHIP | **Video**: AV1, VP9, VP8, H265, H264<br/>**Audio**: Opus, G722, G711 (PCMA, PCMU) |
|
||||
| [WebRTC servers](05-webrtc-servers.md) | WHEP | **Video**: AV1, VP9, VP8, H265, H264<br/>**Audio**: Opus, G722, G711 (PCMA, PCMU) |
|
||||
| [RTSP clients](06-rtsp-clients.md) | UDP, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, MJPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTSP cameras and servers](07-rtsp-cameras-and-servers) | UDP, UDP-Multicast, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, MJPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTSP cameras and servers](07-rtsp-cameras-and-servers.md) | UDP, UDP-Multicast, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, MJPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTMP clients](08-rtmp-clients.md) | RTMP, RTMPS, Enhanced RTMP | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [RTMP cameras and servers](09-rtmp-cameras-and-servers.md) | RTMP, RTMPS, Enhanced RTMP | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [HLS cameras and servers](10-hls-cameras-and-servers.md) | Low-Latency HLS, MP4-based HLS, legacy HLS | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC) |
|
||||
|
||||
@@ -22,5 +22,3 @@ paths:
|
||||
`rtpSDP` must contain a valid SDP, that is a description of the RTP session.
|
||||
|
||||
Some clients that can publish with UDP and MPEG-TS are [FFmpeg](15-ffmpeg.md) and [GStreamer](16-gstreamer.md).
|
||||
|
||||
## Devices
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# OBS Studio
|
||||
|
||||
OBS Studio can publish to the server in several ways. The recommended one consists in publishing with RTMP.
|
||||
OBS Studio can publish streams to the server in several ways. The recommended one consists in publishing with RTMP.
|
||||
|
||||
## OBS Studio and RTMP
|
||||
|
||||
@@ -107,7 +107,7 @@ OBS Studio can publish multiple video tracks or renditions at once. Make sure th
|
||||
|
||||
## OBS Studio and WebRTC
|
||||
|
||||
Recent versions of OBS Studio can also publish to the server with the [WebRTC / WHIP protocol](21-webrtc-clients.md) Use the following parameters:
|
||||
Recent versions of OBS Studio can also publish streams to the server with the [WebRTC / WHIP protocol](04-webrtc-clients.md) Use the following parameters:
|
||||
|
||||
- Service: `WHIP`
|
||||
- Server: `http://localhost:8889/mystream/whip`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Python and OpenCV
|
||||
|
||||
Python-based software can publish to the server with the OpenCV library and its GStreamer plugin, acting as a [RTSP client](06-rtsp-clients.md). OpenCV must be compiled with support for GStreamer, by following this procedure:
|
||||
Python-based software can publish streams to the server with the OpenCV library and its GStreamer plugin, acting as a [RTSP client](06-rtsp-clients.md). OpenCV must be compiled with support for GStreamer, by following this procedure:
|
||||
|
||||
```sh
|
||||
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-rtsp python3-dev python3-numpy
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
# Golang
|
||||
|
||||
You can publish to the server from the Go programming language by using [gortsplib](https://github.com/bluenviron/gortsplib), a RTSP client/server library, and [gortmplib](https://github.com/bluenviron/gortmplib), a RTMP client/server library. Both powers _MediaMTX_ itself. In the repositories of these projects there are several examples on how to connect to a server and push data.
|
||||
You can publish a stream to the server by using the Go programming language and the following libraries:
|
||||
|
||||
- [gortsplib](https://github.com/bluenviron/gortsplib) to publish with RTSP.
|
||||
- [gortmplib](https://github.com/bluenviron/gortmplib) to publish with RTMP.
|
||||
|
||||
Both powers _MediaMTX_ itself. In the repositories of these projects there are several examples on how to connect to a server and push data.
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
Live streams can be read from the server with the following protocols and codecs:
|
||||
|
||||
| protocol | variants | codecs |
|
||||
| ---------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [SRT](02-srt.md) | | **Video**: H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3<br/>**Other**: KLV |
|
||||
| [WebRTC](03-webrtc.md) | WHEP | **Video**: AV1, VP9, VP8, H265, H264<br/>**Audio**: Opus, G722, G711 (PCMA, PCMU)<br/>**Other**: KLV |
|
||||
| [RTSP](04-rtsp.md) | UDP, UDP-Multicast, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTMP](05-rtmp.md) | RTMP, RTMPS, Enhanced RTMP | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [HLS](06-hls.md) | Low-Latency HLS, MP4-based HLS, legacy HLS | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC) |
|
||||
| protocol | variants | codecs |
|
||||
| ------------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [SRT clients](02-srt.md) | | **Video**: H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3<br/>**Other**: KLV |
|
||||
| [WebRTC clients](03-webrtc.md) | WHEP | **Video**: AV1, VP9, VP8, H265, H264<br/>**Audio**: Opus, G722, G711 (PCMA, PCMU)<br/>**Other**: KLV |
|
||||
| [RTSP clients](04-rtsp.md) | UDP, UDP-Multicast, TCP, RTSPS | **Video**: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, M-JPEG<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM<br/>**Other**: KLV, MPEG-TS, any RTP-compatible codec |
|
||||
| [RTMP clients](05-rtmp.md) | RTMP, RTMPS, Enhanced RTMP | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G711 (PCMA, PCMU), LPCM |
|
||||
| [HLS](06-hls.md) | Low-Latency HLS, MP4-based HLS, legacy HLS | **Video**: AV1, VP9, H265, H264<br/>**Audio**: Opus, MPEG-4 Audio (AAC) |
|
||||
|
||||
We provide instructions for reading with the following software:
|
||||
|
||||
@@ -16,5 +16,7 @@ We provide instructions for reading with the following software:
|
||||
- [GStreamer](08-gstreamer.md)
|
||||
- [VLC](09-vlc.md)
|
||||
- [OBS Studio](10-obs-studio.md)
|
||||
- [Unity](11-unity.md)
|
||||
- [Web browsers](12-web-browsers.md)
|
||||
- [Python and OpenCV](11-python-opencv.md)
|
||||
- [Golang](12-golang.md)
|
||||
- [Unity](13-unity.md)
|
||||
- [Web browsers](14-web-browsers.md)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SRT
|
||||
# SRT clients
|
||||
|
||||
SRT is a protocol that allows to publish and read live data stream, providing encryption, integrity and a retransmission mechanism. It is usually used to transfer media streams encoded with MPEG-TS. In order to read a stream from the server with the SRT protocol, use this URL:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# WebRTC
|
||||
# WebRTC clients
|
||||
|
||||
WebRTC is an API that makes use of a set of protocols and methods to connect two clients together and allow them to exchange live media or data streams. You can read a stream with WebRTC and a web browser by visiting:
|
||||
|
||||
@@ -16,4 +16,4 @@ Be aware that not all browsers can read any codec, check [Supported browsers](..
|
||||
|
||||
Depending on the network it may be difficult to establish a connection between server and clients, read [Solving WebRTC connectivity issues](../4-other/22-webrtc-specific-features.md#solving-webrtc-connectivity-issues).
|
||||
|
||||
Some clients that can read with WebRTC and WHEP are [FFmpeg](07-ffmpeg.md), [GStreamer](08-gstreamer.md), [Unity](11-unity.md) and [web browsers](12-web-browsers.md).
|
||||
Some clients that can read with WebRTC and WHEP are [FFmpeg](07-ffmpeg.md), [GStreamer](08-gstreamer.md), [Unity](13-unity.md) and [web browsers](14-web-browsers.md).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# RTSP
|
||||
# RTSP clients
|
||||
|
||||
RTSP is a protocol that allows to publish and read streams. It supports several underlying transport protocols and encryption (see [RTSP-specific features](../4-other/23-rtsp-specific-features.md)). In order to read a stream with the RTSP protocol, use this URL:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# RTMP
|
||||
# RTMP clients
|
||||
|
||||
RTMP is a protocol that allows to read and publish streams. It supports encryption, see [RTMP-specific features](../4-other/24-rtmp-specific-features.md). Streams can be read from the server by using the URL:
|
||||
|
||||
|
||||
@@ -12,4 +12,4 @@ and can also be accessed without using the browsers, by software that supports t
|
||||
http://localhost:8888/mystream/index.m3u8
|
||||
```
|
||||
|
||||
Some clients that can read with HLS are [FFmpeg](07-ffmpeg.md), [GStreamer](08-gstreamer.md), [VLC](09-vlc.md) and [web browsers](12-web-browsers.md).
|
||||
Some clients that can read with HLS are [FFmpeg](07-ffmpeg.md), [GStreamer](08-gstreamer.md), [VLC](09-vlc.md) and [web browsers](14-web-browsers.md).
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# Python and OpenCV
|
||||
|
||||
Python-based software can read streams from the server with the OpenCV library, acting as a [RTSP client](04-rtsp.md).
|
||||
|
||||
```python
|
||||
import cv2
|
||||
|
||||
cap = cv2.VideoCapture('rtsp://localhost:8554/mystream')
|
||||
if not cap.isOpened():
|
||||
raise Exception("can't open video capture")
|
||||
|
||||
while True:
|
||||
ret, frame = cap.read()
|
||||
if not ret:
|
||||
raise Exception("can't receive frame")
|
||||
|
||||
cv2.imshow('frame', frame)
|
||||
|
||||
if cv2.waitKey(1) == ord('q'):
|
||||
break
|
||||
|
||||
cap.release()
|
||||
cv2.destroyAllWindows()
|
||||
```
|
||||
@@ -0,0 +1,8 @@
|
||||
# Golang
|
||||
|
||||
You can read a stream from the server by using the Go programming language and the following libraries:
|
||||
|
||||
- [gortsplib](https://github.com/bluenviron/gortsplib) to read with RTSP.
|
||||
- [gortmplib](https://github.com/bluenviron/gortmplib) to read with RTMP.
|
||||
|
||||
Both powers _MediaMTX_ itself. In the repositories of these projects there are several examples on how to connect to a server and read data.
|
||||
@@ -313,7 +313,7 @@ Pass the token as a query parameter:
|
||||
rtmp://localhost/mystream?jwt=jwt
|
||||
```
|
||||
|
||||
WARNING: FFmpeg implementation of RTMP does not support query parameters that are longer than 1024 characters, therefore you have to configure your identity server in order to produce JWTs that are shorter than this threshold.
|
||||
WARNING: FFmpeg implementation of RTMP does not support URLs that are longer than 1024 characters (this is the [TCURL_MAX_LENGTH constant](https://github.com/FFmpeg/FFmpeg/blob/f951aa9ef382d6bb517e05d04d52710f751de427/libavformat/rtmpproto.c#L55)), therefore you have to configure your identity server in order to produce JWTs that are shorter than this threshold.
|
||||
|
||||
### SRT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user