summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/streaming/player/defaults/main.yml5
-rw-r--r--roles/streaming/player/tasks/main.yml8
-rw-r--r--roles/streaming/player/templates/pod-spec.yml.j239
3 files changed, 52 insertions, 0 deletions
diff --git a/roles/streaming/player/defaults/main.yml b/roles/streaming/player/defaults/main.yml
new file mode 100644
index 00000000..280aa2ea
--- /dev/null
+++ b/roles/streaming/player/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+# player_inst_name: feed
+# player_ffmpeg_image_version: bullseye-decklink11.7-2022-06-12.26
+# player_input: [ '-f', 'live_flv', '-rtmp_live', 'live', '-i', 'rtmp://192.0.2.1/feed/full' ]
+# player_output: [ '-pix_fmt', 'uyvy422', '-s', '1920x1080', '-filter:v', 'fps=fps=25', '-top', '1', '-flags:v', '+ilme+ildct', '-f', 'decklink', 'DeckLink SDI' ]
diff --git a/roles/streaming/player/tasks/main.yml b/roles/streaming/player/tasks/main.yml
new file mode 100644
index 00000000..68e8ec2f
--- /dev/null
+++ b/roles/streaming/player/tasks/main.yml
@@ -0,0 +1,8 @@
+---
+- name: install pod manifest
+ vars:
+ kubernetes_standalone_pod:
+ name: "player-{{ player_inst_name }}"
+ spec: "{{ lookup('template', 'pod-spec.yml.j2') }}"
+ include_role:
+ name: kubernetes/standalone/pod
diff --git a/roles/streaming/player/templates/pod-spec.yml.j2 b/roles/streaming/player/templates/pod-spec.yml.j2
new file mode 100644
index 00000000..a4eff23f
--- /dev/null
+++ b/roles/streaming/player/templates/pod-spec.yml.j2
@@ -0,0 +1,39 @@
+containers:
+- name: player
+ image: registry.gitlab.com/spreadspace/docker/ffmpeg:{{ player_ffmpeg_image_version }}
+ imagePullPolicy: Always
+ command:
+ - /usr/bin/ffmpeg
+ args:
+{% for param in player_input %}
+ - '{{ param }}'
+{% endfor %}
+{% for param in player_output %}
+ - '{{ param }}'
+{% endfor %}
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - name: decklink-device
+ mountPath: /dev/blackmagic
+ - name: decklink-libs
+ subPath: libDeckLinkAPI.so
+ mountPath: /usr/lib/libDeckLinkAPI.so
+ readOnly: true
+ - name: decklink-libs
+ subPath: libDeckLinkPreviewAPI.so
+ mountPath: /usr/lib/libDeckLinkPreviewAPI.so
+ readOnly: true
+ - name: decklink-libs
+ subPath: blackmagic
+ mountPath: /usr/lib/blackmagic
+ readOnly: true
+
+volumes:
+- name: decklink-device
+ hostPath:
+ path: /dev/blackmagic
+- name: decklink-libs
+ hostPath:
+ type: Directory
+ path: /usr/lib/