jbilcke-hf HF staff commited on
Commit
0b2f8ce
β€’
1 Parent(s): 7e58471

added channel 2

Browse files
database.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "version": 1,
3
- "startAtShotId": "8580722a-3b39-4a9e-a025-df34b797bddd",
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 $WEBTV_AUDIO_STORAGE_PATH*.mp3 2> /dev/null | wc -l)
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=($WEBTV_AUDIO_STORAGE_PATH*.mp3)
15
 
16
  # Re-create the audio playlists
17
- echo "ffconcat version 1.0" > audio_list_a.txt
18
- echo "ffconcat version 1.0" > audio_list_b.txt
19
  for (( i=0; i<${#files[@]}; i++ )); do
20
  if (( i%2 == 0 )); then
21
- echo "file '${files[$i]}'" >> audio_list_a.txt
22
  else
23
- echo "file '${files[$i]}'" >> audio_list_b.txt
24
  fi
25
  done
26
- echo "file 'audio_list_b.txt'" >> audio_list_a.txt
27
- echo "file 'audio_list_a.txt'" >> audio_list_b.txt
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
- echo "creating the storage folders.."
4
- mkdir -p $WEBTV_VIDEO_STORAGE_PATH
5
- mkdir -p $WEBTV_VIDEO_STORAGE_PATH_NEXT
6
- mkdir -p $WEBTV_AUDIO_STORAGE_PATH
7
 
8
- echo "creating the playlists.."
9
- echo "ffconcat version 1.0" > list_a.txt
10
- echo "ffconcat version 1.0" > list_b.txt
11
- echo "ffconcat version 1.0" > audio_list_a.txt
12
- echo "ffconcat version 1.0" > audio_list_b.txt
13
 
14
- echo "file 'list_b.txt'" >> list_a.txt
15
- echo "file 'list_a.txt'" >> list_b.txt
16
- echo "file 'audio_list_b.txt'" >> audio_list_a.txt
17
- echo "file 'audio_list_a.txt'" >> audio_list_b.txt
18
 
19
- echo "create the named pipes.."
20
- mkfifo video.pipe
21
- mkfifo audio.pipe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 $WEBTV_VIDEO_STORAGE_PATH*.mp4"
5
  current_count=0
6
 
7
  while true; do
8
- new_count=$(ls $WEBTV_VIDEO_STORAGE_PATH*.mp4 2> /dev/null | wc -l)
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=($WEBTV_VIDEO_STORAGE_PATH*.mp4)
16
 
17
  # Re-create playlists
18
- echo "ffconcat version 1.0" > list_a.txt
19
- echo "ffconcat version 1.0" > 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]}'" >> list_a.txt
24
  else
25
- echo "file '${files[$i]}'" >> list_b.txt
26
  fi
27
  done
28
- echo "file './list_b.txt'" >> list_a.txt
29
- echo "file './list_a.txt'" >> list_b.txt
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/audio.sh &
 
15
 
16
  # background process that creates a video stream from video files
17
- bash scripts/video.sh &
 
18
 
19
  sleep 1
20
 
21
  # background process that sends data to the media server
22
- bash scripts/stream.sh &
 
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