BETA: Chrome Capture for Channels

Weird. I do have Chrome installed. Its open and running on the newer computer as is the exec. I thought I read in this thread somewhere that Chrome doesn't have to be on the server machine? Do I need to change anything in the path in order for puppeteer to recognize chrome is installed on a different PC in the network?

1 Like

I’m using 1440 x 900. I tried kicking it up to 1920 x 1200 which seems to have corrected the small window, however because I use this computer as my main production machine, I hate to have to keep the resolution so high especially with my aging eyes… :grinning:

Had things working nicely yesterday evening. Set up a few test recordings overnight and around 1:30am, every recording after appears in my library, but when I try to play it I'm getting Connection Lost (-17). This is happening now as I try to watch anything live as well. Any suggestions?

1 Like

So, I got back from a long vacation and finally had time to set this up. Using v0.1.10, everything is set up and functional. The NBC channels are hit or miss. Sometimes they play OK, sometimes there is a stutter every 10 seconds, or so. Will have to troubleshoot further.

I have the chrome capture installed on a spare windows PC; fresh Win 11 Pro install, i7-8700, Intel Arc A380 GPU (which I was using previously to try AV1 hardware encoding, unrelated to CDVR). FYI, chrome is using the Arc A380 during the captures by default.

Resolution is set to 1920x1080, and I'm seeing small black bars on all sides, on all channels.

I also set up two additional channels using my Fubo account. These two are solid. Playback has been flawless, and the video quality is better. Seems to be double the bit rate, compared to the NBC channels, and the ticker at the bottom of one channel is perfectly smooth.

Will keep testing, and see if I can solve the NBC stutter. Otherwise, I may just convert those channels to Fubo as the source?

Thanks to all for all the work to get this up and running. It is nice to see the lost TVE channels back in CDVR.

Let me add to this terrific guide. For those on Macs who want to autostart without Platypus or anything else:

Go to ~/Library/LaunchAgents on your Mac and create a file called com.getchannels.chrome.capture.plist and put the following in it:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.getchannels.chrome.capture</string>
    <key>UserName</key>
    <string>yourusername</string>
    <key>WorkingDirectory</key>
    <string>/path/to/chrome-capture-for-channels</string>
    <key>StandardOutPath</key>
    <string>/path/to/chrome-capture-for-channels/chromecapture.log</string>
    <key>StandardErrorPath</key>
    <string>/path/to/chrome-capture-for-channels/chromecapture.log</string>
    <key>ProgramArguments</key>
    <array>
      <string>/opt/homebrew/bin/node</string>
      <string>/path/to/chrome-capture-for-channels/main.js</string>
    </array>
</dict>
</plist>

Substitute your own username for yourusername and the right path to Chrome Capture for Channels for /path/to/chrome-capture-for-channels in the various places.

Then run:

launchctl load ~/Library/LaunchAgents/com.getchannels.chrome.capture.plist

Remove / stop the service with:

launchctl remove com.getchannels.chrome.capture

Logs will be in chromecapture.log in the main Chrome Capture for Channels directory.

Enjoy.

3 Likes

FYI: for folks who want NBC News Now in particular, you can get that by using the Plex Live Channels as a custom channels source. See: Plex Live TV Channels M3U? - #8 by tmm1

The NBC News Now livestream from Plex Live is the highest quality/bitrate I've found across the board, and it's a true direct livestream, so no need for extraordinary measures like Chrome Capture for Channels. I need all the other NBC channels too...so I still need this solution too for ones with no better alternatives. :smile:

But for NBC News Now...I'd recommend using the above. I've been using it for months. It's quite solid.

3 Likes

A couple observations, in the event it helps with this project:

  • all my earlier impressions were based on the Apple TV. Today, I tried this a bit on my Fire Stick. My audio was out of sync. I switched to the software video decoder (Playback > Advanced > Video Decoder) and that fixed my audio sync issues.

  • I've had a couple times that either an Apple TV or Fire Stick would show the navigation bars instead of going full screen. Although both my Mac monitors are already at 2560 x 1440, I found that if I toggled the resolution one step lower and then back to 2560 x 1440, it fixed the full screen issue.

I don't imagine it's possible to encode the audio with something other than opus? AAC would be great.

I'm exporting to Emby and the android Emby client doesn't like opus for some reason.

2 Likes

My setup continues to work pretty well but chrome-capture-for-channels quits frequently. Here's a recent log:

[2023/06/28 07:44:29.596] Chrome Capture server listening on port 5589
[2023/06/28 15:00:05.805] failed to start stream https://tv.youtube.com/watch/ZIzM3eNrylg TargetCloseError: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
    at CDPSessionImpl.send (/snapshot/chrome-capture-for-channels/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:429:35)
    at ExecutionContext._ExecutionContext_evaluate (/snapshot/chrome-capture-for-channels/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:244:46)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/snapshot/chrome-capture-for-channels/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:145:16)
[2023/06/28 15:00:05.867] GET /stream?url=https://tv.youtube.com/watch/ZIzM3eNrylg from ::1 responded 500 in 4932.744 ms
[2023/06/28 15:00:06.133] streaming https://tv.youtube.com/watch/ZIzM3eNrylg
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v18.5.0

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Aside from that, it's been really great.

Another glitch I noticed tonight is that if I’m watching a Chrome Capture channel in one device and load a Chrome Capture channel on a second device, I not only get a brief stutter of the first channel when the second device loads its channel, but if I exit the channel on the second device, the stream pauses on the first device and doesn’t resume.

I'm having a hard time getting the EPG to stick for any TVE channels coming in from Chrome Capture. Is anyone else having this issue? It'll stick around for a day or two, then it goes back to "Set provider" with no EPG

I want to thank everyone for the work on this thread, but I admit I feel like a lot of this is going way over my head. I’m just trying to get my Bravo back!

I feel like I skipped some steps of the process and reading through this thread confuses my. This setup was not set up by me originally, so I’m just trying to keep it running! Right now my buffering is terrible, but that’s could be I used an old Windows 10 laptop to set it up. My server is on a Synology NAS so it doesn’t sound like it can all be configured on that. I’m also wondering if maybe it is because I didn’t really know how to follow the steps about main.js, no clue what that is.

Do I need to maybe adjust my settings or just try on a different computer to avoid the buffering.

I don’t know about your machine, but I got a ton of buffering when I ran it on a 2013 MacBook Air. That went away when I moved it to a 2020 M1 Mac Mini.

Thank you so much! I've added slightly modified directions to the installation guide above.

Just to note, NBC News Now is available on a lot of services:

image

In order, those are:

  • Chrome Capture for Channels
  • Pluto
  • Samsung TV
  • Plex
  • Xumo

To be fair, I have not tested the others to see if there is a difference in quality, so I'll trust you on this!

Weird, I'm the total opposite! This is with both TS4K+ and CCwGT. Hardware is my jam, and I was so happy that this solution works with that setting. Switching to software for me will screw up a bunch of stuff, especially 3.0 stations.

1 Like

The main.js is the file that basically has all of the settings and functions. You shouldn't do anything to the main.js unless you are experimenting with settings. If you aren't comfortable with coding, don't screw with it. Aman is still making a lot of adjustments.

There's no harm in starting over:

1 Like

At times I wonder if I got a dud Fire Stick Max. I’ve also had issues in the past with it stuttering on channels that played fine even on an 8-year-old Apple TV, and turning on software decoding helped with that, too. The plan is to go all newer Apple TVs throughout the house, but I’m trying to control my impulses to splurge on a ton of stuff just for Channels.

Chrome Capture Update after 3 full days: This could be a game changer for Channels. Spectrum is running great. NBC/Live has some issues. I am running the latest prerelease of channels using Apple TV 4K. Chrome Capture was updated to v 0.1.10, All is wired. I have fiber with 400M up/down. NBC runs fine via browser but Capture will run fine for various times then the video will freeze and audio continues. No error messages are thrown. Weatherscan runs ok with some occasional stuttering on the crawls but will either timeout or crash after 20 minutes or so. Again, no errors. In both cases I can hit the play button on Apple TV and the feed will resume. Spectrum is always flawless. I am hesitant to make changes in the main.js since Spectrum is fine. Just providing this in case it might be of use.

So weird that I have very little issues with NBC stations, but Spectrum isn't watchable.

I can often watch NBC for a couple of hours after hitting play on remote twice. It changes channels to last watched then back to NBC. I wonder if it is on the Apple TV side.

Strange about Spectrum. No issues at all.