Skip to content

Commit

Permalink
Make video dimensions parameterizable in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
omartrigui committed Jun 22, 2020
1 parent 60e8210 commit 073d32c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ FROM ubuntu:xenial

LABEL maintainer="[email protected]"

ENV OUTPUT_VIDEO_WIDTH 1280
ENV OUTPUT_VIDEO_HEIGHT 720

ADD https://github.com/just-containers/s6-overlay/releases/download/v2.0.0.1/s6-overlay-amd64.tar.gz /tmp/
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \
rm /tmp/s6-overlay-amd64.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ launch_xvfb() {

export DISPLAY=${XVFB_DISPLAY:-:1}
local screen=${XVFB_SCREEN:-0}
local resolution=${XVFB_RESOLUTION:-1280x720x24}
local resolution="${OUTPUT_VIDEO_WIDTH}x${OUTPUT_VIDEO_HEIGHT}x24"
local timeout=${XVFB_TIMEOUT:-5}

Xvfb "${DISPLAY}" -screen "${screen}" "${resolution}" &
Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getStartChromeCommand () {
return 'DISPLAY=:1.0 /bin/sh -c ' +
'"/opt/google/chrome/google-chrome ' +
'--window-position=0,0 ' +
'--window-size=1281,721 ' +
`--window-size=${+process.env.OUTPUT_VIDEO_WIDTH + 1},${+process.env.OUTPUT_VIDEO_HEIGHT + 1} ` +
'--remote-debugging-port=9222 ' +
'--no-first-run ' +
'--no-default-browser-check ' +
Expand All @@ -33,7 +33,7 @@ function getStartRecordingCommand () {
return 'ffmpeg -y ' +
'-f x11grab ' +
'-draw_mouse 0 ' +
'-s 1280x720 ' +
`-s ${process.env.OUTPUT_VIDEO_WIDTH}x${process.env.OUTPUT_VIDEO_HEIGHT} ` +
'-thread_queue_size 4096 ' +
'-i :1 ' +
'-f pulse ' +
Expand Down

0 comments on commit 073d32c

Please sign in to comment.