Chrome Capture for Channels

No change to the existing volumes, all worked fine after stack started.

OK thanks. Let me know if/when this happens again. I had some code in place to gracefully handle these internal restarts, but that could lead to an internal restart loop, which in no good either. I'll see if there's a log we might be able to grab next time -- to get a better idea what's happening.

Yeah, I thought about the container log after I restarted. If it happens again, I'll copy that log before I restart.

Also, it's possible we're running into memory related issues after a period of time. One of the containers I use elsewhere is jlesage/firefox and she sets shm_size: '1gb' for that project. Worth a try here too:

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:

No change to sample env vars:

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

@bnhf
Ok, I'll add that parameter and let it run. Thanks.

Hi guys - anyone running into issues with NBC-related channels with CC4C and the most recent Chrome release: Version 137.0.7151.56 (Official Build) (arm64).

For me, NBC comes up, but, crucially, it won't autoplay without pressing space. I'm not sure if this is related to the new AI-centric features in Chrome, or if something's changed on the NBC side. I lean toward Chrome being the root cause, but trying to work through how to address. Weirdly, I can pull it up just fine on the same version of Chrome on my local Mac, just not on the headless Mac Studio I have this running on.

For comparison, this setup has been working pretty much flawlessly for nearly two years.

Any thoughts on how to address? I'm going to have to dig into puppeteer it looks like...

Followup from my own troubleshooting...if you live in an environment that has builtin adblocking at the network level, it seems that things are getting caught up there. Specifically - the page with the video may not fully load (it's showing a perpetually loading indicator). The workaround/hack is to adjust page.goto to have a timeout and just keep going. This is imperfect, because it presumes that the page correctly loads, but it's a good enough workaround for me for the time being. For posterity:

try {

  // Navigate and wait until network is (almost) idle:
  await page.goto(u, { timeout: 10_000, waitUntil: "networkidle2" });
} catch (err) {

  if (err.name === "TimeoutError") {

    console.warn(`page.goto timed out after 10s for ${u}`);
  } else {

    throw err;            // some _other_ error? re-throw it
  }
}

@bnhf
I am doing a fresh install of Channels onto a Synology and also installed OliveTin via Portainer. All good that far, but when I try to use OliveTin to one-click install CC4C, I'm getting invalid argument, doesn't match int even when I stick with the default values. Any tips on which variable might be causing it?

Thanks!

It's the CDVR_START_CHAN field. I have it set to only accept an integer, but you need to leave it as # to use existing M3U numbering. I'll fix that, and push a new version, but in the meantime put a starting channel number in that field and it should work.

@klingantoni

Done. Pushed as bnhf/olivetin:latest (aka bnhf/olivetin:2025.06.19). Using the default # value in the CDVR_START_CHAN field should now work as expected.

@bnhf
Thanks for such a quick fix. That got me past the error, now I am hitting a Portainer error where it doesn't think olivetin has a valid authorization token. There is an API Key env variable so not sure where I went wrong there.

What method did you use for the initial OliveTin install?

You can always delete the existing Portainer Access Token, and create a new one. Copy and paste it to a safe place, then stop the OliveTin stack and replace whatever value you have now for PORTAINER_TOKEN with this new one.

@bnhf
I added it to an existing Portainer instance using your instructions in this thread:

Since you mentioned PORTAINER_TOKEN it looks like that has no value in my olivetin stack. Probably why I'm getting the error! I'll try generating one in Portainer and putting it there.

@bnhf
Adding a key to PORTAINTER_TOKEN got me there. Thanks again.
Now to figure out if I can find the right stream URL for NBC Sports Bay Area, but that's a whole other problem...I appreciate the tech support!

1 Like

Do i.have to edit the default input parameters to.get a site to stream in fullscreen?

1 Like

Just dropping this here as I'm at work till late
My CC4C won't load any channels I only use it for NBC.... I run it on my dedicated Channels PC as a straight windows environment I rechecked all and all seem to look ok i also updated it to latest release BUT now the Chrome window does not open for me to choose my login info
I used to see the chrome window when I'd remote in to that pc as it's headless.
I'll digg deeper when I find time BUT figured someone may have had this already

Hi how are you? I am having the same problem, did you find a fix by any chance? Thanks in advance!

Hello @dravenst when I try to open any channel using your CC4C fork or your CH4C fork the chrome window wont open at all. I have verified that all is correct multiple times and even reformatted my minipc but I am still having the same problem, could you please help me? Thanks in advance and sorry for the bother.

same issue here

FIXED IT !!!!
Uninstall current Chrome..... Install Chrome Version 135.0.7049.96 DISABLE all Chrome updaters I needed to actual change the .exe to .exe1 inside the various chrome install locations and "services" applet Do all this while offline (had to unplug my modem from the router since my Channels PC is headless) I'm running the Orig CC4C Win exe via Power-shell auto-start I was able to login to NBC on remote pc when Chrome opened and was finally viewable.

Hello thanks for the help, quick question, is it 100 percent necessary to change the exe to exe1 because i have done everything the way you suggested but unfortunately it doesn't work. Sorry for the bother and thanks in advance!