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

【DTM】Visual Event Tracking for Web Pages (One)

Hosting your own private npm packages with self-hosted npm registry using Verdaccio

Happy React: Reactions on your website for free

Happy React website screenshot

Practical Guide for Route Level Bundle Splitting in React

How-To: Use custom RapidAPI API to get data from Zillow to your Sheet

The Beginner’s Guide to ReactJS — Notes Part 2

How routing works in VueJS

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

Build a Call Forwarder using SignalWire RELAY

Change is Coming: API Authentication

A door to a highly restricted area.

Allowing admin users to decide who should and shouldn’t receive daily push notifications

Complete guide creating APIs using grpc-js and grpc-web with typescript