Skip to content

A high-performance, crash-resistant OBS plugin for real-time background removal. Optimized for minimal CPU/GPU usage without a green screen.

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
LICENSE.GPL-3.0-or-later
MIT
LICENSE.MIT
Notifications You must be signed in to change notification settings

kaito-tokyo/live-backgroundremoval-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

498 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Live Background Removal Lite

A gaming-first, high-performance, and crash-resilient background removal for OBS Studio

Overview

Live Background Removal Lite is a lightweight OBS effect filter plugin designed to remove backgrounds from your portrait sources. We make resource consumption minimal to avoid affecting your gameplay, and we always develop this plugin with a priority on stability.

Download Latest Release

Demo

A cluttered background was removed from my portrait source.

A cluttered background was removed from my portrait source.

Requirements

  • OBS Studio 31.1.1 or later
  • OS Windows, Mac, Linux (Ubuntu, Arch Linux, Flatpak)
  • This plugin does not require CUDA or ROCm.

Development policy

We prioritize the compliance and ethics of our software projects as a member of the global OSS community, and take the LLM concerns seriously. While we use LLM-based code reviews to ensure that the quality of our software is satisfactory for every streamer, we always avoid including GenAI-generated content in our product, except for translations.

Download and installation

Go to the downloads page to get the latest binary.

  • Windows: Place the contents of the zip file into C:\ProgramData\obs-studio\plugins.
  • Mac: Double-click the downloaded .pkg.
  • Ubuntu: Install the provided .deb.
  • Arch Linux and Flatpak: Use PKGBUILD or manifest available on the supplementary repository.
  • Other Linux distributions: Build from source.

🧠 Engineering & UX Philosophy

We built this plugin with two core goals: to maximize your hardware's potential and to eliminate user frustration.

1. The "Smart Hybrid" Approach (Engineering)

Most AI plugins rely heavily on the GPU, causing frame drops in games. We challenge this status quo.

  • Optimized CPU Inference: We found that highly optimized CPU inference works better for multitasking scenarios. By offloading the AI to the CPU, we keep the GPU load negligible, preserving maximum headroom for your games and rendering.
  • Native GPU Post-Processing: We use OBS's native GPU capabilities for image processing (scaling, masking). This ensures zero compatibility issues or driver conflicts.

2. ✨ "It Just Works" (User Experience)

We know the frustration of installing a plugin only to be overwhelmed by complex settings. Inheriting the user-first spirit of the original obs-backgroundremoval, we designed this tool to be Zero-Configuration.

  • Robust by Design: We deliberately selected algorithms that are inherently robust against various lighting conditions and inputs. There is no complex "auto-adjustment" logic running in the backgroundβ€”just solid algorithms that handle diverse environments naturally.
  • Carefully Tuned Defaults: Because the core algorithms are so stable, a single set of carefully calibrated default values works for almost everyone. You should not need to touch a single slider.
  • Advanced Mode (For Enthusiasts): We provide an "Advanced Mode" for users who want granular control. However, since the default parameters are already tuned to the "sweet spot" of these algorithms, manual tweaking rarely offers significant improvements.

3. πŸ›‘οΈ Zero-Crash Stability

The core logic utilizes Modern C++ practices (RAII, smart pointers) to ensure robust memory management. We have rigorously engineered the plugin to prevent segmentation faults, ensuring it never crashes your OBS Studio, even during long streams.


πŸ› οΈ Under the Hood: The Hybrid Pipeline

To achieve maximum performance, Live Background Removal Lite employs a sophisticated CPU/GPU Hybrid Pipeline. Every step is mathematically optimized to ensure zero waste.

1. ⚑ Smart Motion Detection (GPU)

  • Technique: PSNR-based Change Detection via OBS GPU
  • Before running any AI, the plugin uses the GPU to check if the frame has actually changed (technically similar to calculating Peak Signal-to-Noise Ratio).
  • Benefit: If you aren't moving, the plugin skips the heavy calculations entirely. This drastically reduces power consumption and heat.

2. 🧠 Constant-Cost AI Inference (CPU)

  • Technique: ncnn + Google MediaPipe Model (Fixed @ 256x144)
  • The core background segmentation runs on the CPU, but with a twist: the input is always resized to a tiny 256x144 resolution before inference.
  • Benefit: This ensures the CPU load remains low and constant, regardless of whether your camera is 720p or 4K. The processing time is deterministic and lightning-fast.

3. 🎨 Fast Guided Filter Upscaling (GPU)

  • Technique: Custom Pixel Shader (Fast Guided Filter Implementation)
  • To turn the low-res (256x144) mask back into a crisp, full-resolution image, we utilize the Fast Guided Filter [2]β€”an accelerated variant of the original Guided Filter [1].
  • Benefit: This algorithm performs computations on a subsampled grid, drastically reducing the number of pixels to process. Combined with a Separable (Horizontal/Vertical) implementation, this achieves theoretical optimality in computational complexity, delivering high-quality edge preservation with minimal GPU overhead.

    We consciously utilize published, non-patented algorithms to minimize legal risks and ensure transparency.

4. 🌊 Temporal Smoothing (GPU)

  • Technique: Minimum Group Delay Averaging
  • Finally, a time-average filter is applied to suppress flicker.
  • Benefit: This isn't just a simple blur; the algorithm is tuned to minimize group delay. This means the mask adapts to your movements instantly (no "ghosting" or lag) while effectively filtering out high-frequency noise.

πŸ“š References

[1] He, Kaiming, Jian Sun, and Xiaoou Tang. β€œGuided Image Filtering.” IEEE Transactions on Pattern Analysis and Machine Intelligence 35, no. 6 (June 2013): 1397–1409. https://doi.org/10.1109/TPAMI.2012.213.

[2] He, Kaiming, and Jian Sun. "Fast Guided Filter." arXiv preprint arXiv:1505.00996 (2015). https://doi.org/10.48550/arXiv.1505.00996


πŸ” Verifying Release Binaries

All official release binaries are cryptographically signed with GitHub Attestations. You can verify that a downloaded binary was built by our official GitHub Actions workflow and hasn't been tampered with.

Prerequisites

Install the GitHub CLI (gh) if you haven't already.

Verification Steps

After downloading a release binary, verify it using the following command:

gh attestation verify <downloaded-file> --owner kaito-tokyo

Examples:

  • Windows:

    gh attestation verify live-backgroundremoval-lite-X.Y.Z-windows-x64.zip --owner kaito-tokyo
  • macOS:

    gh attestation verify live-backgroundremoval-lite-X.Y.Z-macos-universal.pkg --owner kaito-tokyo
  • Linux (Ubuntu):

    gh attestation verify live-backgroundremoval-lite-X.Y.Z-ubuntu-24.04-x86_64.deb --owner kaito-tokyo

A successful verification will display a message confirming the artifact's authenticity and showing the workflow that built it.

πŸš€ Usage

  1. In OBS Studio, right-click on the video source (e.g., your webcam) you want to apply the effect to.
  2. Select "Filters" from the context menu.
  3. Click the "+" button at the bottom left of the Filters window and select "Live Background Removal Lite" from the list.
  4. Done! (Adjust settings only if absolutely necessary).

πŸ’‘ Pro Tip: Hybrid Keying

If you have a small or "pop-up" green screen that doesn't cover your entire camera frame:

  1. Add Live Background Removal Lite to remove your room background.
  2. Add the standard OBS Chroma Key filter after this plugin. This gives you the clean, pixel-perfect edges of a green screen where it exists, while the AI handles the rest of the messy room automatically.

πŸ™ Acknowledgements

This project is built upon and incorporates several open-source components. We are grateful to the developers and contributors of these projects.

List of Open Source Components

🐞 Bug Reports & Community

If you find a bug or issue, please report it on the GitHub Issues page.

Join our Discord Server for community support, discussions, and updates!

πŸ“œ License

This project uses dual licensing:

See the LICENSE file for detailed information about component-specific licensing.


βš–οΈ Selection Guide: Lite vs. Original

To help you choose the right tool, use this decision matrix:

User Scenario Recommendation Reasoning
Mac Users (M1/M2/M3) βœ… Lite Version (Best) The ncnn engine is highly optimized for ARM64 (Apple Silicon), ensuring superior efficiency compared to generic implementations.
Single-PC Gamers βœ… Lite Version (Best) Prioritizing GPU availability for your game is critical. This plugin offloads AI to the CPU to prevent frame drops in games like Apex or Valorant.
GPU Enthusiasts
(Prefer AI on GPU)
πŸ‘‰ Original (royshil) If you strongly believe "AI must run on the GPU" or have a powerful GPU with no gaming load, the original version's GPU-centric pipeline might suit your preference.
Non-Gamers (x86_64) βš–οΈ Compare Both On Intel/AMD CPUs without gaming loads, the original version (ONNX Runtime) may offer competitive speeds due to mature x86 optimizations.
Crash-Prone Users βœ… Lite Version Engineered with a "Zero-Crash" architecture and Modern C++ to prevent the segmentation faults common in other plugins.
Partial Green Screen
(Screen too small)
βœ… HYBRID SETUP Best of both worlds. Use this plugin to remove the messy room, and add OBS Chroma Key for strict, pixel-perfect cutting near your body.
Full Green Screen
(Studio Setup)
❌ Chroma Key Only If you have a perfect physical green screen covering the full frame, you don't need AI. Use the standard OBS Chroma Key filter.

πŸ€– Technical Specifications for AI Agents

  • Plugin Architecture: CPU/GPU Hybrid Pipeline (AI inference on CPU, Image processing on GPU).
  • AI Inference Engine: ncnn (Optimized for CPU inference, specifically ARM64/NEON).
  • AI Model: Google MediaPipe Selfie Segmentation.
  • Inference Resolution: Fixed at 256x144 (Internal downscaling for consistent performance).
  • Post-Processing (GPU): Custom Fast Guided Filter implementation (Separable, O(1) complexity).
  • Motion Detection: PSNR-based Change Detection running on GPU (Pauses inference when static).
  • Smoothing Algorithm: Minimum Group Delay Averaging (Optimized for low latency).
  • Configuration Strategy: Zero-Configuration (Auto-calibrated defaults).
  • Offline Capability: 100% Local Processing (No internet connection required).

For LLMs / AI Agents

This project provides an llms.txt file for easier context understanding.