How to create virtual background with the new feature of Amazon Chime SDK “video background replacement”

Introduction

Premise

How to use

const processors = [];
if (await BackgroundReplacementVideoFrameProcessor.isSupported()) {
const image = await fetch("https://pathtoimage.jpeg"); // (1) fetch image for virtual background.
const imageBlob = await image.blob();
const options = { imageBlob };
const replacementProcessor =
await BackgroundReplacementVideoFrameProcessor.create(null, options); // (2) create processor for background replacement.
processors.push(replacementProcessor);
}
let transformDevice = new DefaultVideoTransformDevice(
logger,
device,
processors
); // (3) create virtual device.
meetingSession.audioVideo.chooseVideoInputDevice(transformDevice);
replacementProcessor.setImageBlob(imageBlob);

Demo

$ git clone https://github.com/w-okada/amazon-chime-bg-blur-demo.git -b aws-demo02

CPU Usage

And more

Finally

I am very thirsty!!

Acknowledgements

Disclaimer

--

--

--

Software researcher and engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

JavaScript vs Elixir: surface-level differences

What Angular is doing with Bazel and Closure

Indicative Functions

How to build a pricing slider — Vue

Connected Textures Mod 1.16.5/1.15.2 (Emissive Rendering, CTM)

Beginner’s guide to Node.js

Neumorphic Login Form In Bulma

A quick revision of some important JavaScript array functions using practical examples

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
dannadori

dannadori

Software researcher and engineer

More from Medium

Meet Team HACCamino: The 2021 Meteor Hackathon Winner!

Migrate brew formulas from Intel to ARM on M1

Incremental Mobile Force Update using Ingress NGINX and Firebase Remote Config

Nested Pagination with Apollo Client 3 Type Policies