Spaces:
Paused
Paused
Julian Bilcke
commited on
Commit
·
0b2f8ce
1
Parent(s):
7e58471
added channel 2
Browse files- database.json +1 -1
- scripts/{audio.sh → audio1.sh} +11 -11
- scripts/audio2.sh +31 -0
- scripts/init.sh +33 -16
- scripts/stream.sh +0 -24
- scripts/stream1.sh +24 -0
- scripts/stream2.sh +24 -0
- scripts/{video.sh → video1.sh} +12 -12
- scripts/video2.sh +33 -0
- start.sh +6 -3
database.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"version": 1,
|
| 3 |
-
"startAtShotId": "
|
| 4 |
"sequences": [
|
| 5 |
{
|
| 6 |
"sequenceId": "0489dbc6-791c-4cb8-97f6-ada01092fa91",
|
|
|
|
| 1 |
{
|
| 2 |
"version": 1,
|
| 3 |
+
"startAtShotId": "ae832251-8cab-4177-b92c-1ae215421cdc",
|
| 4 |
"sequences": [
|
| 5 |
{
|
| 6 |
"sequenceId": "0489dbc6-791c-4cb8-97f6-ada01092fa91",
|
scripts/{audio.sh → audio1.sh}
RENAMED
|
@@ -1,30 +1,30 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
echo "Starting the audio collection stream.."
|
| 4 |
current_count=0
|
| 5 |
|
| 6 |
while true; do
|
| 7 |
-
new_count=$(ls $
|
| 8 |
|
| 9 |
if [ $new_count -ne $current_count ]; then
|
| 10 |
-
echo "there are $new_count audio files"
|
| 11 |
|
| 12 |
-
echo "Updating audio playlists..."
|
| 13 |
current_count=$new_count
|
| 14 |
-
files=($
|
| 15 |
|
| 16 |
# Re-create the audio playlists
|
| 17 |
-
echo "ffconcat version 1.0" >
|
| 18 |
-
echo "ffconcat version 1.0" >
|
| 19 |
for (( i=0; i<${#files[@]}; i++ )); do
|
| 20 |
if (( i%2 == 0 )); then
|
| 21 |
-
echo "file '${files[$i]}'" >>
|
| 22 |
else
|
| 23 |
-
echo "file '${files[$i]}'" >>
|
| 24 |
fi
|
| 25 |
done
|
| 26 |
-
echo "file '
|
| 27 |
-
echo "file '
|
| 28 |
fi
|
| 29 |
|
| 30 |
sleep 1
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
echo "Starting the audio collection stream for channel 1.."
|
| 4 |
current_count=0
|
| 5 |
|
| 6 |
while true; do
|
| 7 |
+
new_count=$(ls $WEBTV_AUDIO_STORAGE_PATH_CHANNEL_1*.mp3 2> /dev/null | wc -l)
|
| 8 |
|
| 9 |
if [ $new_count -ne $current_count ]; then
|
| 10 |
+
echo "there are $new_count audio files for channel 1"
|
| 11 |
|
| 12 |
+
echo "Updating audio playlists for channel 1..."
|
| 13 |
current_count=$new_count
|
| 14 |
+
files=($WEBTV_AUDIO_STORAGE_PATH_CHANNEL_1*.mp3)
|
| 15 |
|
| 16 |
# Re-create the audio playlists
|
| 17 |
+
echo "ffconcat version 1.0" > channel_1_audio_list_a.txt
|
| 18 |
+
echo "ffconcat version 1.0" > channel_1_audio_list_b.txt
|
| 19 |
for (( i=0; i<${#files[@]}; i++ )); do
|
| 20 |
if (( i%2 == 0 )); then
|
| 21 |
+
echo "file '${files[$i]}'" >> channel_1_audio_list_a.txt
|
| 22 |
else
|
| 23 |
+
echo "file '${files[$i]}'" >> channel_1_audio_list_b.txt
|
| 24 |
fi
|
| 25 |
done
|
| 26 |
+
echo "file 'channel_1_audio_list_b.txt'" >> channel_1_audio_list_a.txt
|
| 27 |
+
echo "file 'channel_1_audio_list_a.txt'" >> channel_1_audio_list_b.txt
|
| 28 |
fi
|
| 29 |
|
| 30 |
sleep 1
|
scripts/audio2.sh
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
echo "Starting the audio collection stream for channel 2.."
|
| 4 |
+
current_count=0
|
| 5 |
+
|
| 6 |
+
while true; do
|
| 7 |
+
new_count=$(ls $WEBTV_AUDIO_STORAGE_PATH_CHANNEL_2*.mp3 2> /dev/null | wc -l)
|
| 8 |
+
|
| 9 |
+
if [ $new_count -ne $current_count ]; then
|
| 10 |
+
echo "there are $new_count audio files for channel 2"
|
| 11 |
+
|
| 12 |
+
echo "Updating audio playlists for channel 2..."
|
| 13 |
+
current_count=$new_count
|
| 14 |
+
files=($WEBTV_AUDIO_STORAGE_PATH_CHANNEL_2*.mp3)
|
| 15 |
+
|
| 16 |
+
# Re-create the audio playlists
|
| 17 |
+
echo "ffconcat version 1.0" > channel_2_audio_list_a.txt
|
| 18 |
+
echo "ffconcat version 1.0" > channel_2_audio_list_b.txt
|
| 19 |
+
for (( i=0; i<${#files[@]}; i++ )); do
|
| 20 |
+
if (( i%2 == 0 )); then
|
| 21 |
+
echo "file '${files[$i]}'" >> channel_2_audio_list_a.txt
|
| 22 |
+
else
|
| 23 |
+
echo "file '${files[$i]}'" >> channel_2_audio_list_b.txt
|
| 24 |
+
fi
|
| 25 |
+
done
|
| 26 |
+
echo "file 'channel_2_audio_list_b.txt'" >> channel_2_audio_list_a.txt
|
| 27 |
+
echo "file 'channel_2_audio_list_a.txt'" >> channel_2_audio_list_b.txt
|
| 28 |
+
fi
|
| 29 |
+
|
| 30 |
+
sleep 1
|
| 31 |
+
done
|
scripts/init.sh
CHANGED
|
@@ -1,21 +1,38 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
mkdir -p $
|
| 6 |
-
mkdir -p $
|
| 7 |
|
| 8 |
-
echo "creating the playlists.."
|
| 9 |
-
echo "ffconcat version 1.0" >
|
| 10 |
-
echo "ffconcat version 1.0" >
|
| 11 |
-
echo "ffconcat version 1.0" >
|
| 12 |
-
echo "ffconcat version 1.0" >
|
| 13 |
|
| 14 |
-
echo "file '
|
| 15 |
-
echo "file '
|
| 16 |
-
echo "file '
|
| 17 |
-
echo "file '
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# ------------- CHANNEL 1 --------------
|
| 4 |
+
echo "creating the storage folders for channel 1.."
|
| 5 |
+
mkdir -p $WEBTV_VIDEO_STORAGE_PATH_CHANNEL_1
|
| 6 |
+
mkdir -p $WEBTV_AUDIO_STORAGE_PATH_CHANNEL_1
|
| 7 |
|
| 8 |
+
echo "creating the playlists for channel 1.."
|
| 9 |
+
echo "ffconcat version 1.0" > channel_1_video_list_a.txt
|
| 10 |
+
echo "ffconcat version 1.0" > channel_1_video_list_b.txt
|
| 11 |
+
echo "ffconcat version 1.0" > channel_1_audio_list_a.txt
|
| 12 |
+
echo "ffconcat version 1.0" > channel_1_audio_list_b.txt
|
| 13 |
|
| 14 |
+
echo "file 'channel_1_video_list_b.txt'" >> channel_1_video_list_a.txt
|
| 15 |
+
echo "file 'channel_1_video_list_a.txt'" >> channel_1_video_list_b.txt
|
| 16 |
+
echo "file 'channel_1_audio_list_b.txt'" >> channel_1_audio_list_a.txt
|
| 17 |
+
echo "file 'channel_1_audio_list_a.txt'" >> channel_1_audio_list_b.txt
|
| 18 |
|
| 19 |
+
# ------------- CHANNEL 2 --------------
|
| 20 |
+
echo "creating the storage folders for channel 2.."
|
| 21 |
+
mkdir -p $WEBTV_VIDEO_STORAGE_PATH_CHANNEL_2
|
| 22 |
+
mkdir -p $WEBTV_AUDIO_STORAGE_PATH_CHANNEL_2
|
| 23 |
+
|
| 24 |
+
echo "creating the playlists for channel 2.."
|
| 25 |
+
echo "ffconcat version 1.0" > channel_2_video_list_a.txt
|
| 26 |
+
echo "ffconcat version 1.0" > channel_2_video_list_b.txt
|
| 27 |
+
echo "ffconcat version 1.0" > channel_2_audio_list_a.txt
|
| 28 |
+
echo "ffconcat version 1.0" > channel_2_audio_list_b.txt
|
| 29 |
+
|
| 30 |
+
echo "file 'channel_2_video_list_b.txt'" >> channel_2_video_list_a.txt
|
| 31 |
+
echo "file 'channel_2_video_list_a.txt'" >> channel_2_video_list_b.txt
|
| 32 |
+
echo "file 'channel_2_audio_list_b.txt'" >> channel_2_audio_list_a.txt
|
| 33 |
+
echo "file 'channel_2_audio_list_a.txt'" >> channel_2_audio_list_b.txt
|
| 34 |
+
|
| 35 |
+
# maybe we will try that again in the future
|
| 36 |
+
# echo "create the named pipes.."
|
| 37 |
+
# mkfifo video.pipe
|
| 38 |
+
# mkfifo audio.pipe
|
scripts/stream.sh
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
#!/bin/bash
|
| 2 |
-
|
| 3 |
-
COUNT=0
|
| 4 |
-
|
| 5 |
-
echo "Starting final stream loop.."
|
| 6 |
-
while true; do
|
| 7 |
-
# if ((COUNT % 60 == 0)); then
|
| 8 |
-
# echo "--- video list_a.txt ---"
|
| 9 |
-
# cat list_a.txt
|
| 10 |
-
|
| 11 |
-
# #echo "--- audio_list_a.txt ---"
|
| 12 |
-
# #cat audio_list_a.txt
|
| 13 |
-
# fi
|
| 14 |
-
|
| 15 |
-
#sleep 1
|
| 16 |
-
|
| 17 |
-
# ((COUNT++))
|
| 18 |
-
|
| 19 |
-
# echo "Trying to create the final stream.."
|
| 20 |
-
ffmpeg -y -nostdin -re -f concat -safe 0 -i "list_a.txt" -loglevel error -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
|
| 21 |
-
# ffmpeg -y -nostdin -re -f concat -safe 0 -i "list_a.txt" -i "audio_list_a.txt" -loglevel error -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
|
| 22 |
-
|
| 23 |
-
# echo "Final stream got interrupted, will try again in 1 sec"
|
| 24 |
-
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scripts/stream1.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
COUNT=0
|
| 4 |
+
|
| 5 |
+
echo "Starting FFMPEG live stream for channel 1"
|
| 6 |
+
while true; do
|
| 7 |
+
# if ((COUNT % 60 == 0)); then
|
| 8 |
+
# echo "--- video channel_1_video_list_a.txt ---"
|
| 9 |
+
# cat channel_1_video_list_a.txt
|
| 10 |
+
|
| 11 |
+
# #echo "--- channel_1_audio_list_a.txt ---"
|
| 12 |
+
# #cat channel_1_audio_list_a.txt
|
| 13 |
+
# fi
|
| 14 |
+
|
| 15 |
+
#sleep 1
|
| 16 |
+
|
| 17 |
+
# ((COUNT++))
|
| 18 |
+
|
| 19 |
+
# echo "Trying to create the final stream fo channel 1.."
|
| 20 |
+
ffmpeg -y -nostdin -re -f concat -safe 0 -i "channel_1_video_list_a.txt" -loglevel error -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
|
| 21 |
+
# ffmpeg -y -nostdin -re -f concat -safe 0 -i "channel_1_video_list_a.txt" -i "channel_1_audio_list_a.txt" -loglevel error -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
|
| 22 |
+
|
| 23 |
+
# echo "Live stream for channel 1 got interrupted, will try again in 1 sec"
|
| 24 |
+
done
|
scripts/stream2.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
COUNT=0
|
| 4 |
+
|
| 5 |
+
echo "Starting FFMPEG live stream for channel 2"
|
| 6 |
+
while true; do
|
| 7 |
+
# if ((COUNT % 60 == 0)); then
|
| 8 |
+
# echo "--- video channel_2_video_list_a.txt ---"
|
| 9 |
+
# cat channel_2_video_list_a.txt
|
| 10 |
+
|
| 11 |
+
# #echo "--- channel_2_audio_list_a.txt ---"
|
| 12 |
+
# #cat channel_2_audio_list_a.txt
|
| 13 |
+
# fi
|
| 14 |
+
|
| 15 |
+
#sleep 1
|
| 16 |
+
|
| 17 |
+
# ((COUNT++))
|
| 18 |
+
|
| 19 |
+
# echo "Trying to create the final stream for channel 2.."
|
| 20 |
+
ffmpeg -y -nostdin -re -f concat -safe 0 -i "channel_2_video_list_a.txt" -loglevel error -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv2
|
| 21 |
+
# ffmpeg -y -nostdin -re -f concat -safe 0 -i "channel_2_video_list_a.txt" -i "channel_2_audio_list_a.txt" -loglevel error -c:v libx264 -preset veryfast -tune zerolatency -c:a aac -ar 44100 -f flv rtmp://localhost/live/webtv
|
| 22 |
+
|
| 23 |
+
# echo "Live stream for channel 2 got interrupted, will try again in 1 sec"
|
| 24 |
+
done
|
scripts/{video.sh → video1.sh}
RENAMED
|
@@ -1,32 +1,32 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
echo "Starting the video collection stream.."
|
| 4 |
-
echo "listing files in $
|
| 5 |
current_count=0
|
| 6 |
|
| 7 |
while true; do
|
| 8 |
-
new_count=$(ls $
|
| 9 |
|
| 10 |
if [ $new_count -ne $current_count ]; then
|
| 11 |
-
echo "there are $new_count videos files"
|
| 12 |
|
| 13 |
-
echo "Updating playlists
|
| 14 |
current_count=$new_count
|
| 15 |
-
files=($
|
| 16 |
|
| 17 |
# Re-create playlists
|
| 18 |
-
echo "ffconcat version 1.0" >
|
| 19 |
-
echo "ffconcat version 1.0" >
|
| 20 |
for (( i=0; i<${#files[@]}; i++ )); do
|
| 21 |
echo "file '${files[$i]}'"
|
| 22 |
if (( i%2 == 0 )); then
|
| 23 |
-
echo "file '${files[$i]}'" >>
|
| 24 |
else
|
| 25 |
-
echo "file '${files[$i]}'" >>
|
| 26 |
fi
|
| 27 |
done
|
| 28 |
-
echo "file './
|
| 29 |
-
echo "file './
|
| 30 |
fi
|
| 31 |
|
| 32 |
sleep 1
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
echo "Starting the video collection stream for channel 1.."
|
| 4 |
+
echo "listing files in $WEBTV_VIDEO_STORAGE_PATH_CHANNEL_1*.mp4"
|
| 5 |
current_count=0
|
| 6 |
|
| 7 |
while true; do
|
| 8 |
+
new_count=$(ls $WEBTV_VIDEO_STORAGE_PATH_CHANNEL_1*.mp4 2> /dev/null | wc -l)
|
| 9 |
|
| 10 |
if [ $new_count -ne $current_count ]; then
|
| 11 |
+
echo "there are $new_count videos files for channel 1"
|
| 12 |
|
| 13 |
+
echo "Updating playlists for channel 1.."
|
| 14 |
current_count=$new_count
|
| 15 |
+
files=($WEBTV_VIDEO_STORAGE_PATH_CHANNEL_1*.mp4)
|
| 16 |
|
| 17 |
# Re-create playlists
|
| 18 |
+
echo "ffconcat version 1.0" > channel_1_video_list_a.txt
|
| 19 |
+
echo "ffconcat version 1.0" > channel_1_video_list_b.txt
|
| 20 |
for (( i=0; i<${#files[@]}; i++ )); do
|
| 21 |
echo "file '${files[$i]}'"
|
| 22 |
if (( i%2 == 0 )); then
|
| 23 |
+
echo "file '${files[$i]}'" >> channel_1_video_list_a.txt
|
| 24 |
else
|
| 25 |
+
echo "file '${files[$i]}'" >> channel_1_video_list_b.txt
|
| 26 |
fi
|
| 27 |
done
|
| 28 |
+
echo "file './channel_1_video_list_b.txt'" >> channel_1_video_list_a.txt
|
| 29 |
+
echo "file './channel_1_video_list_a.txt'" >> channel_1_video_list_b.txt
|
| 30 |
fi
|
| 31 |
|
| 32 |
sleep 1
|
scripts/video2.sh
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
echo "Starting the video collection stream for channel 2.."
|
| 4 |
+
echo "listing files in $WEBTV_VIDEO_STORAGE_PATH_CHANNEL_2*.mp4"
|
| 5 |
+
current_count=0
|
| 6 |
+
|
| 7 |
+
while true; do
|
| 8 |
+
new_count=$(ls $WEBTV_VIDEO_STORAGE_PATH_CHANNEL_2*.mp4 2> /dev/null | wc -l)
|
| 9 |
+
|
| 10 |
+
if [ $new_count -ne $current_count ]; then
|
| 11 |
+
echo "there are $new_count videos files for channel 2"
|
| 12 |
+
|
| 13 |
+
echo "Updating playlists for channel 2.."
|
| 14 |
+
current_count=$new_count
|
| 15 |
+
files=($WEBTV_VIDEO_STORAGE_PATH_CHANNEL_2*.mp4)
|
| 16 |
+
|
| 17 |
+
# Re-create playlists
|
| 18 |
+
echo "ffconcat version 1.0" > channel_2_video_list_a.txt
|
| 19 |
+
echo "ffconcat version 1.0" > channel_2_video_list_b.txt
|
| 20 |
+
for (( i=0; i<${#files[@]}; i++ )); do
|
| 21 |
+
echo "file '${files[$i]}'"
|
| 22 |
+
if (( i%2 == 0 )); then
|
| 23 |
+
echo "file '${files[$i]}'" >> channel_2_video_list_a.txt
|
| 24 |
+
else
|
| 25 |
+
echo "file '${files[$i]}'" >> channel_2_video_list_b.txt
|
| 26 |
+
fi
|
| 27 |
+
done
|
| 28 |
+
echo "file './channel_2_video_list_b.txt'" >> channel_2_video_list_a.txt
|
| 29 |
+
echo "file './channel_2_video_list_a.txt'" >> channel_2_video_list_b.txt
|
| 30 |
+
fi
|
| 31 |
+
|
| 32 |
+
sleep 1
|
| 33 |
+
done
|
start.sh
CHANGED
|
@@ -11,15 +11,18 @@ node ./media-server.js &
|
|
| 11 |
sleep 1
|
| 12 |
|
| 13 |
# background process that creates an audio stream from audio files
|
| 14 |
-
# bash scripts/
|
|
|
|
| 15 |
|
| 16 |
# background process that creates a video stream from video files
|
| 17 |
-
bash scripts/
|
|
|
|
| 18 |
|
| 19 |
sleep 1
|
| 20 |
|
| 21 |
# background process that sends data to the media server
|
| 22 |
-
bash scripts/
|
|
|
|
| 23 |
|
| 24 |
sleep 1
|
| 25 |
|
|
|
|
| 11 |
sleep 1
|
| 12 |
|
| 13 |
# background process that creates an audio stream from audio files
|
| 14 |
+
# bash scripts/audio1.sh &
|
| 15 |
+
# bash scripts/audio2.sh &
|
| 16 |
|
| 17 |
# background process that creates a video stream from video files
|
| 18 |
+
bash scripts/video1.sh &
|
| 19 |
+
bash scripts/video2.sh &
|
| 20 |
|
| 21 |
sleep 1
|
| 22 |
|
| 23 |
# background process that sends data to the media server
|
| 24 |
+
bash scripts/stream1.sh &
|
| 25 |
+
bash scripts/stream2.sh &
|
| 26 |
|
| 27 |
sleep 1
|
| 28 |
|