Making some automations for game testing and I want to do what the Resize Output menu item does from python.
Specifically I have a hook callback which allows me to get the resolution of the game's window (I test in windowed mode usually).
I've figured out that Resize changes at least 2 different locations. One is the Video Settings' Base and Output Resolution, which I've found how to do through the obs_frontend_get_profile_config , "Video" section and "BaseCX/Y" and "OutputCX/Y" for the resolutions. I also use obs.obs_frontend_save() and obs.obs_frontend_reset_video() to make sure the values are actually changed in the Settings. But using obs_frontend_reset_video in the hooked callback crashes obs and also corrupts the source and deletes it.
The second location is the transform_info's size (scale*window width, height) and bounding box size. But these alone don't have the exact result.
I've also tried to use obs_reset_video with the modified sizes, which does seem to be also executed during the Resize Output, but it doesn't affect the transform.
My question is twofold: A) Am I missing sth? Are all 3 of the above needed? Am I doing something wrong out of those? and B) what's the appropriate way to commit the changes to the profile's settings for the base and output resolutions without corrupting the source, after hook is fired?
Specifically I have a hook callback which allows me to get the resolution of the game's window (I test in windowed mode usually).
I've figured out that Resize changes at least 2 different locations. One is the Video Settings' Base and Output Resolution, which I've found how to do through the obs_frontend_get_profile_config , "Video" section and "BaseCX/Y" and "OutputCX/Y" for the resolutions. I also use obs.obs_frontend_save() and obs.obs_frontend_reset_video() to make sure the values are actually changed in the Settings. But using obs_frontend_reset_video in the hooked callback crashes obs and also corrupts the source and deletes it.
The second location is the transform_info's size (scale*window width, height) and bounding box size. But these alone don't have the exact result.
I've also tried to use obs_reset_video with the modified sizes, which does seem to be also executed during the Resize Output, but it doesn't affect the transform.
My question is twofold: A) Am I missing sth? Are all 3 of the above needed? Am I doing something wrong out of those? and B) what's the appropriate way to commit the changes to the profile's settings for the base and output resolutions without corrupting the source, after hook is fired?