Created
July 28, 2020 10:19
-
-
Save kirushyk/3baa0c6c460d72e1ec6189df5ee69cb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE=$1 | |
BASENAME=`basename ${SOURCE}` | |
TSNAME=${BASENAME%.*}.ts | |
DEST=$2 | |
if [ $# -lt 2 ]; then | |
echo "Usage: loop.sh <input.mp4> <RTMP DEST URL>" | |
exit 1 | |
fi | |
# Convert input into .ts file | |
ffmpeg -y -i ${SOURCE} -c copy -bsf:v h264_mp4toannexb -f mpegts ${TSNAME} | |
# Create a loop | |
ffmpeg -y -re -stream_loop -1 -i ${TSNAME} -c copy -strict -2 -bsf:a aac_adtstoasc -f flv ${DEST} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment