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
#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.
  • Loading branch information
StenAL authored Feb 2, 2025
1 parent 3fd6392 commit 43e4543
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Video/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
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" -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}"
}

Expand Down

0 comments on commit 43e4543

Please sign in to comment.