golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
791 B
37 lines
791 B
#!/bin/sh -e |
|
|
|
PROXY_COUNT=20 |
|
PROXY_PROTOCOL=tcp |
|
|
|
##################################################### |
|
# source |
|
|
|
CONF="" |
|
CONF="${CONF}rtspPort: 8555\n" |
|
CONF="${CONF}rtpPort: 8002\n" |
|
CONF="${CONF}rtcpPort: 8003\n" |
|
echo -e "$CONF" > /source.conf |
|
|
|
/rtsp-simple-server /source.conf & |
|
|
|
sleep 1 |
|
|
|
ffmpeg -hide_banner -loglevel error \ |
|
-re -stream_loop -1 -i /video.mkv -c copy -f rtsp rtsp://localhost:8555/source & |
|
|
|
sleep 1 |
|
|
|
##################################################### |
|
# proxy |
|
|
|
CONF="" |
|
CONF="${CONF}pprof: yes\n" |
|
CONF="${CONF}paths:\n" |
|
for i in $(seq 1 $PROXY_COUNT); do |
|
CONF="${CONF} proxy$i:\n" |
|
CONF="${CONF} source: rtsp://localhost:8555/source\n" |
|
CONF="${CONF} sourceProtocol: $PROXY_PROTOCOL\n" |
|
done |
|
echo -e "$CONF" > /proxy.conf |
|
|
|
/rtsp-simple-server /proxy.conf
|
|
|