Questions about automating screen masking with a media app like plex, jelyfin, or emby

Hello,

I am trying to figure out a way to automate screen masking in my theater when playing a movie. Based on the aspect ratio.

I know there has to be a way to do it because some have done the same in my search, but nobody is really explaining how they accomplished it.

The problem is nativly the files are reporting 1:78 or 16:9 even if they are 2:35 with black bars.

Trying to figure out a way around that, my two options so far is re-encode my remux videos with handbrake and crop the bars (will take a while and I don’t want to touch the videos) or scan and put the aspect ratio with TMM in the filename or .nfo for the movie…which takes the least amount of time but it’s buggy.

IMDB is the only resouce to pull theatrical aspect ratio from but they don’t allow api’s for public use I think.

But even if I can get that information how do I make it useful? From what I can tell the plex and jellyfin add-ons pretty much just report if a movie is playing, who is watching and pausing or stopping it. I don’t see anything that appears to be the aspect ratio of the movie.

Any ideas? Any help or direction would be appriciated…thanks again!

Hey @1971camaroguy pleased to meet you.

Since you clearly have some type of masking for your theater I assume that you may have the financial means to take a look at a video processor such as the MadVR Envy. I have one and one of its many tricks is to drive my Stewart Filmscreen CVM masking. I have written a custom MadVR component for HA which exposes a masking_int attribute. This attribute allows me to set the masking aspect for whatever is currently on screen at the push of a button.

One tip I would offer is that you not wire the detected aspect ratio directly to your electric masking but instead use a button on a remote to adjust the masking when you request it. There’s nothing worse than a “smart” automation when it’s wrong, and many movies today switch aspect ratios mid film.

LMK how it goes.

There are a few ways to do this. Ideally, we would add a service to the Plex integration that would allow you to query the title’s metadata. Another option would be to look at the plex api.

Plex API: Get a Movie - Plexopedia

I haven’t confirmed on my Plex instance, but the docs indicate that all metadata is returned for a title. You could then add the required metadata to each plex title, then use the RESTful Sensor - Home Assistant (home-assistant.io) to populate that data using the media_content_id from the media player entity that corresponds to your home theater plex player. I think that would be my approach anyways.