Plex HTPC custom aspect ratio for Super Ultra Wide Monitors (32:9)

Hey all,

I have a Samsung G9 monitor (32:9), I know the only way to control the “Zoom” for certain media is to use the Plex HTPC app which I am ok with. The problem is that when I want to remove the black bars on certain media (typically by zooming in on a normal Ultra Wide Monitor) it zooms in way too far, stretching the media way too wide.

Is there a way to add a custom aspect ratio which will still keep the 16:9 ratio but zoom in so that it only leaves the side black areas? Like a zoomed in version of the 16:9 where the zoom requirement is only the vertical portion, not horizontal?

Thank you.

I have the same monitor and I used these instructions and adapted the zoom steps accordingly (with a bit of trial and error): Use `mpv` features which are not exposed in Plex for Windows/Mac/Linux and Plex HTPC

The “inputmap method” has predefined zoom steps. It’s these which you need to adapt.

Thank you for your help. I looked into the article but there is something I must be missing. I made a new .json file called “zoom-controls.json”, placed it in the correct folder with the other .json files are (\AppData\Local\Plex HTPC\inputmaps\default) and put in the following:

{
“name”: “Generic Keyboard”,
“idmatcher”: “Keyboard.*”,
“mapping”: {
“Ctrl\+W” : “mpv:add video-zoom 0.05”,
“Ctrl\+Q” : “mpv:add video-zoom -0.05”,
“Ctrl\+S” : “mpv:cycle-values video-zoom 0 0.0574502 0.4025857 0.4269356”,
“Ctrl\+A” : “mpv:set video-zoom 0”
}
}

It seems pretty straight forward and no errors show up, but when in Plex HTPC none of these controls work. What would I be missing?

Cheers.

https://support.plex.tv/articles/plex-htpc-input-maps/

Hey OttoKerner,

Looking through that resource, I noticed that I had the json file in the default directory, which was incorrect. I placed it in the folder before that per instructions.

Changing the code around, but following the instructions, I came up with this:

{

“name”: “Zoom Controls”,

“idmatcher”: “Keyboard”,

//zoom controls

“Ctrl+W” : “mpv:add video-zoom 0.05”,

“Ctrl+Q” : “mpv:add video-zoom -0.05”,

“Ctrl+S” : “mpv:cycle-values video-zoom 0 0.0574502 0.4025857 0.4269356”,

“Ctrl+A” : “mpv:set video-zoom 0”,

}

}

When putting in these inputs and looking at the logs of Plex HTPC, it seems like these are getting the inputs correctly, but no match is found.

DEBUG - [InputManager] Input received: source: Keyboard keycode: Ctrl+Q:3
DEBUG - [InputManager] No match for: Ctrl+Q
DEBUG - [InputManager] Input received: source: Keyboard keycode: Ctrl+W:3
DEBUG - [InputManager] No match for: Ctrl+W
DEBUG - [InputManager] Input received: source: Keyboard keycode: Ctrl+A:1
DEBUG - [InputManager] No match for: Ctrl+A
DEBUG - [InputManager] Input received: source: Keyboard keycode: Ctrl+S:3
DEBUG - [InputManager] No match for: Ctrl+S

Is the IDMatcher = Keyboard incorrect? It seems like the source is right.

Cheers.

You haven’t “escaped” those plus signs.
Here is an excerpt from mine. I have used the + and - of the numerical block.

	// zoom controls
	"Ctrl\\+\\+" : "mpv:add video-zoom 0.05",
	"Ctrl\\+\\-" : "mpv:add video-zoom -0.01",
	"Ctrl\\+\\*" : "mpv:cycle-values video-zoom 0 0.0574502 0.4025857 0.4269356",
	"Ctrl\\+0" : "mpv:set video-zoom 0",

You should definitely copy the keyboard.json from the default subfolder,
and only extend it instead of completely replacing its contents.

Here is a complete keyboard.json.
Some of its sections have been disabled with double backslashes (which turns them into comments).
If you want some of them, remove the two backslashes at the beginning of their lines.

{
  "name": "Generic Keyboard",
  "idmatcher": "Keyboard.*",
  "mapping": {
    "Left": "left",
    "Right": "right",
    "Up": "up",
    "Down": "down",
    "Return|Enter": "enter",
    "Esc|Backspace": {
      "short": "back",
      "long": "home"
    },

    // Standard text entry. There's no distinction between upper and lower case
    // letters. The optional Shift key is only a flexibility convenience.
    "(?:Shift\\+)?([A-Z0-9.])": "%1",

    // Use Shift+letter to jup to the associated letter in supporting lists.
    "Shift\\+([A-Z])": "jump+%1",

    // Application shortcuts.
    "Space": ["space", "play_pause"],
    "P": "play_pause",
    "Ctrl\\+P": "pause",
    "X": "stop",
    "B": "back",
    "H": "home",
    "A": "cycle_audio",
    "L": "cycle_subtitles",
    "S": "toggle_subtitles",
    "Alt\\+A": "increase_audio_delay",
    "Alt\\+Shift\\+A": "decrease_audio_delay",
    "Alt\\+S": "increase_subtitles_delay",
    "Alt\\+Shift\\+S": "decrease_subtitles_delay",
    "PgUp": "seek_backward",
    "PgDown": "seek_forward",
    "Home": "step_backward",
    "End": "step_forward",
    "Ctrl\\+F": "search",
    "\\[": "previous_pivot_tab",
    "\\]": "next_pivot_tab",
    "=": "increase_volume",
    "(Shift\\+)?\\+": "increase_volume",
    "\\-": "decrease_volume",
    "I": "info",
    "W": "toggle_watched",
    "Z": "cycle_aspect_ratio",
    "Ctrl\\+Shift\\+D": "debug",
	// "Ctrl\\+D": "host:player af toggle lavfi=[acompressor=ratio=2:makeup=1]",
	// "Ctrl\\+D": "host:player af toggle lavfi=[dynaudnorm]",
	"Ctrl\\+D": "mpv:af toggle lavfi=[acompressor=ratio=5:makeup=4]",
	"D": "mpv:vf toggle d3d11vpp=[deint=yes:interlaced-only=yes]",
	
	//Speed Controls
	"N": { "short": "mpv:set speed 0.5", "long": "mpv:set speed 0.25" },
	"M": { "short": "mpv:set speed 2", "long": "mpv:set speed 4" },
	"Alt\\+1|Ctrl\\+1": "mpv:set speed 1",
	"Alt\\+2": "mpv:set speed 0.5",
	"Alt\\+3": "mpv:set speed 0.25",
	"Alt\\+4": "mpv:set speed 0.125",
	"Ctrl\\+2": "mpv:set speed 2",
	"Ctrl\\+3": "mpv:set speed 4",
	"Ctrl\\+4": "mpv:set speed 8",

	// refine subtitle position
	//"Shift\\+R" : "mpv:add sub-pos +1",
	//"R" : "mpv:add sub-pos -1",

	// frame back and forth
	//"\\." : "mpv:frame-step",
	//"," : "mpv:frame-back-step",
	
	// zoom controls
	//"Ctrl\\+\\+" : "mpv:add video-zoom 0.01",
	//"Ctrl\\+\\-" : "mpv:add video-zoom -0.01",
	//"Ctrl\\+\\*" : "mpv:cycle-values video-zoom 0 0.0574502 0.4025857 0.4269356",
	//"Ctrl\\+0" : "mpv:set video-zoom 0",
	
	//still snapshot
	"Ctrl\\+S": "mpv:screenshot",

    // Application window handling.
    "Alt\\+(Return|Enter)": "toggle_fullscreen",
    "F11": "toggle_fullscreen",
    "\\\\": "toggle_fullscreen",
    "E": "exit"


    // The `|<< <<` and `>> >>|` button on a Harmony Hub remote sends different
    // keys based on the Harmony device configuration. A long press action to
    // send `skip_previous` or `skip_next` must be configured in the Harmony
    // app. The default configuration sends no keyboard events to Plex.
    //
    // - "Media Rewind" and "Media Fast Forward" are sent when the device is
    //   configured as a Windows computer.
    // - "R" and "F" are sent when the device is configured as a Microsoft Plex
    //   entertainment device..
    //"(Media Fast Forward)|F": "seek_forward"
    //"(Media Rewind)|R": "seek_backward"
  }
}
1 Like

Hey OttoKerner,

Ah, I understand, I must have read that incorrect then. Thank you for the sample that has really helped.

I have tested the new .json with the changes you suggested and it is working as intended.

Too bad this only works on Plex HTPC, not on the normal Plex app. I know that app used to have a zoom option before but it was taken out? Either way, this is a way better viewing experience than before. Thank you!

Cheers.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.