FiniteSingularity / obs-composite-blur

A comprehensive blur plugin for OBS that provides several different blur algorithms, and proper compositing.
GNU General Public License v2.0
380 stars 30 forks source link

[BUG] - Filter doesn't always load in large scenes (Unable to load .effect file) #89

Closed Artificiangel closed 10 months ago

Artificiangel commented 11 months ago

Describe the bug Switched to a newer version of OBS and began experiencing issues after a couple days. On start up, sometimes OBS crashes and blur filters don't load properly.

To Reproduce Using OBS 29.1.3. Have a pretty heavy scene collection (18 scenes, ~50 sources) where many scenes are nested. Blur filter is used in various locations, different background elements for example.

With OBS fully closed, starting it up shows a blank white screen for 10-15 seconds as everything loads. This sometimes leads to a crash. When it loads successfully, often the blur filters are all offline, causing those sources to be transparent.

To fix this: Switching to a different scene collection and back sometimes works. Or going into every source that uses the blur filter and switch from Dual Kawase to Gaussian, then back.

Checking the logs under Roaming\obs-studio\logs will display a few errors about "unable to load .effect file".

Switching back to OBS 29.0.2 Loading the scene collection is still slow, but OBS feels more stable and hasn't crashed yet. Never had an issue before switching to 29.1.3. The blur filters consistently load in all nested scenes. No errors in logs.

Expected behavior The plugin should work normally like my experience with OBS 29.0.2. I have a feeling this could be a timing issue, because small scene collections such as (1 scene, 1 blurred source) work perfectly with OBS 29.1.3.

Environment

GPU

Additional context I have a pretty complicated scene collection with lots of nested scenes. For example a background scene that's used in many others. The background scene contains a group of media/images, some have a blur filter on them. In some scenes such as "be right back", the entire background scene is blurred.

Errors/warnings such as these at the end of the startup in the logs: (29.1.3)

02:13:16.324: WIC: Only handle JXR for WIC images for now
02:13:16.324: gs_image_file_init_internal: Failed to load file ''
02:23:24.559: [obs-composite-blur] Unable to load .effect file.  Errors:
02:23:24.559: (None)
02:23:24.559: [obs-composite-blur] Unable to load composite.effect file.  Errors:
02:23:24.559: (None)
02:23:24.559: [obs-composite-blur] Unable to load mix.effect file.  Errors:
02:23:24.559: (None)
02:23:24.673: [obs-composite-blur] Unable to load .effect file.  Errors:
02:23:24.673: (None)
02:23:24.673: [obs-composite-blur] Unable to load .effect file.  Errors:
02:23:24.673: (None)
02:23:24.673: [obs-composite-blur] Unable to load composite.effect file.  Errors:
02:23:24.673: (None)
02:23:24.673: [obs-composite-blur] Unable to load mix.effect file.  Errors:
02:23:24.673: (None)
02:13:16.324: WIC: Only handle JXR for WIC images for now
02:13:16.324: gs_image_file_init_internal: Failed to load file ''
FiniteSingularity commented 11 months ago

Hi @Artificiangel-

Sorry you are running into some issues. I'm happy to help you figure out what is causing the issue and fix any issues that are in the code. And thank you for the very detailed issue- it helps a lot in terms of troubleshooting.

First off- it sounds like you have a complicated OBS setup, so before we do anything, I'd recommend you make a backup of your scene collections (you can go to the Scene Collection menu and select Export for each of your scene collections, and put the .json files somewhere safe.

My first request is for you to provide a full log file- preferably one when things started up properly, and one when things didn't work. You can either attach them here, or from the Help menu in OBS select Log Files --> Upload Current Log File and provide the link it gives you. This will let me see what other plugins you have installed, so I can determine if that might be part of the issue.

I notice that it is having trouble loading the composite and mix effect files. This does narrow it down somewhat. Are you using the Background For Compositing feature in any of your blurs? Also, do you notice it crashing on startup if you have a particular scene open when you quit OBS? That also could lead us to what is causing the issue.

One thing you can try right away- can you update to the latest version of the plugin? v1.0.6? On the off chance that some of your .effect files have gotten corrupted, updating would re-install them.

Artificiangel commented 11 months ago

(Pre update to v1.0.6) log_new_version.txt log_old_version.txt

And speaking about updates, I believe I was originally using 1.0.3 when I noticed the issue and updated the plugin to see if that would fix the issue. After the update OBS worked properly until the next day where the issue of blur filters not loading in started again.

Background For Compositing I am only using the composite filter in one source.

Particular scene open No, the scenes that I would quit on are relatively similar, most containing the same nested scenes. When starting OBS it often freezes for a few seconds. (Same happens with the older version) I'm fine with waiting 15 seconds to boot up as long as everything loads in the end.

Loading times I was cleaning up a scene collection of unnecessary sources. Loading into this scene I found OBS opened in half the time and there were no issues with the blur filters. (29.1.3) I thought one of my sources/scenes might have been causing an issue so I duplicated the original and started deleting the same set of sources/scenes one by one and restarting OBS in between. After deleting around 10 sources and a few scenes OBS suddenly was faster again and the plugin loaded perfectly. (Note: all those deleted sources were disabled)

I duplicated the original scene collection again, and only deleted those last 2 items before that last restart and I found no change. OBS was slower to start and blur filters did not load.

My conclusion is I hit a threshold of too many sources, but it is strange that it can work just fine being 1 source below that threshold. I will try creating a new scene and adding a bunch of random media sources until it slows OBS and blur starts working to make sure that's the issue.

This also explains why I didn't notice a problem until a few days after updating OBS to 29.1.3. Because I was slowly adding to my setup and must of hit this threshold at that time.

Artificiangel commented 10 months ago

After updating to 1.0.6: (Also made sure to restart the pc, last time things worked for the first day until I restarted)

OBS 29.1.3 loads the blur filter properly for the large scene collection I currently use (Version 3, I'll call it) But I found the scene collection, Version 2, has the problem with the blur filter. Even switching between them without restarting OBS, V3 will work with the blur filter, and then it breaks when switching to V2, then work again when I switch back.

Just to make sure, I downgraded to OBS 29.0.2, it was able to load both V3 and V2 scene collections fine with the blur filter.

FiniteSingularity commented 10 months ago

Sorry about the delayed response. The day got away from me today.

I'm wondering if there might either be some interaction of plugins causing your issue, or some issue with how sources are being loaded/processed by the filter chain. The behavior you are describing is pretty hard to reproduce. Would you be able to export your scene collection for V2 (the one that is causing the issues), and post the json file here? I'd like to take a look at it, and see if I can determine what might be going on.

In the meantime, is the working V3 set of scenes still working for you, and implementing everything you need? It might take me a few days to try to reproduce the issue with the scene collection .json file.

Artificiangel commented 10 months ago

GS_2b.json

Yes, the current version (V3) I'm using seems to consistently load the blur filter. The switch between 29.0.2 and 29.1.3 isn't too drastic, I just like keeping up to date when I can. That's not a requirement for me, not in any hurry with this issue.

One of the main plugin requirements for this setup is: 'Clone source' Everything else is unnecessary for the testing. I think the "loading" scene is all that's necessary for testing OBS startup. It has minimal plugin requirements and sources. Many of the sources are hidden, only one source is shown in the background scene at a time.

What I have noticed is since I updated to Composite Blur 1.0.6, the blur filter not loading isn't very consistent. Sometimes I would remove a filter or source, restart OBS, and it works, then add it back and it still works for the next couple of restarts, and then break again. Sometimes taking a break and starting OBS will break the blur filter again as if OBS doesn't immediately let go of the filter on close.

FiniteSingularity commented 10 months ago

Hi @Artificiangel- I haven't been able to reproduce this even with your scenes, which makes it a bit hard to debug. I'm going to close this issue for now, but if you start having issues with it again, please feel free to re-open the issue with more details.