Chrome Capture for Channels

I have custom main.js that needs more refining but any node main.js or docker should work but going to increase support for other sites

For Proxmox users, I've updated the instructions for creating an LXC version of cc4c. This works with the latest stable Chrome (140.0.7339.80 as of this writing), Node v22.19.0, and uses the most recent code base (2.0.1) from the fancybits/chrome-capture-for-channels repo:

Apologies for the ignorance, but:

  1. Can this work with a custom main.js
  2. Is it more efficient than a docker / other method
  3. Can you make a video of you installing it for those less intelligent.

Sounds like you're not a Proxmox user:

Yes.

Yes to Docker.

That's what the step-by-step linked above is for -- but it's targeted at existing Proxmox users.

Would it be possible to have a 1 click installer? Regardless, I will attempt to do as stated on the guide sometime soon. I apologize for frustrating you, has anyone else been able to install it as per the guide?

Project One-Click is strictly for Docker projects utilizing Portainer.

Do you already have a system running Proxmox? If not, that's the bigger project -- adding a cc4c LXC is trivial in comparison.

No frustration on my end, though focusing on quality of posts rather than quantity helps to keep the content on the forum the most useful for everyone.

Multiple people have used the LXC guide successfully in the past, but I'm sure I'm the only one who's used the updated version I posted a few hours ago.

One of the beauties of virtualization though (like Proxmox), is that it's easy to spin-up a new container to test a step-by-step, after all the steps are determined -- and I did that before posting the update.

Wow guys so many random ways sports are on now I need to do YouTube too apparently YouTube has live sports as well chargers game so paolo

It keeps updating to 139 on Mac. Any other things I should be doing? For the first command, I used sudo rm -rf.

Windows or Mac?

Mac

I've given up on this source unless someone can show that there's a stable Windows release that doesn't get hosed by updates. Have disabled Google updates in the past and still been burned when Chrome updates somehow, just tired of dealing with it.

You're always chasing your tail with this source.

@GTFan This release . Go to services.msc and disable/stop Google Update services (2 entries). Go to program files(x86), Google / Update and rename the update exe. That will be stable 138. You can use test chrome but peacock bans it.

1 Like

I am running the docker version which I run through an Ubuntu Server 24.04.3

After first installing the container, everything runs fine. But I have scheduled daily reboots of my Ubuntu Server and everytime after it reboots, my cc4c container will not work. I've tried stopping it and restarting it and no matter what it won't work. But, if I remove the container and reinstall it, then everything is back to normal...until of course after the next reboot. I'm hoping someone can help me fix this problem. I tried ChatGPT and did a few things it suggested, but still no luck. Here are the error messages that I'm getting:


(EE) 
Fatal server error:
(EE) Server is already active for display 99
	If this server is no longer running, remove /tmp/.X99-lock
	and start again.
(EE) 
07/09/2025 18:27:30 *** XOpenDisplay failed (:99)
*** x11vnc was unable to open the X DISPLAY: ":99", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.
Some tips and guidelines:
** An X server (the one you wish to view) must be running before x11vnc is
   started: x11vnc does not start the X server.  (however, see the -create
   option if that is what you really want).
** You must use -display <disp>, -OR- set and export your $DISPLAY
   environment variable to refer to the display of the desired X server.
 - Usually the display is simply ":0" (in fact x11vnc uses this if you forget
   to specify it), but in some multi-user situations it could be ":1", ":2",
   or even ":137".  Ask your administrator or a guru if you are having
   difficulty determining what your X DISPLAY is.
** Next, you need to have sufficient permissions (Xauthority) 
   to connect to the X DISPLAY.   Here are some Tips:
 - Often, you just need to run x11vnc as the user logged into the X session.
   So make sure to be that user when you type x11vnc.
 - Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
   file may be accessed.  The cookie file contains the secret key that
   allows x11vnc to connect to the desired X DISPLAY.
 - You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
   by the -auth option, e.g.:
       x11vnc -auth /home/someuser/.Xauthority -display :0
       x11vnc -auth /tmp/.gdmzndVlR -display :0
   you must have read permission for the auth file.
   See also '-auth guess' and '-findauth' discussed below.
** If NO ONE is logged into an X session yet, but there is a greeter login
   program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
   to find and use the raw display manager MIT-MAGIC-COOKIE file.
   Some examples for various display managers:
     gdm:     -auth /var/gdm/:0.Xauth
              -auth /var/lib/gdm/:0.Xauth
     kdm:     -auth /var/lib/kdm/A:0-crWk72
              -auth /var/run/xauth/A:0-crWk72
     xdm:     -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
     dtlogin: -auth /var/dt/A:0-UgaaXa
   Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.
   Starting with x11vnc 0.9.9 you can have it try to guess by using:
              -auth guess
   (see also the x11vnc -findauth option.)
   Only root will have read permission for the file, and so x11vnc must be run
   as root (or copy it).  The random characters in the filenames will of course
   change and the directory the cookie file resides in is system dependent.
See also: http://www.karlrunge.com/x11vnc/faq.html

It sounds like you may not have used the correct Docker Compose to install cc4c.

What method did you use to install cc4c, and which container did you use?

1 Like

How can I use another main.js for docker?

1 Like

I'm simply running the following command:

sudo docker run -d --restart=unless-stopped --name cc4c -p 5589:5589 fancybits/chrome-capture-for-channels

I use Portainer to check everything.

I hate to see a guy using the command line when he has Portainer available. Kind of like reaching for an old flip phone when you have a smart phone too. :slight_smile:

Anyway, I don't think you're going to have much success with that Docker run command, as there are a number of config tweaks that are needed for successful ongoing use of the Docker version of cc4c. I haven't had a chance to test the most recent fancybits build of cc4c, but the Docker Compose will be the same or similar since the Docker part is based on some of my work.

For now, I'd suggest using this compose (via Portainer-Stacks):

version: '3.9'
services:
  cc4c:
    # 2025.04.20
    # GitHub home for this project: https://github.com/bnhf/chrome-capture-for-channels.
    # Docker container home for this project with setup instructions: https://hub.docker.com/r/bnhf/cc4c.
    image: bnhf/cc4c:${TAG:-latest}
    container_name: cc4c
    shm_size: '1gb'
    devices:
      - /dev/dri:/dev/dri # Uncomment for Intel Quick Sync (GPU) access
    ports:
      - ${HOST_PORT:-5589}:${CC4C_PORT:-5589} # cc4c proxy port
      - ${HOST_VNC_PORT:-5900}:5900 # VNC port for entering credentials
    environment:
      - VIDEO_BITRATE=${VIDEO_BITRATE:-6000000} # Video bitrate in bits per second  [number] [default: 6000000]
      - AUDIO_BITRATE=${AUDIO_BITRATE:-256000} # Audio bitrate in bits per second  [number] [default: 256000]
      - FRAMERATE=${FRAMERATE:-30} # Minimum frame rate  [number] [default: 30]
      - CC4C_PORT=${CC4C_PORT:-5589} # Port number for the server  [number] [default: 5589]
      - VIDEO_WIDTH=${VIDEO_WIDTH:-1920} # Video width in pixels (e.g., 1920 for 1080p)  [number] [default: 1920]
      - VIDEO_HEIGHT=${VIDEO_HEIGHT:-1080} # Video height in pixels (e.g., 1080 for 1080p)  [number] [default: 1080]
      - VIDEO_CODEC=${VIDEO_CODEC:-h264_nvenc} # Video codec (e.g., h264_nvenc, h264_qsv, h264_amf, h264_vaapi)  [string] [default: "h264_nvenc"]
      - AUDIO_CODEC=${AUDIO_CODEC:-aac} # Audio codec (e.g., aac, opus)  [string] [default: "aac"]
      - TZ=${TZ} # Your local timezone in Linux "tz" format.
    volumes:
      - cookies:/home/chrome/chromedata/Default/Cookies # Creates a persistent Docker Volume in /var/lib/docker/volumes for Chrome cookie data.
      - logins:/home/chrome/chromedata/Default/Login Data # Creates a persistent Docker Volume in /var/lib/docker/volumes for Chrome user login data.
      - localstorage:/home/chrome/chromedata/Default/Local Storage # Creates a persistent Docker Volume in /var/lib/docker/volumes for Chrome user local data.
      - prefs:/home/chrome/chromedata/Default/Preferences # Creates a persistent Docker Volume in /var/lib/docker/volumes for Chrome user preferences data.
      - secure:/home/chrome/chromedata/Default/Secure Preferences # Creates a persistent Docker Volume in /var/lib/docker/volumes for Chrome user secure data.
    restart: unless-stopped
    
volumes:
  cookies:
  logins:
  localstorage:
  prefs:
  secure:

The above compose should require no editing -- make your installation specific settings in the Environment variables section of the Portainer-Stacks Editor. Here are some samples:

TAG=latest
HOST_PORT=5589
CC4C_PORT=5589
HOST_VNC_PORT=5900
VIDEO_BITRATE=9500000
AUDIO_BITRATE=256000
FRAMERATE=60
VIDEO_WIDTH=1920
VIDEO_HEIGHT=1080
VIDEO_CODEC=h264_vaapi
AUDIO_CODEC=aac
TZ=US/Mountain
HOST_VOLUME=cc4c_chromedata
DEVICES=true

This, by the way, is the same version you'd get if you install using OliveTin's Project One-Click. The container is setup to recover from the sort of error you're reporting, though that's based on an internal restart.

You'd probably need to build your own container for local use, but that's relatively easy with Portainer. You can start with an existing build and then copy over the replacement main.js in the new Dockerfile. Your main.js would need to incorporate support for flags at minimum (as implemented in the @dravenst repo).

Thank you! Thank you! Thank you!

I used your code in Portainer-Stacks Editor, deployed the stack, it works, then did a reboot of my server, everything booted back up just fine, and this time CC4C worked like normal! So fingers crossed this was the fix.

One little minor question, I noticed in the log with the code it shows: headless: false,
Not sure if that should be set to true (and if so how would I go about doing that?) since I'm running this on an Ubuntu Server with no graphical interface, but either way, all seems to be working just fine now. Thanks again!

2 Likes

This container uses Xvfb and allows for connections via a VNC client to enter credentials (and the like) into the Chrome instance running in the container. So even though your server is headless, it's probably fair to say the container is not.

On a side note, what's going on with your server that requires nightly reboots?