finitesingularity / obs-composite-blur Goto Github PK
View Code? Open in Web Editor NEWA comprehensive blur plugin for OBS that provides several different blur algorithms, and proper compositing.
License: GNU General Public License v2.0
A comprehensive blur plugin for OBS that provides several different blur algorithms, and proper compositing.
License: GNU General Public License v2.0
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 ''
The current build process for Linux creates a non-standard set of locations for the binary and data files, as pointed out by @dnaka91 in their documentation PR.
After some discussion, it is suspected that passing -DLINUX_PORTABLE=OFF
during the linux package build should fix this.
Describe the bug
When applying the Gaussian Zoom blur, there is a strange repeating of pixels at higher blur radius.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Blur should be nice and smooth, like zoom blur with the box blur.
Screenshots
Gaussian Zoom Blur Artifacts
Two Pass Box Blur- No artifacts.
Environment
Additional context
A workaround until this is fixed- 2-pass Box Zoom blur looks great, and is a viable alternative.
Is your feature request related to a problem? Please describe.
Currently the rotation of the generated pixelate tessellations is fixed. The user should be able to rotate the tessellation pattern to any arbitrary value.
Describe the solution you'd like
Provide an angle
slider that is then used to generate a rotational transform of the generated pixels. This transformation can be combined with the translation transform needed for issue #65.
Bokeh blur is used to simulate the effect of camera aperture blur in real scenes. In green screen type live broadcasts, it can map one of a set of depth maps based on the distance of the external TOF sensor, and then combine this depth Image to add bokeh blur to the keyed background to achieve a more realistic composite effect.
Currently, I use the glfx.js library to add lens blur to videos in the browser. On the integrated graphics card of Intel 8400 CPU, the original video of about 1080p 30p only has 6-7 frames per second after processing.
So is it possible to implement this depth map + bokeh blur in real time? If it can be realized, it will be an improvement in green screen live broadcast .
this is the frames demo:https://drive.google.com/file/d/1kC__OF7FJfEUdqvfR5qis4hmy5Q2_Zqv/view?usp=sharing
Describe the bug
I suspect this happens because my home directory is on a removable drive. The installer brings up a prompt asking me if it can have permission to write to a removable drive. Before I can answer, the installer fails.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
successful installation
Screenshots
This image shows what happens
Environment
Describe the bug
If user selects no source, but there was an existing source before, the weak source is not released.
Expected behavior
We should not leak memory!
Additional context
In update function, wherever a weak source is checked, make sure to add pointer check and release if pointer already exists. e.g.:
if (color_source) {
obs_weak_source_release(filter->color_source);
filter->color_source =
obs_source_get_weak_source(color_source);
obs_source_release(color_source);
} else {
if (filter->color_source) {
obs_weak_source_release(filter->color_source);
}
filter->color_source = NULL;
}
Actually I would say this plugin works great, but I can't apply a mask like in StreamFX. I would like to set Left, Right, Top, Buttom edges.
I think this would be very much needed as sometimes I need to mask any area in the image
Describe the bug
Recently upgraded to 1.0.3. I use a move value transition to increase pixel size based on channel redeem, with initial setting of 1.00. After upgrading the filter creates a trail of the video. Only seems to be a problem when using chroma key. See image:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No trail.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
GPU
Additional context
Add any other context about the problem here.
Describe the bug
If a filtered source that uses background source for compositing option, is cropped, the background compositing is no longer performed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The facecam blur should not have a dark aura.
Environment
GPU
Is your feature request related to a problem? Please describe.
I just am looking for an easy way to toggle my BLUR via a Hotkey.
Describe alternatives you've considered
Tried the LUA script that exists for using Hotkeys for Filters but it resets every time I restart OBS and I want persistence.
Describe the bug
I am using the filter (in combination with move values) on an "output" type that I have within my DSK scene. The pixelation effects are not being applied to the video output consistently, let me explain.
Scene Structure
p: twitchui_full = production scene
g: dsk = source used within DSK
u: output = output source
On the "global_output" source, the filter(s) are applied.
Here are the base settings for the "degradation" Composite Blur filter:
The mv_degradation_* filters only change the "Pixel Size" parameter.
mv_degradation_low: 5px
mv_degradation_mid: 15px
mv_degradation_high: 35px
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
Pixelation should be applied to all elements of the video output at al sizes.
Screenshots
mv_degradation_low
Environment
Happy to debug on a live call together over Discord.
Is your feature request related to a problem? Please describe.
Currently, as you change the value of pixel size in the Pixelate algorithm, the pixels seem to "originate" from the upper left corner of the image. This is due to the origin of the pixel tessellation being at the source's (0.0,0.0)
coordinate.
Describe the solution you'd like
Provide a set of sliders that allow the user to set the tessellation origin to an arbitrary value. Then in the pixelate shader, perform a translation transformation to move the origin to the origin value set by the user.
Describe the bug
Somewhere along the line, I added some dev logging that was fired off every video tick, and I forgot to remove it.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Finite- you shouldnt be filling our hard drives with unnecessary logging!
Environment
Additional context
Apologies to anyone who was having gigantic log files generated. I've added a check for logging to my pre-release checklist.
Two new issues observed after latest update:
When using a 4K image source scaled down to 1080p via Scaling/Aspect Ratio filter as a blur mask, the mask only covers 1/4 of the frame instead of full frame. Seems it is using the original 4K mask size rather than scaled 1080p output.
Using a Dual Kawase blur with radius 0 causes the video to freeze, showing only the mask image over a frozen frame. Other algorithms work fine at radius 0.
Add 4K image source
Add Scaling/Aspect Ratio filter to scale to 1080p
Add 1080p video source to blur
Add Composite Blur to video, mask using scaled image source
Mask only covers 1/4 of frame
On new Composite Blur filter, set Dual Kawase algorithm and radius to 0
Video freezes, only mask image displays
The scaled 1080p mask should cover the entire 1080p frame of the blurred video source.
Dual Kawase blur with radius 0 should show unblurred source video under mask.
Previous alpha masking issue was fixed in latest update, but found these new bugs when testing further.
Describe the bug
When applying the Filter, the targeted source will go black and produce an error in OBS log.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The filter would be applied as normal.
Environment
GPU
Additional context
Other Blur effects appear as normal
02:42:20.891: User added filter 'Composite Blur' (obs_composite_blur) to source 'Waveform Visualizer'
02:42:20.908: Error compiling shader:
02:42:20.908: ERROR: 0:40: 'expression' : left of '[' is not of type array, matrix, or vector
02:42:20.908: ERROR: 0:40: '' : compilation terminated
02:42:20.908: ERROR: 2 compilation errors. No code generated.
02:42:20.908:
02:42:20.908:
02:42:20.908:
02:42:20.908: device_pixelshader_create (GL) failed
02:42:20.908: Pass (0) <> missing pixel shader!
02:42:20.908: [obs-composite-blur] Unable to load .effect file. Errors:
02:42:20.908: (None)
Hi, I would like to suggest that this plugin should include a clear build instruction that everyone is able to follow along, not just using premade binaries. Thanks.
Is your feature request related to a problem? Please describe.
A commonly used blur in streaming for adding privacy when needed is a pixelation blur effect.
Describe the solution you'd like
Add a new blur algorithm called "Pixelate." It should have the following inputs:
Describe alternatives you've considered
N/A
Additional context
N/A
Describe the bug
filtered source changes size when background source for compositing is used
To Reproduce
Expected behavior
Only correct compositing when the source is top left, but always correct source size.
Screenshots
Without Background Source for Compositing:
With Background Source for Compositing:
Environment
GPU
Additional context
Is your feature request related to a problem? Please describe.
Currently the CI/CD github action builds without a verified apple developer token, which makes the installation process on MacOS much more cumbersome.
Describe the solution you'd like
The CI/CD and cmake build pipeline allows for an Apple verified developer token to be used. I have a paid/verified Apple developer account, and can provide a proper token so that MacOS installs are much more streamlined.
Additional context
I just need to dig through and figure out how I need to store my token in Github's secrets, and how to bring it into the build process.
Describe the bug
I am seeming to get a runaway memory leak in certain conditions when using the Composite Blur plugin when I switch between scenes that have a composite blur filter applied to Window or Game Capture sources, when the sources are active, but the sources have no application to connect to (therefore the filter is being applied to nothing).
The example in this case occurs when switching between a scenes containing a desktop capture source, a scene containing a Chrome window capture source, a scene containing a game capture source that is visible but the game is not running and a scene containing an application capture source that is visible but the application is not running. Both of this capture sources have a composite blur filter applied to them using:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect that the Composite Blur filter being applied to the capture source is not being applied to the source when there is not texture to render.
Environment
GPU
Additional context
Early investigation by FiniteSingularity: "I have an early exit for the filters if they don't see a texture to blur. I was properly cleaning things up, but didn't early-exit the masking code. So, its the attempted mask on the non-running source that is causing the issue, not the non-running source itself."
Describe the bug
When trying to set up pixelate filter on a source and using Exeldro's Move Value transition alongside this plugin I am unable to set the value of the idle filter to 0 px which causes a slight blur on the source. Setting the value to 0 would allow for the filter to be active and use the move value transition to animate the blur on and off.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect that I should be able to set the value to 0 so that I can use the transition to adjust the value between 0 and a positive number.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Describe the bug
Not sure if its a bug, but I think in reported in case it is one. When working with semi-transparent sources, and apply the blur filter, I notice some colors changes a little, and this is augmented when multiple blurs are activated.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
To not change the opacity and/or colors?
Environment
GPU
Describe the bug
When adding a filter through the OBS WebSocket, It makes the source black/invisible until the filter menu is open, This happen with all sources, With normal sources being invisible, And with captures being black.
To Reproduce
Steps to reproduce the behavior:
const { default: OBSWebSocket } = require('obs-websocket-js');
const obs = new OBSWebSocket();
// Configuration
const obsHost = 'localhost'; // OBS WebSocket host
const obsPort = 4444; // OBS WebSocket port
const obsPassword = 'PASSWORD'; // OBS WebSocket password
async function applyEffectToSources() {
try {
// Connect to OBS WebSocket
await obs.connect(`ws://${obsHost}:${obsPort}`, obsPassword);
console.log('Connected to OBS WebSocket');
// Get the current scene
const { currentProgramSceneName } = await obs.call('GetCurrentProgramScene');
console.log(`Current scene: ${currentProgramSceneName}`);
obs.on('SourceFilterSettingsChanged', data => {
console.log(data);
});
// Get all sources in the current scene
const { sceneItems } = await obs.call('GetSceneItemList', { sceneName: currentProgramSceneName });
// Apply the "Composite Blur" effect to each source
for (const item of sceneItems) {
console.log(`Applying Composite Blur to source: ${item.sourceName}`);
const { filters } = await obs.call('GetSourceFilterList', { sourceName: item.sourceName });
const filterExists = filters.some(filter => filter.filterName === 'Composite Blur');
if (!filterExists) {
await obs.call('CreateSourceFilter', {
sourceName: item.sourceName,
filterName: 'Composite Blur',
filterKind: 'obs_composite_blur',
});
console.log(`Filter 'Composite Blur' applied to source: ${item.sourceName}`);
} else {
console.log(`Filter 'Composite Blur' already exists on source: ${item.sourceName}`);
}
}
// Disconnect from OBS WebSocket
//await obs.disconnect();
console.log('Disconnected from OBS WebSocket');
} catch (error) {
console.error('Failed to apply effect:', error);
}
}
applyEffectToSources();
)
3. And upon executing the NodeJS script, It just applies the effect but sources go invisible and captures goes black Until the filters menu have been brought up.
Expected behavior
To apply the effect without making the sources invisible / black
Environment
GPU
Additional context
Thank you for an amazing plugin.
Describe the bug
Hello ! I run OBS on a Mac Studio M1 Max. I installed the universal version, and then tried the arm64 version from last release, but I can't find the filter in OBS after installing plugin.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Find the composite blur filter from the filter list.
Environment
Is your feature request related to a problem? Please describe.
Currently, the Tilt-shift inputs require the user to provide the fractional distance from the top and fractional distance down from the bottom that defines where the focused zone starts/ends. This is somewhat cumbersome and hard to tweak.
Describe the solution you'd like
Change the interface to define the distance to the center of the focused zone, the width of the focus zone, and the angle the zone is at. This gives significantly more flexibility, and makes tracking/moving the zone of focus much easier.
Describe alternatives you've considered
N/A
Additional context
N/A
Hey, I've wrote up a suggestion for anyone to pick up if they find it interesting:
An OBS video filter that does frame blending, aka doing motion blur with the excess frames that are captured with e.g. a Game Capture source.
People have been doing this effect for video game footage in post with NLEs for years, and a filter doing it before it even gets encoded would eliminate the huge burden of encoding, storing and processing high framerate footage.
The earliest mention of something like this in OBS: https://ideas.obsproject.com/posts/835/add-frame-blending-option-to-game-capture-faux-motion-blur
I generated an OBS plugin template that has the same goal, and in the README linked a bunch of implementations in other software for people to get familiar with the concept:
Currently the documentation for installation is not great. All three platforms have some potential "gotcha's" that aren't outlined. The plan is to add a docs
directory to the root project, and have separate pages for Windows, MacOS, and Linux. Then we can link from the main README.md
file to the platform specific installation pages.
Is your feature request related to a problem? Please describe.
Currently the Pixelate filter only samples the pixel at the very center of the larger pixel. This creates pixels that can flicker quite a bit as the source moves, and the color value at the exact center of the pixel changes.
Describe the solution you'd like
A smoothing factor should be added where at higher values rather than just sampling the center pixel, the filter will sample a larger area average color. To do this, one could easily use a pass of the Dual Kawase filter before sampling, with very little impact on performance. This smoothing value might range from zero (no smoothing) to 1, where an equivalent area to the total pixel size is sampled.
Describe alternatives you've considered
This can currently be simulated by adding two stacked composite blur filters- a Kawase Blur, then a pixelate. As it is a common use case, it would be convenient to have this as a built-in option.
Is your feature request related to a problem? Please describe.
The OBS HLSL conversion is slightly different between Windows OBS which uses Direct3D and Mac/Linux OBS which uses OpenGL. Currently OBS HLSL does not properly pass array data from OBS to the shader on OpenGL-based systems. This breaks the table lookup for Gaussian blurring, and thus doesn't work on these systems.
Describe the solution you'd like
This problem can be solved by using a texture lookup rather than a table lookup for OpenGL systems. A texture lookup is not as efficient as a table, and thus tables should be preferred where available. In order to implement this, the following must take place:
#ifdef
directives. Change the included gaussian functions depending on OS.gs_texture_t
, and copy the Gaussian LUTs to this texture. The texture should have dimensions of [LUT.num, 1]
. The R values should be the Gaussian weight, and G should be the linearly interpolated offset value.Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
There are only two ways to officially install OBS on Linux.
Describe the solution you'd like
I'd ask for a flatpak version of the plugin. (Maybe under the prefix com.obsproject.Studio.Plugin.CompositeBlur)
Describe alternatives you've considered
I tested the unofficial build of OBS from the Fedora repos but they aren't updated as much. I also had a bug where the Fedora version of OBS wouldn't use the NVENC encoder while recording or streaming (My system had the latest Nvidia drivers which were in the repos).
Additional context
This may seem as a very selfish request and maybe is but the benefit of a Flatpak version would be
Describe the bug
OBS no longer allows global plugins for the arm version of OBS as outlined in this PR here: obsproject/obs-studio#7089 . However, in some cases, the MacOS installer will allow you to do a global plugin install (installing the plugin in /Library
rather than in /Users/<username>/Library
), which will then not be loaded by OBS. This issue was originally seen in this support request: #60 .
Expected behavior
When installing on an arm-based Mac, the installer should not allow the user to install the plugin globally.
My Issue:
Encountering a scaling display issue when trying to add a composite blur to a section of my screen - my starting use case is to simply obscure the chat window in the lower left side of my game screen. My source is coming in as a Display Capture of my 1440p monitor into my 1080p profile, and I scale this larger source down to fit. Adding the basic Composite Blur (any algorithm) appears to work fine. However, when I try to apply any of the of the Effect Masks (barring "Source") using any of the blur algorithms, it removes my source scaling and cuts off the lower right area outside of the profile's base resolution. For many reasons, I am not willing to convert my project to the base resolution of my 1440p display.
I tested originally using my 1440p display monitor source, which initially showed the unexpected behavior. To test I tried on a 1080p display monitor source and it behaved as I would expect. I then tried on another type of source which I knew to be larger than 1080p in width (a PNG image file with dimensions of 2160x1350), and the same unexpected scaling behavior occurred.
I also attempted to apply the filter to the SCENE which singularly contained the source I wished to have the blur applied to, and the same unexpected behavior occurred.
Steps to reproduce the behavior:
Expected Behavior:
My hope is that the filter and effect mask would be applied to the entire source image instead of affecting only the unscaled base profile resolution, as I have plenty of larger-than-1080p sources that are brought in scaled.
Screenshots
Image 1: Displays the aspect of the source
Image 2: Displays the expected behavior of the default Composite Blur added to the source, covering the entire image.
Image 3: After Crop effect mask applied, showing the scaling removal of the source.
Image 4: Attempting to scale down the source again in the scene and revealing the content outside of the 1920x1080p is no longer visible. Tried hitting alt while pulling at those sides and nothing was able to be extended to its normal aspect.
Environment
GPU
Describe the bug
Dual Kawase only supports 1+ pixels. If a zero pixel value is input (via something like Move Value) the source starts to blink.
To fix this I need to set a check on the input pixel value, and if it is less than 1, set the value up to 1. Never trust user input.
Describe the bug
The preview for a source in it's properties looks normal but when actually looking at the OBS preview and output, there are duplicates of the source. The repro steps mention a browser source but I confirmed this to be the case on media source as well.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Blur should be applied, nothing additional.
Environment
Additional context
https://obsproject.com/logs/mL5FXDLV1eE3p6J5
Is your feature request related to a problem? Please describe.
Using linear interpolation for Box Blur reduces the number of texture calls required by 50% with no quality loss. It is currently implemented and working for the 1D Box Blur shaders (which is used for Area and Motion blurs), but needs to be implemented for Radial and Tilt-Shift.
Describe the solution you'd like
Implement linear interpolation in:
box_radial.effect
box_tiltshift.effect
Describe alternatives you've considered
N/A
Additional context
N/A
When using the Composite Blur filter and trying to mask using a source with alpha information, the mask does not work as expected.
I expected the alpha channel of the image source to properly mask the blur effect on the video source.
I am scaling a 4K PNG image source with transparency down to 1080p using chroma key filters, and attempting to use it to mask blur on a 1080p video source. It seems like the mask functionality is not working properly in this case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.