diff options
Diffstat (limited to '')
-rwxr-xr-x | roles/obs/templates/mpv-track | 24 |
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 $* & |