From 7cb3c57f38bc612afc719ac08253c5de2dd3c3e5 Mon Sep 17 00:00:00 2001 From: Sten Laane <21343173+StenAL@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:54:29 +0200 Subject: [PATCH] Docker: Respect SE_SCREEN_{WIDTH,HEIGHT} variables in ffmpeg recording Currently, these variables are always overridden in the call the wait_for_display(). Before the upgrade to ffmpeg-7.0.2 (PR #2374), the SE_SCREEN_WIDTH and SE_SCREEN_HEIGHT variables were respected in the case where no video uploading was done because wait_for_display() was never called. After the upgrade to 7.0.2, it the function is always called and overrides the VIDEO_SIZE variable. Now, if both screen width and height are specified, the VIDEO_SIZE is not overridden and users can control the recording size again. --- Video/Dockerfile | 2 -- Video/video.sh | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Video/Dockerfile b/Video/Dockerfile index 991c5f42c0..18abd49168 100644 --- a/Video/Dockerfile +++ b/Video/Dockerfile @@ -41,8 +41,6 @@ ENV DISPLAY_NUM="99" \ SE_AUDIO_SOURCE="-f pulse -ac 2 -i default" \ SE_SERVER_PROTOCOL="http" \ SE_VIDEO_POLL_INTERVAL="1" \ - SE_SCREEN_WIDTH="1920" \ - SE_SCREEN_HEIGHT="1080" \ SE_FRAME_RATE="15" \ SE_CODEC="libx264" \ SE_PRESET="-preset ultrafast" \ diff --git a/Video/video.sh b/Video/video.sh index 2901f82b47..6413e69a8a 100755 --- a/Video/video.sh +++ b/Video/video.sh @@ -71,7 +71,9 @@ function wait_for_display() { until xset b off >/dev/null 2>&1; do sleep ${poll_interval} done - VIDEO_SIZE=$(xdpyinfo | grep 'dimensions:' | awk '{print $2}') + if [ -z "$SE_SCREEN_WIDTH" -o -z "$SE_SCREEN_HEIGHT" ]; then + VIDEO_SIZE=$(xdpyinfo | grep 'dimensions:' | awk '{print $2}') + fi echo "$(date -u +"${ts_format}") [${process_name}] - Display ${DISPLAY} is open with dimensions ${VIDEO_SIZE}" }