summaryrefslogtreecommitdiffstats
path: root/roles/obs/templates/mpv-track
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-08 12:00:47 -0500
committerSacha Chua <sacha@sachachua.com>2022-11-08 12:00:47 -0500
commitc2d647a3cb3a6d456684bcdce327954214352959 (patch)
tree4fe8bf78b9ef868453bb974758856b2c19c20830 /roles/obs/templates/mpv-track
parent5bf4ab50e13a9be2923ddebe69525b40df8ab3bc (diff)
downloademacsconf-ansible-c2d647a3cb3a6d456684bcdce327954214352959.tar.xz
emacsconf-ansible-c2d647a3cb3a6d456684bcdce327954214352959.zip
Update edit and publish configs, tweak OBS, add Mumble client
Diffstat (limited to 'roles/obs/templates/mpv-track')
-rwxr-xr-xroles/obs/templates/mpv-track24
1 files changed, 23 insertions, 1 deletions
diff --git a/roles/obs/templates/mpv-track b/roles/obs/templates/mpv-track
index ee359f1..b6d6d67 100755
--- a/roles/obs/templates/mpv-track
+++ b/roles/obs/templates/mpv-track
@@ -2,4 +2,26 @@
# Run MPV with the output set to the right sink and with an IPC socket
# {{ ansible_managed }}
-DISPLAY="${DISPLAY:-:{{ item.vnc_id }}}" mpv --input-ipc-server={{ emacsconf_home }}/mpv-socket-{{ emacsconf_id }}-{{ item.id }} --audio-device=pulse/{{ item.id }}-vid --profile={{ emacsconf_id }}-talks $* &
+# Update the overlay
+FILE=$1
+if [[ ! -f $FILE ]]; then
+ FILE="/data/emacsconf/assets/stream/emacsconf-2022-$FILE*.webm"
+fi
+shift
+SLUG=$(echo "$FILE" | perl -ne 'if (/^emacsconf-[0-9]*-(.*?)--/) { print $1; } else { print; }')
+if [[ -f /data/emacsconf/assets/overlays/$SLUG-other.png ]]; then
+ echo "Found other overlay for $SLUG, copying"
+ cp /data/emacsconf/assets/overlays/$SLUG-other.png ~/other.png
+else
+ echo "Could not find /data/emacsconf/assets/overlays/$SLUG-other.png, please override ~/other.png manually"
+ cp /data/emacsconf/assets/overlays/blank-other.png ~/other.png
+fi
+if [[ -f /data/emacsconf/assets/overlays/$SLUG-video.png ]]; then
+ echo "Found video overlay for $SLUG, copying"
+ cp /data/emacsconf/assets/overlays/$SLUG-video.png ~/video.png
+else
+ echo "Could not find /data/emacsconf/assets/overlays/$SLUG-video.png, override ~/video.png manually"
+ cp /data/emacsconf/assets/overlays/blank-video.png ~/video.png
+fi
+# Play the video
+DISPLAY="${DISPLAY:-:{{ item.vnc_id }}}" mpv --input-ipc-server={{ emacsconf_home }}/mpv-socket-{{ emacsconf_id }}-{{ item.id }} --audio-device=pulse/{{ item.id }}-vid --profile={{ emacsconf_id }}-talks $FILE $* &