-
Notifications
You must be signed in to change notification settings - Fork 12
/
streaming-sink-mkvonly.sh.j2
56 lines (54 loc) · 1.72 KB
/
streaming-sink-mkvonly.sh.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
ffmpeg -y -nostdin -hide_banner \
{# input from both mix-out and slide-mirror #}
-thread_queue_size 512 -i tcp://localhost:15000?timeout=3000000 \
{% if voctomix.parallel_slide_recording %}
-thread_queue_size 512 -i tcp://localhost:15001?timeout=3000000 \
{% endif %}
-filter_complex '
[0:v] hqdn3d [smooth_hd];
movie=/opt/voc/share/overlay_hd.png [logo_hd];
[smooth_hd] [logo_hd] overlay=0:0 [hd]
{% if voctomix.parallel_slide_recording %}
;
[1:v] scale=1024:576, fps=5, hqdn3d [smooth_slides];
movie=/opt/voc/share/overlay_slides.png [logo_slides];
[smooth_slides] [logo_slides] overlay=0:0 [slides]
{% endif %}
' \
{# Shared video settings #}
-c:v libx264 -preset:v veryfast -profile:v main -pix_fmt yuv420p -flags +cgop \
-threads:v 0 -aspect 16:9 \
\
{# High bitrate and high quality for HD #}
-map [hd] -metadata:s:v:0 title="HD" \
-r:v:0 25 -g:v:0 75 -crf:v:0 21 -maxrate:v:0 4M -bufsize:v:0 18M \
\
{% if voctomix.parallel_slide_recording %}
{# Low bitrate and ok quality for Slides #}
-map [slides] -metadata:s:v:1 title="Slides" \
-g:v:1 15 -crf:v:1 25 -maxrate:v:1 100k -bufsize:v:1 750k \
\
{% endif %}
{# Shared audio settings #}
-c:a aac -b:a 192k -ar 48000 -ac 1 \
\
{# Encode audio #}
{% if voctomix_stream_suppress_audio_tracks %}
{% for n in range(voctomix_audiostreams) %}
{% if n not in voctomix_stream_suppress_audio_tracks %}
-map 0:a:{{ n }} \
{% endif %}
{% endfor %}
{% else %}
-map 0:a \
{% endif %}
\
-f matroska \
-password {{ lookup('keepass', 'ansible/icecast/icedist/source.password') }} \
-content_type video/webm \
{% if streaming_endpoint_pulling %}
icecast://127.0.0.1:7999/{{ streaming_endpoint }}
{% else %}
icecast://live.ber.c3voc.de:7999/{{ streaming_endpoint }}
{% endif %}