MediaSFU Shared
    Preparing search index...

    Interface ApplyVirtualBackgroundOptions

    interface ApplyVirtualBackgroundOptions {
        parameters: HeadlessParameters;
        image: string | HTMLCanvasElement | HTMLImageElement | null;
        frameRate?: number;
        modelSelection?: 0 | 1;
        publish?: boolean;
        assetPath?: string;
        blurPixels?: number;
        keepProcessingWhenHidden?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    parameters: HeadlessParameters

    The most recent parameter bag from updateSourceParameters.

    image: string | HTMLCanvasElement | HTMLImageElement | null

    Background image URL, or a ready HTMLImageElement / HTMLCanvasElement. Pass null to segment the person onto a transparent background.

    frameRate?: number

    Capture frame rate for the processed stream. Defaults to 30.

    modelSelection?: 0 | 1

    MediaPipe model: 0 = general, 1 = landscape (faster). Defaults to 1.

    publish?: boolean

    Replace the live producer's track so remote viewers see the background immediately. Defaults to true; set false to preview locally first.

    assetPath?: string

    Where to load the MediaPipe model and wasm from. Defaults to the jsDelivr CDN. Point this at a self-hosted copy of node_modules/@mediapipe/selfie_segmentation for offline or air-gapped deployments, or where a Content-Security-Policy forbids the CDN. A trailing slash is added if missing.

    blurPixels?: number

    Blur the area behind the segmented person by this many pixels. When this is greater than zero it takes precedence over image. Defaults to 0.

    keepProcessingWhenHidden?: boolean

    Best-effort hidden-tab processing for blur and image backgrounds. Defaults to true.