Skip to content

Commit

Permalink
Docker: Respect SE_SCREEN_{WIDTH,HEIGHT} variables in ffmpeg recording
Browse files Browse the repository at this point in the history
Currently, these variables are always overridden in the call the
wait_for_display(). Before the upgrade to ffmpeg-7.0.2 (PR SeleniumHQ#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.
  • Loading branch information
StenAL committed Feb 1, 2025
1 parent 3fd6392 commit 50d16f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Video/video.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" -a -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}"
}

Expand Down

0 comments on commit 50d16f0

Please sign in to comment.