@livekit/track-processors
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

LiveKit track processors

Install

npm add @livekit/track-processors

Usage of prebuilt processors

Available processors

This package exposes BackgroundBlur and VirtualBackground as pre-prepared processor pipelines.

  • BackgroundBlur(blurRadius)
  • VirtualBackground(imagePath)

Usage example

import { BackgroundBlur } from '@livekit/track-processors';

const videoTrack = await createLocalVideoTrack();
const blur = BackgroundBlur(10);
await videoTrack.setProcessor(blur);
room.localParticipant.publishTrack(videoTrack);

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

async updateBlurRadius(radius) {
  return blur.updateTransformerOptions({blurRadius: blur})
}

Developing your own processors

A track processor is instantiated with a Transformer.

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

Available base transformers

  • BackgroundTransformer (can blur background or use a virtual background);

Readme

Keywords

none

Package Sidebar

Install

npm i @livekit/track-processors

Weekly Downloads

1,452

Version

0.3.1

License

Apache-2.0

Unpacked Size

104 kB

Total Files

23

Last publish

Collaborators

  • lherman-livekit
  • paulwe
  • keepingitneil
  • ocupe_livekit
  • cacheonly
  • duanweiwei
  • benjaminlivekit
  • danm_livekit
  • feepslk
  • lukasio
  • cnderrauber
  • lk_hiroshi
  • dliulk
  • dc-livekit
  • shishir.gowda
  • raja-livekit
  • livekitherzog
  • matkam_livekit
  • thedavidzhao
  • rdsa