Kodi Community Forum
Novice, help requested - Script to change resolution on playback - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Novice, help requested - Script to change resolution on playback (/showthread.php?tid=295171)



Novice, help requested - Script to change resolution on playback - mhendu - 2016-10-29

When using DSPlayer with MadVR and attempting to play back 3D MVC MKVs, if the Kodi resolution is not set to 1080p I get strange behavior - on my system Kodi is set to 4K resolution and I can only see the top left corner of the movie (presumably 1920x1080 pixels at the top left of the full 4K image). MadVR does correctly send a frame-packed signal to my display, so I figured if I could get Kodi to change its resolution to 1080p on playback of a 3D MVC MKV (identified in my system by filename) then this would work and I wouldn't have to rely on an external player.

I've adapted a script I found elsewhere in the forums to change the resolution on playback as a first stab at this. It does successfully change the resolution (first problem solved!) but a dialog box pops up on changing the resolution that the script doesn't successfully close (in the script you can see I added a time delay from playback to resolution change to account for the display changing its resolution). I've tried a few different methods and I figured I'm just scripting this incorrectly. Before I get to the logic of looking up the filename prior to changing resolution I need to figure out this piece. Honestly I have no idea how to script in Python or to use JSON but I'm taking a stab at it anyway. Any help would be appreciated!

Here's a link to the script:

http://pastebin.com/FXD6SuCH