BETA: Chrome Capture for Channels

This is what I bought recently - got for a ubuntu box I had, but fortunately with the 3 pack I had a couple extras for this project

Amazon.com: vienon HDMI Dummy Plug 4K High Resolution Virtual Monitor Display Emulator New Generation Headless Display Adapter Compatible with Windows Mac OSX Linux, 3Pack : Electronics

I am running 2560x1440 and still have pretty large boarders. Not a big deal really for these particular channels and what I watch on them.

Can Channels wake up a machine from sleep? Anyone have any tricks to get out of sleep mode? I did set up a couple scheduled tasks to wake/sleep but looking for other tweeks.

3 Likes

Linux and Mac have the wakeonlan command (apt, brew, etc) that can wake up a machine over the network using its mac address. Might embed that into the node script with an execute command.

This question was the key, thank you! So I changed my Mac's display resolution, bumping it up one notch to 2560 x 1440. And now, Chrome Captured tabs play back in fullscreen in the Channels client, no borders at all, identical to the HDMI method, for all YTTV and NBC.com channels I've set up, just as they do for the same channels tuned into via the HDMI method. On both of my TV's! It's perfect! No need for a dedicated headless server for this after all...

In this demo I am channel surfing between all the same SyFy versions I set up earlier.

The only caveat for me now, as I see this from time to time, is when channel surfing quickly between them like this, the chrome-capture-for-channels-macos-arm64 executable crashes, and I have to manually relaunch it on the server to continue watching this way. Once I'm done experimenting I will spread these channels out in my guide, and I won't ever be channel surfing quite this quickly. So hopefully that will prevent the crashing.

In the meantime, here's a new video showing what this all looks and feels like right now, on day 3:

3 Likes

Can you run it manually in terminal and capture the crash message

./chrome-capture-for-channels-macos-*

1 Like

Thank you!

1 Like

Sure, here ya go:

[2023/06/22 17:37:57.241] GET /stream/syfyp from ::1 responded 200 in 967.044 ms
[2023/06/22 17:37:57.407] finished https://www.nbc.com/live?brand=syfy&callsign=syfy_west
[2023/06/22 17:38:02.142] streaming https://www.nbc.com/live?brand=syfy&callsign=syfy_west
[2023/06/22 17:38:03.477] GET /stream/syfyp from ::1 responded 200 in 892.887 ms
[2023/06/22 17:38:03.569] finished https://www.nbc.com/live?brand=syfy&callsign=syfy_west
[2023/06/22 17:38:03.581] failed to stream https://www.nbc.com/live?brand=syfy&callsign=syfy_west Error: Navigation failed because browser has disconnected!
    at new LifecycleWatcher (/snapshot/chrome-capture-for-channels/node_modules/puppeteer-core/lib/cjs/puppeteer/common/LifecycleWatcher.js:83:223)
    at Frame.goto (/snapshot/chrome-capture-for-channels/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Frame.js:76:25)
    at CDPPage.goto (/snapshot/chrome-capture-for-channels/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Page.js:444:39)
    at /snapshot/chrome-capture-for-channels/main.js
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2023/06/22 17:38:12.624] streaming https://www.nbc.com/live?brand=syfy&callsign=syfy_west
[2023/06/22 17:38:20.690] GET /stream/syfyp from ::1 responded 200 in 334.963 ms
[2023/06/22 17:38:21.502] finished https://www.nbc.com/live?brand=syfy&callsign=syfy_west
[2023/06/22 17:38:21.514] streaming https://tv.youtube.com/watch/2_WogcoZ1cY
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]

Thanks. I made a change that may help stop the crashing.

1 Like

It works! Thanks so much.

I looked over the demo video.
How did you manage to keep from having to press play?

thanks

Not that I'm concerned about it because it is very unlikely that I will ever get to that point but isn't there a limit of 500 channels? Or is the limit only with M3U playlists?

2 Likes

That's just per m3u playlist. You can add more playlists. The possibilities are endless.

1 Like

Got it. Thanks for the clarification. :slightly_smiling_face:

Fair point, I've added the clarification to the installation directions above.

2 Likes

I am sure I am making a stupid mistake..... Able to stream all NBC channels. Able to make changes for guide data. Stream looks good. I have the same black border issue as others. However, when I force Chrome to full screen, it is perfect. Screen is 1920x1080. I think I can force a setting in the startup for Chrome to always be in fullscreen but I use Chrome for browsing on this PC. Suggestions?

Thanks

1 Like

Thanks, that fixed the issue, but it won't stay full screen when you start a channel.

I am using an M1 Mac and have gone through the steps that @babsonnexus so amazingly outlined above. However, I am stuck on step 5. I have completed everything up to that point and am not sure what to do at that point. Can anyone with an M1 Mac help me out with instructions on what you did for that step?

1 Like

I just launch it directly by double-clicking it. You can also add it to your list of apps to start up automatically when booting up, via System Settings > General > Login Items, at least on macOS Ventura.

I'm probably misunderstanding the question, but under the "Create a launcher" step, I didn't really have to do anything on my M1 Mac. I downloaded the latest arm64 version, moved it to where I wanted it to be, then unzipped it. After unzipping it, I right-clicked on the"chrome-capture-for-channels-macos-arm64" exec file, and chose "Open." It then ran in Terminal, with a message "Chrome Capture server listening on port 5589."

Some things to watch for:

  • If you don't right-click, and only doubles click, you get a permission message the very first time you launch it (but not on subsequent attempts).
  • Also, there have been a few times where it opens, and I get a bunch of text in Terminal, but no message that it is listening. The problem has always been that there's still a background process of Chrome Capture running from a previous launch. I use Activity Monitor to find it and force quit it.

I’ve tried this on macOS, however it never starts. I had to use an AppleScript to launch it at start up…

3 Likes