You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
It's been working fine, but when I tried to switch scene collections, I get an error:
"There was a problem while changing scene collections and some sources could not be unloaded. This issue is typically caused by plugins that are not releasing resources properly. Please ensure that any plugins you are using are up to date.
OBS will not exit to prevent any potential data corruption."
According to the log, the source it couldn't unload was "Display Capture - Screen 1", the source that my script is pointing at. If I remove the script and restart, the problem stops occurring. It's only when the script is added that I get this issue.
Having added the script back in and selected a different source, the same thing happens but for the new source, e.g. a Window Capture source.
So I believe the script or its dependencies are not unloading the source correctly before OBS attempts to switch scene collection?
I suspect the same root cause is also responsible for the crash message I get when I shut down OBS, it's unable to release the source in time.
And looking at the logs I get this. So it looks like the line to source_list_release fails in my case.
22:28:47.150: [Python: zoom_and_follow_mouse.py] Run script_unload
22:28:47.150: [Python] source_list_release:1140: SWIG failed to convert python object to obs object: obs_source_t *
22:28:47.150: [Python: zoom_and_follow_mouse.py] released sources?
22:28:47.150: [obs-scripting]: Unloaded python script: zoom_and_follow_mouse.py
I then tried to modify the code to loop through release sources individually like this:
def script_unload():
log("Run script_unload")
# Get the source by name and release it
source_name = zoom.source_name
source = zoom.get_obs_source(source_name)
if source is not None:
# Release the crop filter, if it exists
crop = obs.obs_source_get_filter_by_name(source, CROP_FILTER_NAME)
if crop is not None:
obs.obs_source_filter_remove(source, crop)
obs.obs_source_release(crop) # Release the crop filter
log(f"Released crop filter from source: {source_name}")
obs.obs_source_release(source) # Release the source
log(f"Released source: {source_name}")
# If zoom.source_refs is a list of source names, release each source
if isinstance(zoom.source_refs, list):
for source_name in zoom.source_refs:
source = obs.obs_get_source_by_name(source_name)
if source is not None:
obs.obs_source_release(source)
log(f"Released source: {source_name}")
# Unregister hotkeys
obs.obs_hotkey_unregister(toggle_zoom)
obs.obs_hotkey_unregister(toggle_follow)
log("Finished running script_unload")
And I can see from the logs
01:22:17.175: [Python: zoom_and_follow_mouse.py] Run script_unload
01:22:17.175: [Python: zoom_and_follow_mouse.py] Released crop filter from source: Display Capture
01:22:17.175: [Python: zoom_and_follow_mouse.py] Released source: Display Capture
01:22:17.175: [Python: zoom_and_follow_mouse.py] Released source: Display Capture
01:22:17.175: [Python: zoom_and_follow_mouse.py] Finished running script_unload
01:22:22.175: [obs-scripting]: Unloaded python script: zoom_and_follow_mouse.py
01:22:22.175: [adv-ss] trying to reconnect to in 10 seconds.
01:22:22.175: [adv-ss] reset transition behaviour to adjust active transition type
01:22:22.200: Not all sources were cleared when clearing scene data:
01:22:22.200:
01:22:22.200: - Display Capture
01:22:22.200:
The double mention of "Released source: Display Capture" makes sense because I'm directly releasing the named source, and then releasing each entry in the reference list, however, it still errors, claiming that "Display Capture" hasn't actually been cleared.
I wonder if I have another plugin that is stopping this from being released, but I'm running out of ideas to debug.
The text was updated successfully, but these errors were encountered:
I'm using Windows 11. OBS 29.1.3. Python 3.11
I have added the latest version of the script.
It's been working fine, but when I tried to switch scene collections, I get an error:
"There was a problem while changing scene collections and some sources could not be unloaded. This issue is typically caused by plugins that are not releasing resources properly. Please ensure that any plugins you are using are up to date.
OBS will not exit to prevent any potential data corruption."
According to the log, the source it couldn't unload was "Display Capture - Screen 1", the source that my script is pointing at. If I remove the script and restart, the problem stops occurring. It's only when the script is added that I get this issue.
Having added the script back in and selected a different source, the same thing happens but for the new source, e.g. a Window Capture source.
So I believe the script or its dependencies are not unloading the source correctly before OBS attempts to switch scene collection?
I suspect the same root cause is also responsible for the crash message I get when I shut down OBS, it's unable to release the source in time.
I've added a log message after this line:
And looking at the logs I get this. So it looks like the line to source_list_release fails in my case.
22:28:47.150: [Python: zoom_and_follow_mouse.py] Run script_unload
22:28:47.150: [Python] source_list_release:1140: SWIG failed to convert python object to obs object: obs_source_t *
22:28:47.150: [Python: zoom_and_follow_mouse.py] released sources?
22:28:47.150: [obs-scripting]: Unloaded python script: zoom_and_follow_mouse.py
I then tried to modify the code to loop through release sources individually like this:
And I can see from the logs
01:22:17.175: [Python: zoom_and_follow_mouse.py] Run script_unload
01:22:17.175: [Python: zoom_and_follow_mouse.py] Released crop filter from source: Display Capture
01:22:17.175: [Python: zoom_and_follow_mouse.py] Released source: Display Capture
01:22:17.175: [Python: zoom_and_follow_mouse.py] Released source: Display Capture
01:22:17.175: [Python: zoom_and_follow_mouse.py] Finished running script_unload
01:22:22.175: [obs-scripting]: Unloaded python script: zoom_and_follow_mouse.py
01:22:22.175: [adv-ss] trying to reconnect to in 10 seconds.
01:22:22.175: [adv-ss] reset transition behaviour to adjust active transition type
01:22:22.200: Not all sources were cleared when clearing scene data:
01:22:22.200:
01:22:22.200: - Display Capture
01:22:22.200:
The double mention of "Released source: Display Capture" makes sense because I'm directly releasing the named source, and then releasing each entry in the reference list, however, it still errors, claiming that "Display Capture" hasn't actually been cleared.
I wonder if I have another plugin that is stopping this from being released, but I'm running out of ideas to debug.
The text was updated successfully, but these errors were encountered: