Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't apply filter to source mirror #26

Closed
hatzel opened this issue Jun 7, 2021 · 5 comments
Closed

Can't apply filter to source mirror #26

hatzel opened this issue Jun 7, 2021 · 5 comments

Comments

@hatzel
Copy link

hatzel commented Jun 7, 2021

Hi, not sure if what I was trying is even possible, but I wanted to build a blurred background thing by having the same v4l source once with and once without background removal. (For context, blur filters are, for example, available in streamfx).

Since you can't have two instances of the webcam input with different filters I used source mirrors, but I can't seem to add the background removal filter to a source mirror. The add menu opens up fine, I can name it but after pressing "OK" nothing happens (i.e. no filter appears in the menu, the effect is not applied). I get this output in the log:

info: [obs-backgroundremoval] Model input shape 3 x 320 x 320, output shape 2 x 320 x 320
info: User added filter 'Background Removal' (background_removal) to source 'Source Mirror 2'
info: [obs-backgroundremoval] Destroy scalers.

I am using the PGBUILD for Arch provided on master (currently commit ab91510) and version 27.0.0-1 of the official package on Arch.

On a side note, shouldn't the filter be an effect filter? Not really familiar with OBS but it seems that working the same way as the Chroma Key filter would make sense :)

Really happy that you built this plugin, thanks for putting in the work!

@ItachiSan
Copy link

The same issue happens on Window, with latest versions of OBS & BG removal.

As the issue author posted, the issues are:

  • The filter cannot be applied to a Source Mirror (provided from StreamFX)
  • The filter is considered to be an audio filter rather than an effect

As this is the only plugin integrated with OBS and with nice results, it would be great to have it working 😄
If I can contribute in any way, please let me know.
I know some C/C++ but nothing about OBS plugin creation / hacking.

@giovanith
Copy link

Hello, same thing here...
OBS running fine in W10, as well as Backgrground Removal. But it would be useful if possible use as an filter, instead an audio effect (to create a blurred background as already commented). Thanks

@Zahrun
Copy link

Zahrun commented Oct 14, 2021

Hey, I found a way to use the background removal together with blur background effect:

  1. Start webcamoid
  2. Go to camera source, select source and resolution
  3. Go to preferences and enable virtual camera output
  4. In OBS, add V4L2 selecting the webcamoid virtual output
  5. You can add two: one with obs-backgroundremoval and the other with StreamFX blur

If you also want to use the OBS virtual camera output:

  1. Stop obs
  2. Unload v4l2loopback module sudo rmmod v4l2loopback
  3. Load it again with two devices sudo modprobe v4l2loopback devices=2
  4. Start webcamoid
  5. Go to camera source, select source and resolution
  6. Go to preferences and enable virtual camera output
  7. Make sure the device selected is the second one because OBS will use the first one
  8. Uncheck virtual camera box and recheck virtual camera box to apply the change of device
  9. In OBS, add V4L2 selecting the webcamoid virtual output
  10. You can add two: one with obs-backgroundremoval and the other with StreamFX blur
  11. Start Obs virtual camera, it should take the other v4l2loopback device

Good luck!

@Zahrun
Copy link

Zahrun commented Oct 22, 2021

@Zahrun Another option is the NDI plugin. You can add an NDI output filter to your cam source and create several NDI sources from it that you can use to apply the blur effect and the background removal filters.

as mentionned in #34 (comment)

@royshil
Copy link
Collaborator

royshil commented Mar 18, 2023

this should now work for other resources than just cameras

@royshil royshil closed this as completed Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants