From 01f60c5d3e1dabfe14ad1405e61255788b4a8a28 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 9 Apr 2024 00:50:51 +0200 Subject: streaming/mpv-headless: start mpv with --idle and use json IPC to control it - this way the output resolution is automatically maintained by mpv (aka no video= kernel command line option needed) --- roles/streaming/mpv-headless/templates/ssh-forced.sh.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'roles/streaming/mpv-headless/templates') diff --git a/roles/streaming/mpv-headless/templates/ssh-forced.sh.j2 b/roles/streaming/mpv-headless/templates/ssh-forced.sh.j2 index 777f0b32..35e9571e 100644 --- a/roles/streaming/mpv-headless/templates/ssh-forced.sh.j2 +++ b/roles/streaming/mpv-headless/templates/ssh-forced.sh.j2 @@ -15,14 +15,14 @@ case "$command" in play) media_file="/srv/media/$(basename "$arg")" if [ -e "$media_file" ]; then - exec ./play "$media_file" + echo '{"command": ["loadfile", "'"$media_file"'"]}' | socat - /var/lib/player/ctl.sock else echo "file '$media_file' not found!" exit 1 fi ;; stop) - killall mpv + echo '{"command": ["playlist-remove", "current"]}' | socat - /var/lib/player/ctl.sock ;; *) echo "invalid command: '$command'" -- cgit v1.2.3