kershner / screenBloom

Fake Ambilight for Philips Hue via Python
http://www.screenbloom.com
331 stars 48 forks source link

[feature] Support for capture devices #60

Open theironraiden opened 6 years ago

theironraiden commented 6 years ago

Hi,

It would be great to have an option to generate color data from capture devices (elgato, avermedia, webcams) instead of computer monitor. This would allow screenbloom to work with video game consoles/Video players.

kershner commented 6 years ago

Hi there. This is a really interesting suggestion. I'm not very familiar with these devices...how are you envisioning it working? Like is the El Gato hooked up to a PC and spitting out an image of the game there? I don't think we'd be able to get ScreenBloom running on the capture device natively.

theironraiden commented 6 years ago

Yeah, that's the idea, with the capture card hooked on to a PC, and through a setting, choosing whether to capture from screen or capture device, and some kind of list box to chose the exact capture device (As many computers come with integrated webcams, or some capture cards generate multiple devices).

I've actually tried to do some PoC with my Avermedia LGC, and a generic Composite video card, and averaging the colors to my Hue, and while I can't get image from the LGC (probably to limitations in OpenCV or my own limitations regarding to python knowledge, as I'm not really a programmer), I got this to work on the generic composite video card (I can average my hue to the colors on my NES games :D) but obviously lacking all the "magic" from screenbloom (like multi zones, brightness configuration, etc.)

The Avermedia LGC actually comes with an HDMI-In/HDMI-out for greater convenience, but in most cases you should probably have to use, in addition to the capture card, a 15-20€ hdmi splittter.

kershner commented 6 years ago

If the capture card just spits out the image onto the PC, couldn't you just fullscreen whatever window it displays in and run ScreenBloom like normal? I've been thinking of doing something similar involving an HDMI splitter to get ScreenBloom working with my Nintendo Switch.

MattTS01 commented 6 years ago

I've not looked in detail yet but could the get_screenshot function just be modified to use something like opencv's video capture function https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html ? The multi-zone/colour averaging stuff should happen after that so Screenbloom should treat it like it would any normal screen capture?

theironraiden commented 6 years ago

Using screenbloom over the capture cards preview on the PC "works" from my experience, but has two major caveats:

So its doable but far from ideal.