mediamtx/bench/proxy/start.sh

44 lines
994 B
Bash
Raw Normal View History

2020-09-18 17:59:07 +00:00
#!/bin/sh -e
2020-10-06 11:57:36 +00:00
PROXY_COUNT=20
2020-09-18 17:59:07 +00:00
PROXY_PROTOCOL=tcp
#####################################################
# source
CONF=""
2021-05-09 15:28:48 +00:00
CONF="${CONF}hlsDisable: yes\n"
CONF="${CONF}rtspAddress: :8555\n"
CONF="${CONF}rtpAddress: :8002\n"
CONF="${CONF}rtcpAddress: :8003\n"
2020-09-18 17:59:07 +00:00
echo -e "$CONF" > /source.conf
2021-03-23 21:25:43 +00:00
RTSP_RTMPDISABLE=yes /rtsp-simple-server /source.conf &
2020-09-18 17:59:07 +00:00
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=""
2021-05-09 15:28:48 +00:00
CONF="${CONF}hlsDisable: yes\n"
2020-09-18 17:59:07 +00:00
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
2021-03-23 21:25:43 +00:00
RTSP_RTMPDISABLE=yes /rtsp-simple-server /proxy.conf &
sleep 5
go tool pprof -text http://localhost:9999/debug/pprof/profile?seconds=15