2020-09-18 17:59:07 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2023-08-26 16:11:55 +00:00
|
|
|
READER_COUNT=50
|
2020-09-18 17:59:07 +00:00
|
|
|
READER_PROTOCOL=tcp
|
|
|
|
|
|
|
|
#####################################################
|
|
|
|
# source
|
|
|
|
|
|
|
|
CONF=""
|
|
|
|
CONF="${CONF}pprof: yes\n"
|
2021-11-12 21:33:19 +00:00
|
|
|
CONF="${CONF}paths:\n"
|
|
|
|
CONF="${CONF} all:\n"
|
2020-09-18 17:59:07 +00:00
|
|
|
echo -e "$CONF" > /source.conf
|
|
|
|
|
2023-04-01 17:52:06 +00:00
|
|
|
/mediamtx /source.conf &
|
2020-09-18 17:59:07 +00:00
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
ffmpeg -re -stream_loop -1 -i /video.mkv -c copy -f rtsp rtsp://localhost:8554/source &
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
#####################################################
|
|
|
|
# readers
|
|
|
|
|
|
|
|
for i in $(seq 1 $READER_COUNT); do
|
|
|
|
ffmpeg -hide_banner -loglevel error \
|
|
|
|
-rtsp_transport $READER_PROTOCOL \
|
2023-08-26 16:11:55 +00:00
|
|
|
-i rtsp://localhost:8554/source -c copy -f null - &
|
2020-09-18 17:59:07 +00:00
|
|
|
done
|
|
|
|
|
2021-01-06 22:24:05 +00:00
|
|
|
sleep 5
|
|
|
|
|
|
|
|
go tool pprof -text http://localhost:9999/debug/pprof/profile?seconds=15
|