diff --git a/bundlewrap/bundles/loudness-rendering/files/loudness.sh b/bundlewrap/bundles/loudness-rendering/files/loudness.sh index 48698f04..bc776887 100644 --- a/bundlewrap/bundles/loudness-rendering/files/loudness.sh +++ b/bundlewrap/bundles/loudness-rendering/files/loudness.sh @@ -5,7 +5,6 @@ NAME="$1" SOURCE="$2" OUTPUT="$3" -ROOM="$4" set -uo pipefail @@ -18,6 +17,7 @@ fi mkdir -p "/opt/loudness-rendering/data/${NAME}" touch "/opt/loudness-rendering/data/${NAME}/line1.txt" touch "/opt/loudness-rendering/data/${NAME}/line2.txt" +touch "/opt/loudness-rendering/data/${NAME}/line3.txt" /usr/local/sbin/voc2alert "info" "loudness/${NAME}" "Loudness monitoring started ..." @@ -39,7 +39,7 @@ ffmpeg \ [ov] drawtext='fontcolor=white:x=45:y=36:fontsize=50:fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:textfile=/opt/loudness-rendering/data/${NAME}/line1.txt:reload=30' [ov1]; [ov1] drawtext='fontcolor=white:x=45:y=86:fontsize=20:fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:textfile=/opt/loudness-rendering/data/${NAME}/line2.txt:reload=30' [ov2]; [ov2] drawtext='fontcolor=white:x=45:y=111:fontsize=20:fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:text=${NAME}' [ov3]; - [ov3] drawtext='fontcolor=white:x=45:y=303:fontsize=50:fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:text=${ROOM}' [out]" \ + [ov3] drawtext='fontcolor=white:x=45:y=303:fontsize=50:fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:textfile=/opt/loudness-rendering/data/${NAME}/line3.txt:reload=30' [out]" \ -map "[out]" -c:v libx264 -threads 2 -preset veryfast -x264-params keyint=30 -tune zerolatency -crf:0 26 -profile:0 high -level:0 4.1 -strict -2 -pix_fmt yuv420p \ -map "[audio]" -c:a aac -b:a 128k \ -f flv \ diff --git a/bundlewrap/bundles/loudness-rendering/files/service b/bundlewrap/bundles/loudness-rendering/files/service index 77e0f874..13aba6f8 100644 --- a/bundlewrap/bundles/loudness-rendering/files/service +++ b/bundlewrap/bundles/loudness-rendering/files/service @@ -6,7 +6,7 @@ After=network.target Type=simple User=voc Group=voc -ExecStart=/usr/local/bin/loudness_rendering "${identifier}" "${source_url}" "${output}" "${room_name}" +ExecStart=/usr/local/bin/loudness_rendering "${identifier}" "${source_url}" "${output}" Restart=always RestartSec=10 StartLimitInterval=0 diff --git a/bundlewrap/bundles/loudness-rendering/files/updater.py b/bundlewrap/bundles/loudness-rendering/files/updater.py index 55847d16..dae2b019 100644 --- a/bundlewrap/bundles/loudness-rendering/files/updater.py +++ b/bundlewrap/bundles/loudness-rendering/files/updater.py @@ -79,7 +79,10 @@ with open(os.path.join(DATA_DIR, stream, 'line2.txt.tmp'), 'w+') as f: f.write(' - '.join(line2)) - for i in ('line1', 'line2'): + with open(os.path.join(DATA_DIR, stream, 'line3.txt.tmp'), 'w+') as f: + f.write(config['streams'][stream]['room']) + + for i in ('line1', 'line2', 'line3'): os.replace( os.path.join(DATA_DIR, stream, f'{i}.txt.tmp'), os.path.join(DATA_DIR, stream, f'{i}.txt'), diff --git a/bundlewrap/bundles/loudness-rendering/items.py b/bundlewrap/bundles/loudness-rendering/items.py index ce7f76c8..52000698 100644 --- a/bundlewrap/bundles/loudness-rendering/items.py +++ b/bundlewrap/bundles/loudness-rendering/items.py @@ -23,7 +23,6 @@ 'source': 'service', 'content_type': 'mako', 'context': { - 'room_name': config['room'], 'source_url': config['source'], 'identifier': stream, 'output': config['output'],