Let's try a few things if you wouldn't mind:
First, let's try making the VNC server a one shot deal, by eliminating the -forever
option. And second, let's write our desired bitrates directly to the main.js file (just like you did in your modification), rather than using env vars in the .js. The new docker-compose would look like this:
version: '3.9'
services:
chrome-capture-for-channels:
image: fancybits/chrome-capture-for-channels:latest
container_name: cc4channels
command:
- sh
- -c
- |
Xvfb :99 -screen 0 1920x1080x16 &
x11vnc -display :99 &
sed -i '/videoBitsPerSecond/c\ videoBitsPerSecond: ${VIDEO},' main.js;
sed -i '/audioBitsPerSecond/c\ audioBitsPerSecond: ${AUDIO},' main.js;
exec node main.js
#devices:
#- /dev/dri:/dev/dri # Uncomment for Intel Quick Sync (GPU) access
ports:
- 5589:5589 # cc4channels proxy port
- 5900:5900 # VNC port for entering credentials
environment:
- VIDEO=${VIDEO}
- AUDIO=${AUDIO}
- TZ=${TZ} # Add your timezone in the Environment variables section with "name" set to TZ and "value" to your local timezone
volumes:
- cc4channels:/home/chrome # Creates persistent Docker Volume in /var/lib/docker/volumes for Chrome data and main.js
restart: unless-stopped
volumes:
cc4channels:
Other than the one shot VNC server we're exactly the same as the original.