summaryrefslogtreecommitdiff
path: root/roles/streaming/rtmp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-01 00:48:36 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-01 00:48:36 +0200
commiteced6ae0d36b49a811fdf44295b741d1fbe71a61 (patch)
treed78ff44f34106f30446baf5349b4c72d57df9842 /roles/streaming/rtmp
parentjitsi/meet: make p2p mode configureable (diff)
rtmp streamer: add forwarding and use this for glt21 encoder
Diffstat (limited to 'roles/streaming/rtmp')
-rw-r--r--roles/streaming/rtmp/streamer/defaults/main.yml5
-rw-r--r--roles/streaming/rtmp/streamer/templates/pod-spec.yml.j224
2 files changed, 28 insertions, 1 deletions
diff --git a/roles/streaming/rtmp/streamer/defaults/main.yml b/roles/streaming/rtmp/streamer/defaults/main.yml
index 27b18cbf..fc9f644f 100644
--- a/roles/streaming/rtmp/streamer/defaults/main.yml
+++ b/roles/streaming/rtmp/streamer/defaults/main.yml
@@ -12,4 +12,9 @@ rtmp_streamer_quality_levels:
rtmp_streamer_recording_enabled: no
rtmp_streamer_recording_level: full
+rtmp_streamer_forwards: {}
+# example:
+# url: rtmp://ingest.example.com/foo/secret
+# level: full
+
rtmp_streamer_config: {}
diff --git a/roles/streaming/rtmp/streamer/templates/pod-spec.yml.j2 b/roles/streaming/rtmp/streamer/templates/pod-spec.yml.j2
index f670fb25..ec51ed14 100644
--- a/roles/streaming/rtmp/streamer/templates/pod-spec.yml.j2
+++ b/roles/streaming/rtmp/streamer/templates/pod-spec.yml.j2
@@ -19,7 +19,7 @@ containers:
- name: nginx-lib
mountPath: /var/lib/nginx
-- name: ffmpeg
+- name: source
image: registry.gitlab.com/spreadspace/docker/nginx:{{ rtmp_streamer_nginx_image_version }}
imagePullPolicy: Always
command:
@@ -53,6 +53,28 @@ containers:
- name: CONFIG_FILENAME
value: /srv/config.yml
+{% for name, forward in rtmp_streamer_forwards.items() %}
+- name: "forward-{{ name }}"
+ image: registry.gitlab.com/spreadspace/docker/nginx:{{ rtmp_streamer_nginx_image_version }}
+ imagePullPolicy: Always
+ command:
+ - /usr/bin/ffmpeg
+ args:
+ - -f
+ - live_flv
+ - -rtmp_live
+ - live
+ - -i
+ - "rtmp://127.0.0.1/{{ rtmp_streamer_app_name }}/{{ forward.level }}"
+ - -c:a
+ - copy
+ - -c:v
+ - copy
+ - -f
+ - flv
+ - "{{ forward.url }}"
+
+{% endfor %}
{% if rtmp_streamer_recording_enabled %}
- name: record
image: registry.gitlab.com/spreadspace/docker/nginx:{{ rtmp_streamer_nginx_image_version }}