Scripts for building a random playlist and streaming to server.

This commit is contained in:
Matt McWilliams 2024-05-11 15:49:09 -04:00
parent 3484fb6c8f
commit 1b8f2a8466
2 changed files with 29 additions and 0 deletions

22
playlist.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
source ./common.sh
fileList=$(mktemp)
shuffleList=$(mktemp)
ls -1 "${VIDEOS}/" > "${fileList}"
rm -rf playlist.txt
count=10
for i in $(seq $count); do
cat "${fileList}" | shuf > "${shuffleList}"
while read videoIn; do
echo "file '${VIDEOS}/${videoIn}'" >> playlist.txt
done < "${shuffleList}"
done
rm -f "${fileList}"
rm -f "${shuffleList}"

7
stream.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
source ./common.sh
ffmpeg -re -f concat -safe 0 -stream_loop -1 -i playlist.txt -c copy -f flv "${DESTINATION}"