Taking screenshots programatically?

Hey everyone,

I develop an app for Philips Hue lights called ScreenBloom which simply takes a screenshot, extracts color data from the pixels in the shot to produce an average, and updates Philips Hue lights with the color. Creates a simple but nice dynamic bias light effect.

I’m thinking about developing a Plex plugin for this functionality, but before I get too far down the rabbit hole I’d like to ask the fine experts here if you think such a thing is even possible with a Plex plugin? ScreenBloom is written in Python so most of the functionality should work just fine but I’m mostly curious about grabbing screenshots rapidly. Can I simply use PIL / ImageGrab?

Thanks for your helpful information!

Greetings! Plex channels don’t do the actual playback, they just find the media files/streams for Plex clients, which are network devices, to play. So it makes most sense to me to install and use your app on the target devices where the media do actually play (and the lights are installed) and, if I understand correctly, there’s no need for any specific Plex plug-in for that.

One thing you could do from Plex is starting/stopping your app when media playback starts or stops, there is a Webhooks function (Plex-pass only) that can emit these events that you app could listen to, it can also be configured without any plug-in.