From eced6ae0d36b49a811fdf44295b741d1fbe71a61 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 1 Apr 2021 00:48:36 +0200 Subject: rtmp streamer: add forwarding and use this for glt21 encoder --- inventory/host_vars/glt-calypso.yml | 1 + inventory/host_vars/glt-datacop.yml | 1 + inventory/host_vars/glt-dione.yml | 14 ++++++++++ inventory/host_vars/glt-helene.yml | 14 ++++++++++ inventory/host_vars/glt-telesto.yml | 1 + inventory/host_vars/glt-thetys.yml | 14 ++++++++++ roles/streaming/rtmp/streamer/defaults/main.yml | 5 ++++ .../rtmp/streamer/templates/pod-spec.yml.j2 | 24 +++++++++++++++- spreadspace/glt-dione.yml | 2 +- spreadspace/glt-helene.yml | 2 +- spreadspace/glt-thetys.yml | 2 +- spreadspace/group_vars/glt-live.yml | 32 +++++++++++++--------- 12 files changed, 95 insertions(+), 17 deletions(-) diff --git a/inventory/host_vars/glt-calypso.yml b/inventory/host_vars/glt-calypso.yml index 60b57644..50fa89dc 100644 --- a/inventory/host_vars/glt-calypso.yml +++ b/inventory/host_vars/glt-calypso.yml @@ -43,6 +43,7 @@ apt_repo_components: blackmagic_desktopvideo_version: 11.7a12 +blackmagic_desktopvideo_include_gui: yes docker_pkg_provider: docker-com docker_pkg_name: docker-ce diff --git a/inventory/host_vars/glt-datacop.yml b/inventory/host_vars/glt-datacop.yml index b8fad4ba..1e73c967 100644 --- a/inventory/host_vars/glt-datacop.yml +++ b/inventory/host_vars/glt-datacop.yml @@ -42,6 +42,7 @@ apt_repo_components: blackmagic_desktopvideo_version: 11.7a12 +blackmagic_desktopvideo_include_gui: yes docker_pkg_provider: docker-com docker_pkg_name: docker-ce diff --git a/inventory/host_vars/glt-dione.yml b/inventory/host_vars/glt-dione.yml index 3200c315..6cb1afe7 100644 --- a/inventory/host_vars/glt-dione.yml +++ b/inventory/host_vars/glt-dione.yml @@ -43,6 +43,7 @@ apt_repo_components: blackmagic_desktopvideo_version: 11.7a12 +blackmagic_desktopvideo_include_gui: yes docker_pkg_provider: docker-com docker_pkg_name: docker-ce @@ -63,3 +64,16 @@ kubernetes_version: 1.20.5 kubernetes_container_runtime: docker kubernetes_standalone_max_pods: 42 kubernetes_standalone_cni_variant: with-portmap + +rtmp_streamer_base_path: /srv/streamer +rtmp_streamer_inst_name: feed +rtmp_streamer_nginx_image_version: 2021-02-24.20 +rtmp_streamer_decklink_card: "DeckLink 8K Pro (1)" +rtmp_streamer_config: + input_params: ['-f', 'decklink', '-video_input', 'sdi', '-format_code', 'Hp25', '-ac', '2', '-i'] + +rtmp_streamer_recording_enabled: no +rtmp_streamer_forwards: + c3voc: + url: "rtmp://ingest.c3voc.de/stream/glt21s2?auth={{ vault_rtmp_streamer_forward_keys.c3voc.glt21s2 }}" + level: full diff --git a/inventory/host_vars/glt-helene.yml b/inventory/host_vars/glt-helene.yml index 87472a62..1ae03afe 100644 --- a/inventory/host_vars/glt-helene.yml +++ b/inventory/host_vars/glt-helene.yml @@ -43,6 +43,7 @@ apt_repo_components: blackmagic_desktopvideo_version: 11.7a12 +blackmagic_desktopvideo_include_gui: yes docker_pkg_provider: docker-com docker_pkg_name: docker-ce @@ -63,3 +64,16 @@ kubernetes_version: 1.20.5 kubernetes_container_runtime: docker kubernetes_standalone_max_pods: 42 kubernetes_standalone_cni_variant: with-portmap + +rtmp_streamer_base_path: /srv/streamer +rtmp_streamer_inst_name: feed +rtmp_streamer_nginx_image_version: 2021-02-24.20 +rtmp_streamer_decklink_card: "DeckLink SDI 4K" +rtmp_streamer_config: + input_params: ['-f', 'decklink', '-format_code', 'Hp25', '-ac', '2', '-i'] + +rtmp_streamer_recording_enabled: no +rtmp_streamer_forwards: + c3voc: + url: "rtmp://ingest.c3voc.de/stream/glt21s3?auth={{ vault_rtmp_streamer_forward_keys.c3voc.glt21s3 }}" + level: full diff --git a/inventory/host_vars/glt-telesto.yml b/inventory/host_vars/glt-telesto.yml index 99c6a554..43485541 100644 --- a/inventory/host_vars/glt-telesto.yml +++ b/inventory/host_vars/glt-telesto.yml @@ -43,6 +43,7 @@ apt_repo_components: blackmagic_desktopvideo_version: 11.7a12 +blackmagic_desktopvideo_include_gui: yes docker_pkg_provider: docker-com docker_pkg_name: docker-ce diff --git a/inventory/host_vars/glt-thetys.yml b/inventory/host_vars/glt-thetys.yml index 43fac512..f6e37e41 100644 --- a/inventory/host_vars/glt-thetys.yml +++ b/inventory/host_vars/glt-thetys.yml @@ -42,6 +42,7 @@ apt_repo_components: blackmagic_desktopvideo_version: 11.7a12 +blackmagic_desktopvideo_include_gui: yes docker_pkg_provider: docker-com docker_pkg_name: docker-ce @@ -62,3 +63,16 @@ kubernetes_version: 1.20.5 kubernetes_container_runtime: docker kubernetes_standalone_max_pods: 42 kubernetes_standalone_cni_variant: with-portmap + +rtmp_streamer_base_path: /srv/streamer +rtmp_streamer_inst_name: feed +rtmp_streamer_nginx_image_version: 2021-02-24.20 +rtmp_streamer_decklink_card: "DeckLink Mini Recorder" +rtmp_streamer_config: + input_params: ['-f', 'decklink', '-video_input', 'sdi', '-format_code', 'Hp25', '-ac', '2', '-i'] + +rtmp_streamer_recording_enabled: no +rtmp_streamer_forwards: + c3voc: + url: "rtmp://ingest.c3voc.de/stream/glt21s1?auth={{ vault_rtmp_streamer_forward_keys.c3voc.glt21s1 }}" + level: full 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 }} diff --git a/spreadspace/glt-dione.yml b/spreadspace/glt-dione.yml index a13799b5..3c895836 100644 --- a/spreadspace/glt-dione.yml +++ b/spreadspace/glt-dione.yml @@ -12,7 +12,7 @@ - role: streaming/blackmagic/desktopvideo - role: kubernetes/base - role: kubernetes/standalone/base - #- role: streaming/rtmp/streamer + - role: streaming/rtmp/streamer post_tasks: - name: install lm-sensors and i7z apt: diff --git a/spreadspace/glt-helene.yml b/spreadspace/glt-helene.yml index 13b3aeac..87a8910e 100644 --- a/spreadspace/glt-helene.yml +++ b/spreadspace/glt-helene.yml @@ -12,7 +12,7 @@ - role: streaming/blackmagic/desktopvideo - role: kubernetes/base - role: kubernetes/standalone/base - #- role: streaming/rtmp/streamer + - role: streaming/rtmp/streamer post_tasks: - name: install lm-sensors and i7z apt: diff --git a/spreadspace/glt-thetys.yml b/spreadspace/glt-thetys.yml index 57c8c2f7..2ad32db6 100644 --- a/spreadspace/glt-thetys.yml +++ b/spreadspace/glt-thetys.yml @@ -12,7 +12,7 @@ - role: streaming/blackmagic/desktopvideo - role: kubernetes/base - role: kubernetes/standalone/base - #- role: streaming/rtmp/streamer + - role: streaming/rtmp/streamer post_tasks: - name: install lm-sensors and i7z apt: diff --git a/spreadspace/group_vars/glt-live.yml b/spreadspace/group_vars/glt-live.yml index ab299151..22f76510 100644 --- a/spreadspace/group_vars/glt-live.yml +++ b/spreadspace/group_vars/glt-live.yml @@ -1,14 +1,20 @@ $ANSIBLE_VAULT;1.2;AES256;spreadspace -38643838613730663635376536663830656363333938613762626664623433653562343136373937 -6530343131383835363835353065393165613831343334310a633965623230333430353831393661 -36336663663564383536383939623965363063616366646465663234376631323638643130643030 -6436383635373632620a646439363339353565306164326339383864343731616131373632313630 -66633263396262356264646534353535383533386633373035653462353064353131323237326136 -30396162386365306362396430313064343935373535386237616631626437333263303832653562 -63626561653031326635343230383131646163626661393439313732386232623661653335656537 -61393236323663363038653231393937643464666463633562383034356337643135633832306636 -30636564313966383037396135323062336435336434313735616334616261363137336165663237 -66303636616664623134623035313530393437396165396330383232346265386537316238343662 -39636236626536326636366234663430616536643264623236656630633030623332373436646433 -61643763396132313035616339346435646235666232353864323564376461613532363137353862 -3830 +62343938663563626336646661646632343862643634616437346133643835323262333031373862 +6136383265343132386434316536303563623434353565340a353163663561396537356664323335 +65353135363133643362376238326132616130353261623431353530653762623266383464386561 +3639353231373831390a613537306465353664643661343362656539396538666432363066363861 +32316336663633663261356230653338616635353333663338386630363534646634663565613838 +37666463333737373637653230633663633733653934653836626261373761383061633535623063 +31623238633839373433313566646439336165323538383432653232663832356139353436636637 +66356165663833653931363338633965366230633035323862366439643565646139333535323265 +61316163313630653735666230346362366238656633396239313030326632333035636234363939 +34636638633039626264616266656363353363363063336531326333356438636363303161376438 +33306636303634313961616531353234376335366436303764653364623836613934356434346266 +30666132666163613735333934623537336463373039663964346564353434306133663635343538 +37383864623239373634636561356632306266646531636530356236346139333061633533613330 +64336662636363616138383532383064313331373336383862383034643764303130653130346334 +31326461666163346237336165376662666434306265333633373064363136313833343830373266 +65623333636137376138336531306331393164366639343638666564316166646131356464666664 +62303837393637313739346664363066326631646630376665326431306461316630323133323264 +32653663366165643564323436666134363666663039626666383737323237346466303436353237 +376533613362323531643062356532633934 -- cgit v1.2.3