The Node.js and NPM requirements do not apply if the goal is to use this library as a dependency of your project. They only apply if you want to check the source code out and build the artifacts and/or run tests.
You can install directly from npm.
npm install @twilio/video-processors --save
Using this method, you can import
twilio-video-processors like so:
import * as VideoProcessors from '@twilio/video-processors';
You can also copy
twilio-video-processors.js from the
dist/build folder and include it directly in your web app using a
Using this method,
twilio-video-processors.js will set a browser global:
const VideoProcessors = Twilio.VideoProcessors;
In order to achieve the best performance, the VideoProcessors use WebAssembly to run TensorFlow Lite for person segmentation. You need to serve the tflite model and binaries so they can be loaded properly. These files can be downloaded from the
dist/build folder. Check the API docs for details and the examples folder for reference.
These processors run TensorFlow Lite using MediaPipe Selfie Segmentation Landscape Model and requires WebAssembly SIMD support in order to achieve the best performance. We recommend that, when calling Video.createLocalVideoTrack, the video capture constraints be set to
24 fps frame rate with
640x480 capture dimensions. Higher resolutions can still be used for increased accuracy, but may degrade performance, resulting in a lower output frame rate on low powered devices.
Please check out the following pages for best practice.
Generated using TypeDoc