简体中文 | English
The RTSP plugin provides the ability to push and pull the RTSP protocol and also to push and pull the RTSP protocol to remote servers.
https://github.com/Monibuca/plugin-rtsp
import (
_ "m7s.live/plugin/rtsp/v4"
)
rtsp://localhost/live/test
localhost
is the m7s server domain name or IP address, and the default port554
can be omitted, otherwise it is required to be written.live
representsappName
test
representsstreamName
live/test
in m7s will serve as the stream identity.
For example, push stream to m7s through ffmpeg
ffmpeg -i [video source] -c:v h264 -c:a aac -f rtsp rtsp://localhost/live/test
This will create a stream named live/test
inside m7s.
If the live/test
stream already exists in m7s, then you can use the RTSP protocol to play it.
ffplay rtsp://localhost/live/test
rtsp:
publish: # Refer to the global configuration format
subscribe: # Refer to the global configuration format
pull: # Format reference document https://m7s.live/guide/config.html#%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE
push: # Format reference document https://m7s.live/guide/config.html#%E6%8F%92%E4%BB%B6%E9%85%8D%E7%BD%AE
listenaddr: :554
udpaddr: :8000
rtcpaddr: :8001
readbuffercount: 2048
writebuffercount: 2048
:::tip Configuration override publish and subscribe, any section not configured will use global configuration. :::
Get all RTSP streams
Pull the RTSP to m7s from a remote server
- save meaning: 0, do not save; 1, save to pullonstart; 2, save to pullonsub
- The RTSP address needs to be urlencoded to prevent special characters from affecting parsing
Push local streams to remote servers