Skip to content

Commit 43e4543

Browse files
authored
Docker: Respect SE_SCREEN_{WIDTH,HEIGHT} variables in ffmpeg recording (#2629)
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.
1 parent 3fd6392 commit 43e4543

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Video/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ ENV DISPLAY_NUM="99" \
4141
SE_AUDIO_SOURCE="-f pulse -ac 2 -i default" \
4242
SE_SERVER_PROTOCOL="http" \
4343
SE_VIDEO_POLL_INTERVAL="1" \
44-
SE_SCREEN_WIDTH="1920" \
45-
SE_SCREEN_HEIGHT="1080" \
4644
SE_FRAME_RATE="15" \
4745
SE_CODEC="libx264" \
4846
SE_PRESET="-preset ultrafast" \

Video/video.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ function wait_for_display() {
7171
until xset b off >/dev/null 2>&1; do
7272
sleep ${poll_interval}
7373
done
74-
VIDEO_SIZE=$(xdpyinfo | grep 'dimensions:' | awk '{print $2}')
74+
if [ -z "$SE_SCREEN_WIDTH" -o -z "$SE_SCREEN_HEIGHT" ]; then
75+
VIDEO_SIZE=$(xdpyinfo | grep 'dimensions:' | awk '{print $2}')
76+
fi
7577
echo "$(date -u +"${ts_format}") [${process_name}] - Display ${DISPLAY} is open with dimensions ${VIDEO_SIZE}"
7678
}
7779

0 commit comments

Comments
 (0)