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
382 stars 31 forks source link

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

Closed FiniteSingularity closed 9 months ago

FiniteSingularity commented 1 year ago

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

GPU

FiniteSingularity commented 1 year ago

A Workaround is to turn off SRGB blending off for the blurred source (facecam in the example above).

image

This seems to be due to a different rendering pipeline being used for cropped sources. See https://github.com/obsproject/obs-studio/blob/321829d9324f7b82ef362ccc85f6dd053865080c/libobs/obs-scene.c#L550 (Thanks @exeldro for finding this).

exeldro commented 1 year ago

might need look into source output flag OBS_SOURCE_SRGB and video_get_color_space from the struct obs_source_info like: https://github.com/obsproject/obs-studio/blob/321829d9324f7b82ef362ccc85f6dd053865080c/plugins/obs-filters/nvidia-greenscreen-filter.c#L1068

FiniteSingularity commented 9 months ago

This appears to have been fixed by #95