open-index/open-npm huggingface dataset:
npm package: @livekit/rtc-ffi-bindings-darwin-arm64
Description: LiveKit RTC Node FFI bindings for internal use only
Author: LiveKit
Latest version: 0.12.52-patch.0

# `@livekit/rtc-ffi-bindings-darwin-arm64`

This is the **aarch64-apple-darwin** binary for `@livekit/rtc-ffi-bindings`
npm package: @livekit/rtc-ffi-bindings-darwin-x64
Description: LiveKit RTC Node FFI bindings for internal use only
Author: LiveKit
Latest version: 0.12.52-patch.0

# `@livekit/rtc-ffi-bindings-darwin-x64`

This is the **x86_64-apple-darwin** binary for `@livekit/rtc-ffi-bindings`
npm package: @livekit/rtc-ffi-bindings-linux-arm64-gnu
Description: LiveKit RTC Node FFI bindings for internal use only
Author: LiveKit
Latest version: 0.12.52-patch.0

# `@livekit/rtc-ffi-bindings-linux-arm64-gnu`

This is the **aarch64-unknown-linux-gnu** binary for `@livekit/rtc-ffi-bindings`
npm package: @livekit/rtc-ffi-bindings-linux-x64-gnu
Description: LiveKit RTC Node FFI bindings for internal use only
Author: LiveKit
Latest version: 0.12.52-patch.0

# `@livekit/rtc-ffi-bindings-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `@livekit/rtc-ffi-bindings`
npm package: @livekit/rtc-ffi-bindings-win32-x64-msvc
Description: LiveKit RTC Node FFI bindings for internal use only
Author: LiveKit
Latest version: 0.12.52-patch.0

# `@livekit/rtc-ffi-bindings-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@livekit/rtc-ffi-bindings`
npm package: @livekit/rtc-node-darwin-x64
Description: This is the **x86_64-apple-darwin** binary for `@livekit/rtc-node`
Author: LiveKit
Latest version: 0.13.24

# `@livekit/rtc-node-darwin-x64`

This is the **x86_64-apple-darwin** binary for `@livekit/rtc-node`
npm package: @livekit/rtc-node-linux-arm64-gnu
Description: This is the **aarch64-unknown-linux-gnu** binary for `@livekit/rtc-node`
Author: LiveKit
Latest version: 0.13.24

# `@livekit/rtc-node-linux-arm64-gnu`

This is the **aarch64-unknown-linux-gnu** binary for `@livekit/rtc-node`
npm package: @livekit/rtc-node-linux-x64-gnu
Description: This is the **x86_64-unknown-linux-gnu** binary for `@livekit/rtc-node`
Author: LiveKit
Latest version: 0.13.24

# `@livekit/rtc-node-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `@livekit/rtc-node`
npm package: @livekit/rtc-node-win32-x64-msvc
Description: This is the **x86_64-pc-windows-msvc** binary for `@livekit/rtc-node`
Author: LiveKit
Latest version: 0.13.24

# `@livekit/rtc-node-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@livekit/rtc-node`
npm package: @livekit/track-processors
Description: LiveKit track processors
Author: Lukas Seiler
Latest version: 0.7.2

# LiveKit track processors

## Install

```
npm add @livekit/track-processors
```

## Usage of prebuilt processors

### Available processors

This package exposes the `BackgroundProcessor` pre-prepared processor pipeline, which can be used in a few ways:

- `BackgroundProcessor({ mode: 'background-blur', blurRadius: 10 /* (optional) */ })`
- `BackgroundProcessor({ mode: 'virtual-background', imagePath: "http://path.to/image.png" })`
- `BackgroundProcessor({ mode: 'disabled' })`

### Usage example

```ts
import { BackgroundProcessor, supportsBackgroundProcessors, supportsModernBackgroundProcessors } from '@livekit/track-processors';

if(!supportsBackgroundProcessors()) {
  throw new Error("this browser does not support background processors")
}

if(supportsModernBackgroundProcessors()) {
  console.log("this browser supports modern APIs that are more performant");
}

const videoTrack = await createLocalVideoTrack();
const processor = BackgroundProcessor({ mode: 'background-blur' });
await videoTrack.setProcessor(processor);
room.localParticipant.publishTrack(videoTrack);

async function disableBackgroundBlur() {
  await videoTrack.stopProcessor();
}

async function updateBlurRadius(radius) {
  return processor.switchTo({ mode: 'background-blur', blurRadius: radius });
}
```

In a real application, it's likely you will want to only sometimes apply background effects. You
could accomplish this by calling `videoTrack.setProcessor(...)` / `videoTrack.stopProcessor(...)` on
demand, but these functions can sometimes result in output visual artifacts as part of the switching
process, which can result in a poor user experience.

A better option which won't result in any visual artifacts while switching is to initialize the
`BackgroundProcessor` in its "disabled" mode, and then later on switch to the desired mode. For
example:
```ts
const videoTrack = await createLocalVideoTrack();
const processor = BackgroundProcessor({ mode: 'disabled' });
await videoTrack.setProcessor(processor);
room.localParticipant.publishTrack(videoTrack);

async function enableBlur(radius) {
  await processor.switchTo({ mode: 'background-blur', blurRadius: radius });
}

async function disableBlur() {
  await processor.switchTo({ mode: 'disabled' });
}
```

## Developing your own processors

A track processor is instantiated with a Transformer.

```ts
// src/index.ts
export const VirtualBackground = (imagePath: string) => {
  const pipeline = new ProcessorWrapper(new BackgroundTransformer({ imagePath }));
  return pipeline;
};
```

### Available base transformers

- BackgroundTransformer (can blur background, use a virtual background, or be put into a disabled state);


## Running the sample app

This repository includes a small example app built on [Vite](https://vitejs.dev/). Run it with:

```
# install pnpm: https://pnpm.io/installation
pnpm install
pnpm sample
```