BETA: Chrome Capture for Channels

@tmm1 The only real issue(s) I have remaining in CC4C are:

  • Multi-hour shows/movies recordings will fail after three hours with an inactivity error from the website with an error like “due to inactivity, playback has been stopped. To resume playback, reload the page.” Is there any way to simulate some activity to stop the sites from timing us out?

To replicate: record a 4 hour block on any NBC station…wait for hour 3 to begin…timeout will occur.

  • The recordings themselves are sometimes flaky - there’s no consistency to when issues occur. I’ll occasionally see some errors like:
2023/07/19 07:45:21.411631 [HLS] ffmpeg: file30372-89d927ab5889:  [h264 @ 0x158e08370] vt decoder cb: output image buffer is null: -12909
2023/07/19 07:45:21.411703 [HLS] ffmpeg: file30372-89d927ab5889:  [h264 @ 0x158e33750] hardware accelerator failed to decode picture: Unknown error occurred

Though I’ve seen others as well like:

2023/07/17 21:00:00.381731 [HLS] ffmpeg: chrome-Bravo (East):  [matroska,webm @ 0x152f04770] Invalid length 0x72 > 0x8 for element with ID 0xE7 at 0xad4224a2
2023/07/17 21:00:00.383188 [HLS] ffmpeg: chrome-Bravo (East):  [matroska,webm @ 0x152f04770] Seek to desired resync point failed. Seeking to earliest point available instead.
2023/07/17 21:00:04.766938 [HLS] ffmpeg: chrome-Bravo (East):  [matroska,webm @ 0x152f04770] Unknown element 89 at pos. 0xad7340c6 with length 0x5acdf23 considered as invalid data. Last known good position 0xad72ac8f, 1 unknown elements in a row
2023/07/17 21:00:04.766962 [HLS] ffmpeg: chrome-Bravo (East):  [matroska,webm @ 0x152f04770] Seek to desired resync point failed. Seeking to earliest point available instead.
2023/07/17 21:05:41.793187 [HLS] ffmpeg: chrome-Bravo (East):  [matroska,webm @ 0x152f04770] Unknown element 643E at pos. 0xbffab3d9 with length 0x17fba3 considered as invalid data. Last known good position 0xbff9d720, 2 unknown elements in a row
2023/07/17 21:05:41.793450 [HLS] ffmpeg: chrome-Bravo (East):  [matroska,webm @ 0x152f04770] Seek to desired resync point failed. Seeking to earliest point available instead.
2023/07/17 21:08:00.093377 [ERR] Error during stream M3U-ChromeCaptureforChannels ch7005 Bravo (East): read |0: file already closed
2023/07/17 21:08:00.093409 [TNR] Closed connection to M3U-ChromeCaptureforChannels for ch7005 Bravo (East)
2023/07/17 21:08:00.131927 [HLS] ffmpeg: chrome-Bravo (East):  av_interleaved_write_frame(): Broken pipe
2023/07/17 21:08:00.132653 [HLS] ffmpeg: chrome-Bravo (East):  Error writing trailer of pipe:: Broken pipe
2023/07/17 21:08:00.132666 [HLS] ffmpeg: chrome-Bravo (East):  Error closing file pipe:: Broken pipe

My setup is an M2 Mac mini, using hardware acceleration and HEVC when streaming remote, running the latest beta DVR server.

Thoughts? I suspect the first issue (recordings timing out due to inactivity) is reasonably straightforward to address…but who knows. :smile:

Thanks for the advice! I tried that:

#EXTINF:-1 channel-id="Fire & Smoke",Fire & Smoke
chrome://localhost:5589/stream?url=https://fire.airnow.gov/%3Faqi_v=1%26m_ids=%26pa_ids=94451#

And now I see that the full URL is loading, however it's still only displaying the full U.S. map. If I paste the same resulting URL into a new Safari window on my DVR server, it loads with Los Angeles as the focus. Only in this Chrome browser set up for CC4C does it stay zoomed out. I'm not sure why, if it has something to do with this Chrome instance being locked down, prevented from using geolocation, or something like that?

Looks like this Fire & Smoke map live channel won't work the way I'd like it to :cry:

Which website are you using to stream these NBC stations? NBC.com? YouTube TV? Hulu Live, Fubo, etc.? Asking because I'm using YTTV primarily and haven't seen that timer nag. It would be good for us to differentiate as we devise any "activity simulation" as workarounds...

1 Like

I also noticed the weatherscan.net site has been down for awhile? I can't visit even in a regular browser. If anyone has tested of other dashboard type websites that work well with CC4C and would be appropriate for the TV screen (for weather, earthquake info, surfing conditions, fire and smoke map, stock / crypto price ticker, news headlines, etc.) please share here.

1 Like

Weatherscan web server reported a bad gateway error. This has been happening for almost 24 hours. Looks like a problem.

I'm not sure I have scheduled a recording on my Fubo/CC4C setup that last more than 3 hours? Will get one in the queue, and see what happens.

I would add to the known issues, that there is an audio PID error when trying to edit the resulting mpg files, outside of Channels. I've been playing around in the main.js file, with different encoding parameters, but have not been able to affect that error. This is likely beyond my knowledge of why the error is happening.

In order to be able to edit the file, or even compress it in Handbrake, I've been remuxing with ffmpeg, then using ffmpeg to convert the audio from opus to aac. After those two trips thru ffmpeg, the file is editable.

I'm not sure this is 100% a CC4C issue. When I pasted your original link in both Firefox and Chrome, it started zoomed out to the country level. In Chrome I did turn on allow location, and that did get it to at least start zoomed in my area (whether I use the original link or just the top level domain). So I set it up with just the top level domain and ran up to the server when I launched the station. Sure enough, it wanted me to give it location access. I did so, and now whenever I launch it is starting centered in my area (even if I close the entire Chrome window):

#EXTINF:-1 channel-id="Fire & Smoke",Fire & Smoke
chrome://localhost:5589/stream?url=https://fire.airnow.gov

Thanks for checking that, makes sense. I checked to see that location was allowed in Chrome but maybe I need to dig deeper. When I'm back home later I'll kick this around some more. I appreciate the help.

I have run into the same challenges wrt working with the resultant file, specifically the audio. VLC plays it fine, but no joy with anything else I tried, including handbrake. Hadn't thought about using ffmpeg. Would appreciate if you could expand a bit on what you are doing in those two passes as well as any other thoughts for findings you have on improving the stream.

I have been playing around with the bitrates and mime type to see what is optimal for my setup. Appears that Chrome doesn't like anything other than webm with Opus.
My CC4C runs on an M1 MacMini. My source is exclusively Spectrum.
My experience with CC4C has been exceptional so far. The picture and sound are better than expected and have had zero problems tuning or recording content. I haven't tried stressing it with more than 2 streams, but so far my little stock mini handles everything just fine.

@chasut, I'm at work right now, but will post the commands I used to remux and convert to aac, when I get home.

1 Like

Now the server is back up, but the dashboard isn't displaying any data, it's all blank and just says "undefined." Weatherscan's IT staff might be working overtime...

I made a 4.5 hour recording from a Fubo/CC4C source. No "activity" warnings. Recording was OK.

@chasut, here is what I'm doing to make these mpg files editable. Not sure why, but both steps are needed. Doing one or the other, does not result in a file that's editable for me. I'm certainly not an expert, and have not had much luck changing the encoding within Chrome, to eliminate this audio PID issue. This is also my first time working with opus audio, but assuming the PID issue is not necessarily related to that audio codec choice?

ffmpeg -i "input.mpg" -c copy "output.ts"

ffmpeg -i "output.ts" -acodec aac -vcodec copy "editable.ts"

1 Like

It’s back up and working fine now.

Thanks for this. Maybe it is Opus inside the mpeg container that requires it be pulled out first to the stream file? I Don't know much about any of this, but I suppose I enjoy the process of working through it all.

I tried this for SNY and it worked and pretty well too! However, unlike most other reported issues, I'm getting black letterbox bars on the top and bottom of the screen that distorts the screen a little making the players look a little fatter than they are. Any one know if a way to override this?

Moving from the executable to the Docker solved this completely for me…

What system are you using? I was under the impression that most people were having issues logging in with credentials using docker. I have a headless windows 11 setup working pretty well.

I spent some time yesterday on a Portainer-Stack (docker compose) to support VNC connections to a cc4channels container specifically to allow for easy entry of credentials:

version: '3.9'
services:
  chrome-capture-for-channels:
    image: fancybits/chrome-capture-for-channels
    container_name: cc4channels
    command:
      - sh 
      - -c 
      - |
        Xvfb :99 -screen 0 1920x1080x16 &
        x11vnc -display :99 &
        node main.js
    ports:
      - 5589:5589 # cc4channels proxy port
      - 5900:5900 # VNC port for entering credentials
    restart: unless-stopped

Tested with TightVNC, but should work well with any VNC client.

3 Likes