Coder Social home page Coder Social logo

finitesingularity / obs-composite-blur Goto Github PK

View Code? Open in Web Editor NEW
354.0 354.0 28.0 10.34 MB

A comprehensive blur plugin for OBS that provides several different blur algorithms, and proper compositing.

License: GNU General Public License v2.0

CMake 15.38% Shell 2.80% C 81.82%

obs-composite-blur's People

Contributors

allcontributors[bot] avatar bruchmann avatar cooliguay avatar dnaka91 avatar exeldro avatar finitesingularity avatar sketchni avatar xurei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

obs-composite-blur's Issues

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

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

  • OS/Version: Windows 10
  • OBS Version: 29.1.3
  • Composite Blur Plugin Version: 1.0.5
  • Blur Algorithm/Type: Dual Kawase

GPU

  • GPU make/model RTX 2080TI
  • GPU VRAM 11GB

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 ''

[BUG] - Artifacting in Gaussian Zoom blur.

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:

  1. Add a source.
  2. Apply Gaussian Zoom to it.
  3. Set the blur radius to 7.0 or higher
  4. Look to the outside of the source.

Expected behavior
Blur should be nice and smooth, like zoom blur with the box blur.

Screenshots
image
Gaussian Zoom Blur Artifacts

image
Two Pass Box Blur- No artifacts.

Environment

  • Composite Blur Plugin Version: 1.0.0
  • Blur Algorithm/Type: Gaussian Zoom

Additional context
A workaround until this is fixed- 2-pass Box Zoom blur looks great, and is a viable alternative.

[FEATURE] - Pixelate Rotation

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.

[FEATURE] - Combined with depth map to achieve bokeh blur to obs source

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

[BUG] - MacOS installer fails

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:

  1. Create a user with a home directory on a removable drive
  2. Log in as that user
  3. Attempt to install using the Mac installer
  4. See error

Expected behavior
successful installation

Screenshots
This image shows what happens
Screenshot 2024-06-12 at 2 59 43 PM

Environment

  • OS/Version: MacOS 14.5
  • OBS Version: 30.1.2
  • Composite Blur Plugin Version: 1.1.0

[BUG] - Small memory leak in source handling

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;
	}

Blur Filter - Edge

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

https://prnt.sc/uYcY1NmzziCU

[BUG] - Pixelate causes strange behavior when set to 1px

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:

  1. Go to create new composite blur filter
  2. Select Pixel (Any variation works)
  3. Set pixel size value to 1.00
  4. Notice trail
  5. Increase pixel size value to >1.00 (1.01 worked)
  6. Notice trail disappears

Expected behavior
No trail.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Environment

  • OS/Version: [e.g. Windows 11]
  • OBS Version: [e.g. 29.1.2]
  • Composite Blur Plugin Version: [e.g. 1.0.3]
  • Blur Algorithm/Type: [e.g. Blur, Area]

GPU

  • GPU make/model [e.g.- nvidia RTX 3070]
  • GPU VRAM [e.g.- 8Gb]

Additional context
Add any other context about the problem here.

[BUG] - Composite Background option not working when filtered source is cropped.

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:

  1. Make a chroma-keyed facecam.
  2. Place a solid light colored source behind the chroma keyed facecam.
  3. Apply a gaussian blur to the face cam.
  4. Set the color source as background source for compositing.
  5. Witness the dark aura around the facecam.

Expected behavior
The facecam blur should not have a dark aura.

Screenshots
Before cropping
image

After cropping
image

Environment

  • OS/Version: Windows 11
  • OBS Version: Some dev version
  • OBS Composite Blur Plugin Version: 0.0.7-alpha with Exeldros PR merged in
  • Blur Algorithm/Type: All

GPU

  • GPU make/model: Nvidia RTX 3800
  • GPU VRAM: 12Gb

[FEATURE] - Toggle Filters via Hotkey

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.

[BUG] - Pixelation doesn't apply consistently on

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
Screenshot 2024-08-06 at 17 21 31
Screenshot 2024-08-06 at 17 23 28
Screenshot 2024-08-06 at 17 23 40

On the "global_output" source, the filter(s) are applied.
Screenshot 2024-08-06 at 17 24 07

Here are the base settings for the "degradation" Composite Blur filter:
Screenshot 2024-08-06 at 17 24 49

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:

  1. Set up environment as specified in above settings
  2. Apply pixelation of > 5px
  3. See inconsistent application of pixelation

Expected behavior
Pixelation should be applied to all elements of the video output at al sizes.

Screenshots
mv_degradation_low
low

mv_degradation_mid
mid

mv_degradation_high
high

Environment

  • OS/Version: MacOS 14.5 Sonoma
  • OBS Version: 30.2.2
  • Composite Blur Plugin Version: 1.1.0
  • Blur Algorithm/Type: Pixelate

Happy to debug on a live call together over Discord.

[FEATURE] - Pixelate Tessellation Origin.

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.

[BUG] - Excess Logging in 0.0.7a

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:

  1. Use 0.0.7 or possibly earlier, and open your logs. UGH.

Expected behavior
Finite- you shouldnt be filling our hard drives with unnecessary logging!

Environment

  • OBS Composite Blur Plugin Version: 0.0.7-a and possibly earlier.

Additional context
Apologies to anyone who was having gigantic log files generated. I've added a check for logging to my pre-release checklist.

[BUG] - Masking bugs when using scaled source and radius 0

Describe the bug

Two new issues observed after latest update:

  1. 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.

  2. 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.

To Reproduce

  1. Add 4K image source

  2. Add Scaling/Aspect Ratio filter to scale to 1080p

  3. Add 1080p video source to blur

  4. Add Composite Blur to video, mask using scaled image source

  5. Mask only covers 1/4 of frame

  6. On new Composite Blur filter, set Dual Kawase algorithm and radius to 0

  7. Video freezes, only mask image displays

Expected behavior

  1. The scaled 1080p mask should cover the entire 1080p frame of the blurred video source.

  2. Dual Kawase blur with radius 0 should show unblurred source video under mask.

Screenshots

https://streamable.com/d4we20

Environment

  • OBS Version: 30.0.3 beta
  • Composite Blur Version: 1.0.2
  • GPU: Nvidia RTX 2080 Ti
  • Windows 11

Additional context

Previous alpha masking issue was fixed in latest update, but found these new bugs when testing further.

[BUG] - Attempting to apply filter causes the source to blank out

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:

  1. Attempt to apply the Gaussian Filter
  2. Encounter an error where the source blanks out.

Expected behavior
The filter would be applied as normal.

Environment

  • OS/Version: Windows 10 Pro 22H2 (19045.3324)
  • OBS Version: 29.1.3
  • Composite Blur Plugin Version: 1.0.1
  • Blur Algorithm/Type: Gaussian

GPU

  • GPU make/model: MSI AMD RX 480
  • GPU VRAM: 8GB

Additional context
Other Blur effects appear as normal

Relevant Error

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)

[FEATURE] - Pixelation Blur Effects

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:

  • Different tessellations as the available types, e.g.- Square, Hexagon, Triakis, etc.
  • Tessellation size- how large a pixel/pattern is.
  • Toggle for smoothing- if turned on, this will blur the frame before pixelating it, smoothing out jumps in color during movement.
  • Smoothing Amount- How much should the preprocessor blur the frame before pixelating.
  • Background Composite

Describe alternatives you've considered
N/A

Additional context
N/A

[BUG] - source size wrong when using background source for compositing

Describe the bug
filtered source changes size when background source for compositing is used

To Reproduce

  1. Have a full scene background source for compositing
  2. Add a text source on top
  3. Add blur filter on the text source
  4. Set background source for compositing

Expected behavior
Only correct compositing when the source is top left, but always correct source size.

Screenshots
Without Background Source for Compositing:
image
With Background Source for Compositing:
image

Environment

  • OS/Version: Windows 11
  • OBS Version: 30.0.0-beta2
  • OBS Composite Blur Plugin Version: 4c833c8
  • Blur Algorithm/Type: Gaussian, Area

GPU

  • GPU make/model nvidia RTX 2060
  • GPU VRAM 6Gb

Additional context

[FEATURE] - Include Apple Verified Developer token in MacOS builds

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.

[BUG] - Runaway memory leak with Composite Blur filter applied to capture source with no connected application

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:

  1. Create two scenes, (a) one being blank and (b) one with a Window/Game capture source of an open application and apply a Composite Blur filter against the captured sourced BUT importantly, close the application so that the source is not connected to the application.
  2. Navigate to the blank scene (a).
  3. Navigate back to the scene with the Composite Blur filter (b) and notice that the memory allocated to OBS runs away to max capacity in a few seconds.

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

  • OS/Version: Windows 10
  • System RAM: 32GB DDR4
  • OBS Version: OBS Studio 30.0 Beta 3
  • Composite Blur Plugin Version: Release 1.0.4
  • Blur Algorithm/Type: Occurs on all algorithm types.

GPU

  • GPU make/model: Nvidia RTX 3070
  • GPU VRAM: 8 GB GDDR6

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."

[BUG] - Cannot set 0 value on Pixelate filter

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:

  1. Add a move transition filter (assuming use of Exeldro's plugin)
  2. Attempt to set the value in the move transition settings to 0.
  3. Notice that you are unable to set to anything below 0.

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

  • OS/Version: [e.g. Windows 11]
  • OBS Version: [e.g. 29.1.2]
  • OBS Composite Blur Plugin Version: [e.g. 0.0.5-alpha]
  • Blur Algorithm/Type: [e.g. Pixelate]

[BUG] Opacity and colors changes when blur is activated

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:

  1. Create a semi transparent source. (In the example I use a a color one)
  2. Activate the blur filter
  3. Notice the opacity and/or colors change a little.

Expected behavior
To not change the opacity and/or colors?

Screenshots
image

Environment

  • OS/Version: Windows 11
  • OBS Version: 30.0.0
  • Composite Blur Plugin Version: 1.0.6
  • Blur Algorithm/Type: All

GPU

  • GPU make/model: Nvidia GTX 1650
  • GPU VRAM: 4Gb

[BUG] - Adding filter through OBS WebSocket makes the Display Capture black/invisible until the filters menu is opened [ Any other source as well ]

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:

  1. Download OBS WebSocket
  2. Use any WebSocket Library ( I used NodeJS:
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

Screenshots
image

Environment

  • OS/Version: Windows 10
  • OBS Version: 30.0.2
  • Composite Blur Plugin Version: 1.1.0
  • Blur Algorithm/Type: Any

GPU

  • GPU make/model : NVIDIA GeForce GTX 1660 SUPER
  • GPU VRAM: 14 Gbps GDDR6 VRAM

Additional context
Thank you for an amazing plugin.

[BUG] - Can't find filter in OBS for macOS

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:

  1. Install plugin
  2. Filter not available

Expected behavior

Find the composite blur filter from the filter list.

Environment

  • OS/Version: macOS Ventura
  • OBS Version: 29.1.3
  • Composite Blur Plugin Version: 1.0.2

[FEATURE] - Improve tilt-shift inputs/UI

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

[FEATURE] - Filter: Temporal Blur (frame blending)

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:

https://github.com/couleurm/smooth-mode

[DOCS] - Add detailed installation documentation for all platforms.

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.

[FEATURE] - Pixelate Smoothing

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.

[FEATURE] - Gaussian blur for OpenGL based OBS installs.

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:

  • At compile time, detect OS being compiled for using #ifdef directives. Change the included gaussian functions depending on OS.
  • For the OpenGL implementation, generate an RGB 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.
  • Create variations of the Gaussian shaders that use a texture lookup call rather than table indexing to retrieve the gaussian weight and offset.

Describe alternatives you've considered
N/A

Additional context
N/A

[FEATURE] - Linux: Flatpak version of the plugin

Is your feature request related to a problem? Please describe.
There are only two ways to officially install OBS on Linux.

  1. The PPA for Ubuntu and Ubuntu-based distros and
  2. the Flatpak build of OBS for all other distros like Fedora or Arch. (I know there are unofficial releases for these distros but they will also not get any support from the OBS project, so the only official way is the Flatpak for distros other than Ubuntu)

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

  1. the plugin would be automatically updated when the User updates the Flatpak packages and
  2. the plugin wouldn't be removed when the User updates and they had installed it. At this time a plugin would be removed if a user updates the flatpak version of OBS.
    (Added point that I only saw while writing this request: On Fedora a user can install OBS plugins from the GNOME Software app)

[BUG] - Mac installer on Apple Silicon systems should not allow root install.

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.

[BUG] - Masking causes incorrect scaling of sources that aren't the same size as the canvas

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:

  1. In OBS, select a source that is natively larger than the OBS base resolution and is scaled down to fit (or a scene that contains a source meeting the same criteria) to apply the Composite Blur filter to.
  2. Right-click the selected source and choose "Filters".
  3. Click the "+" at the bottom left of the new Filters window and select the "Composite Blur" filter.
  4. Name the filter and/or click "OK".
  5. Select Blur Algorithm: (any)
  6. Select Effect Mask: (Any except "None" or "Source")
  7. The source resets it's scaling transform and the bottom right corner content of that source is cut off outside of the base resolution pixels (in my case 1920x1080).

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
BlurIssue1

Image 2: Displays the expected behavior of the default Composite Blur added to the source, covering the entire image.
BlurIssue2

Image 3: After Crop effect mask applied, showing the scaling removal of the source.
BlurIssue3

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.
BlurIssue4

Environment

  • OS/Version: Windows 11 Home, Version 22H2, OS Build 22621.2134
  • OBS Version: 29.1.3
  • Composite Blur Plugin Version: 1.0.0
  • Blur Algorithm/Type: All algorithms, All effect masks (except None and Source).

GPU

  • GPU make/model: NVIDIA RTX 3080
  • GPU VRAM: 10GB
  • GPU Driver: GeForce Game Ready Driver 537.13 (8/22/2023)

[BUG] - Dual Kawase blur is broken at zero pixel size.

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.

[BUG] - Blur duplicating a source

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:

  1. Open OBS
  2. Add a new browser source (you can leave all the default settings)
  3. Add a composite blur filter to the browser source

Expected behavior
Blur should be applied, nothing additional.

Screenshots
image

Environment

  • OS/Version: Windows 11
  • OBS Version: 30.0.0 beta 2, also confirmed on 29.1.3 as well.
  • OBS Composite Blur Plugin Version: 0.0.3
  • Blur Algorithm/Type: Any besides Dual Kawase

Additional context
https://obsproject.com/logs/mL5FXDLV1eE3p6J5

[FEATURE] - Implement linear interpolation for Box Radial and Box Tilt Shift shaders.

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

[BUG] - Masking with source alpha not working as expected

Describe the bug

When using the Composite Blur filter and trying to mask using a source with alpha information, the mask does not work as expected.

To Reproduce

  1. Add an image source with chroma key filters applied to create transparency
  2. Add a 1080p video source to blur
  3. Add Composite Blur filter to video source
  4. Set Composite Blur to mask using the image source
  5. The mask has no effect on the blur

Expected behavior

I expected the alpha channel of the image source to properly mask the blur effect on the video source.

Screenshots

https://streamable.com/65y76i

Environment

  • OS/Version: Windows 11
  • OBS Version: 30 beta
  • Composite Blur Plugin Version: 1.0.1
  • Blur Algorithm/Type: Dual Kawase, Area

GPU

  • GPU: Nvidia RTX 2080 Ti
  • VRAM: 11Gb

Additional context

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.