@tirth0/livekit-track-processor-jbf
v0.2.0
Published
Joint bilateral filter background processor for LiveKit video tracks
Readme
LiveKit JBF background processor
Joint bilateral filter background processor for LiveKit video tracks. The processor implements the TrackProcessor interface from livekit-client and can blur the background, replace it with an image, or run in disabled passthrough mode.
Install
npm add @tirth0/livekit-track-processor-jbfUsage
import { JBFBackgroundProcessor } from '@tirth0/livekit-track-processor-jbf';
const processor = JBFBackgroundProcessor({
mode: 'background-blur',
blurRadius: 10,
});
await videoTrack.setProcessor(processor);Available modes:
background-bluruses the current frame as the background and applies blur behind the person.virtual-backgroundcomposites the person over an image fromimagePath.disabledkeeps the processor attached while passing frames through unchanged.
Switch modes without detaching the processor:
await processor.switchTo({ mode: 'virtual-background', imagePath: '/background.jpg' });
await processor.switchTo({ mode: 'background-blur', blurRadius: 12 });
await processor.switchTo({ mode: 'disabled' });See processor-docs/video-processors.md for browser support checks, tuning options, and the sample app workflow.
Running The Sample App
This repository includes a small Vite example app that demonstrates the JBF background processor with a LiveKit room.
# install pnpm: https://pnpm.io/installation
pnpm install
pnpm sample