mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-08 07:50:02 +00:00
23 lines
368 B
Bash
23 lines
368 B
Bash
#!/bin/sh -e
|
|
|
|
mkdir /out
|
|
chown user:user /out
|
|
|
|
CMD="cvlc --play-and-exit --no-audio --no-video --sout file/ts:/out/stream.ts -vvv $@"
|
|
su - user -c "$CMD" 2>&1 &
|
|
|
|
COUNTER=0
|
|
while true; do
|
|
sleep 1
|
|
|
|
if [ $(stat -c "%s" /out/stream.ts) -gt 0 ]; then
|
|
exit 0
|
|
fi
|
|
|
|
COUNTER=$(($COUNTER + 1))
|
|
|
|
if [ $COUNTER -ge 15 ]; then
|
|
exit 1
|
|
fi
|
|
done
|