Kodi Community Forum
Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Discussions (https://forum.kodi.tv/forumdisplay.php?fid=222)
+--- Forum: Feature Requests (https://forum.kodi.tv/forumdisplay.php?fid=9)
+--- Thread: Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) (/showthread.php?tid=379052)



Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) - jubilex - 2024-10-05

Hi, it would be great if we could map a key to directly set the video player Zoom and Vertical Shift values and possibly other settings to a direct value during playback. This would be super useful to those of us using constant height / cinemascope screens, but probably others would find some use for it as well. For example, I would like to have a remote key mapped to, say, "Zoom = .74" or whatever, to immediately scale 16:9 content to fit within the confines of my 2.4:1 screen.


RE: Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) - PatK - 2024-10-06

Might want to investigate the add-on 'BlackBarsNever' with a bit of customization?


RE: Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) - jubilex - 2024-10-07

Oh that looks very very promising, thanks for the pointer!


RE: Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) - jubilex - 2024-10-07

Yes that Add-On pointed me in the right direction:

Code:
{"jsonrpc": "2.0", "method": "Player.SetViewMode", "params": {"viewmode": {"zoom": ' + str(zoom_amount) + ' }}, "id": 1}')

With that JSON it appears I can jump to specific zoom level, and also there is a Vertical Shift parameter which would have been useful for something else I was doing last week. Live and learn!


RE: Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) - jubilex - 2024-10-11

I haven't found the answer with Google - can I use keymap.xml to have a specified key execute a JSON command directly? Or do I need to put the JSON in a script and have the key execute that script? I often find stuff I want to do can only be done with JSON - like this "set zoom directly to specified value", and it seems weird if this single command requires a separate script in order to be mapped to a keyboard key or remote button.


RE: Direct entry of video Zoom and Vertical Shift etc (able to be keymapped) - Jogee - 2024-10-14

I believe you'd have to do that through a python script and a keymap.  My limited experience with keymaps had a list of functions you could call that were exposed, but JSON wasn't a direct one.