Switch between two profiles with script?

I wonder if its possible to design a script in omsc that can perform a function where I can switch between two profiles when watching tv series with different aspect ratios, like this:

open tvshow x, episode x, if parent tvshow download folder is name x then switch to profile 2 and open same video file ( episode x ), when pressing stop switch back to master profile in tv show menu.

Is something like this possible?

It sounds like your probably trying to go about something the wrong way round. If you can explain exactly what it is that your trying to change between those two profiles then we should be able to provide some guidance.

I want to have 2 different video calibration settings, one for 16:9 and one for 2:1 aspect ratio tv shows. I have 2 different settings right now bit in 2 different profiles. It works but its not as smooth when switching between the two.

You could use the Kodi JSON interface to switch profiles. Have a look at the API docs: https://kodi.wiki/view/JSON-RPC_API/v8#Profiles


Why are you doing this with the calibration settings? When your playing a video does changing the “view mode” (OSD>settings>video settings>view mode) not get you where you want to be? You can map a remote button to cycle that setting if you wanted. Alternatively does your display not offer zoom options.

There is also a setting that may take care of your issue automatically depending on your source.
Settings>Player>Videos>Display 4:3 videos as> (choose your preference)

ok I doubt it will be that easy but I will check out those settings :slight_smile:

checked out those settings I’m sure they are suffecient if you use a normal tv but it’s a little more difficult with a projector with an anamorphic lens, I need to get into the video calibration settings to unstretch the picture horizontally.

But I don’t see how those calibration settings can be saved for a specific video, it would be great if they could.

If the videos you are wanting to adjust differently are all something like 480p you could use the whitelist (you must have adjust frame rate on) and that would send the original size video out. Kodi keeps separate calibration settings for each output resolution (as do many displays). Just keep in mind that the whitelist will only switch to your UI resolution and the whitelited ones, so you must whitelist every resolution/frame rate you want to output.

thanks for the tip, but that wont work either since its hd resolution, like netflix stranger things for example, it has black bars but those are not as big as a cinemascope movie.

ok, how about this:

I open up a tv show, then the osd video controls become available, I then run a simple script with specific settings for zoom and video calibration etc, this can then be mapped to a keypress in kodi. And then I map another key with standard settings when I want to switch back.

I tested and found that zoom settings can be saved individually for each video, why are the video calibration settings not saved individually too, can this be forced saved?, all I would like to do is this:

press button a: video resolution, setting x, zoom amount setting x
press button b: video resolution, setting y, zoom amount setting y

come on programmers ! :slight_smile:

No, because calibration is not intended to be used as you are trying to use it.

AFAIK there is no function currently in Kodi to map to a specific zoom level for video. You can use a keymap to program remote buttons to ZoomIn/ZoomOut. You could also make it a macro by using the method in this thread.

sounds like there is no way to achieve what I want without switching profiles so I think I will go that route since that profile has all the video resolution setup the way I want.

But it would be great if I could program this:

keypress a: switch to profile 2, go into tv shows.
keypress b: switch back to main profile, go into tv shows.

Is it possible?


The Kodi JSON api allows you to switch profiles via a script.

1 Like

I don’t know about the go into tv shows part but programing a profile to a button press…

How exactly loading a profile and then finding what you want to play would be preferable than just hitting zoom is confusing to me but to each their own I guess.

thanks will check out those 2 suggestions.
And zoom wont work with how my projector+lens is setup.

I have adden 2 submenus under tvshows with action to switch profiles, but I would like to map those two actions to a keypress, but I cant seem to find those two actions in the keymap editor…

Keymap editor is somewhat basic in its abilities. You can use it to map a key to something you don’t want and then manually modify the entry in the keymap file it made after that (usually .kodi/userdata/keymaps/gen.xml). The information you need for that window function should be here and here.

1 Like