
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
cutout-video-sdk
Advanced tools
Using npm:
$ npm install cutout-video-sdk
Using CDN:
<script src="https://d38b044pevnwc9.cloudfront.net/cutout-nuxt/videoMatting/cutout-video-sdk.0.1.3.js"></script>
PicupVideoCutout(token, background, options, useMicrophone)
Constructor Sample:
import PicupVideoCutout from 'cutout-video-sdk';
...
new PicupVideoCutout(token) //Initialize a video stream that return the original video stream from camera
new PicupVideoCutout(token, "blur") //Initialize a video stream that can make a blur background effect
new PicupVideoCutout(token, "https://d38b044pevnwc9.cloudfront.net/cutout-nuxt/videoMatting/bgimg_big_1.jpg") //Initialize a video stream that the video background is replaced by the specified image
new PicupVideoCutout(token, '', { width: 1280, height: 720 }) //Initialize a video stream with specified video width and height. The local camera should also support the specified video width and height
new PicupVideoCutout(token, "transparent") //Initialize a video stream that can make a transparent background effect
new PicupVideoCutout(token, 'transparent', {}, true) //Initialize a stream with video and audio
token
Following code shows a sample that use a video tag to show the cutout video stream
let customStreamVideo = document.getElementById('customStreamVideo');
let token = "xxx";
let background = "https://d38b044pevnwc9.cloudfront.net/cutout-nuxt/videoMatting/bgimg_big_1.jpg";
//let background = "blur";
let picupVideoBgSwapTest = new PicupVideoCutout(token, background);
picupVideoBgSwapTest.getOutputStream().then((videoSource) => {
console.log('picupVideoBgSwapTest-1', videoSource)
customStreamVideo.srcObject = videoSource
customStreamVideo.play()
}).catch(function(err) {
console.log('picupVideoBgSwapTest-err', err, err.name, err.message);
});
Following code shows a sample how to return a canvas, and you can do something with this canvas
let returnCanvas = picupVideoBgSwapTest.captureCanvas()
let newCanvas = document.createElement('canvas')
let newCanvasCtxs = newCanvas.getContext( '2d' );
newCanvas.width = returnCanvas.width
newCanvas.height = returnCanvas.height
newCanvas.drawImage(returnCanvas, 0, 0, newCanvas.width, newCanvas.height);
'blur' is a special value for blurring the background
let background = "https://d38b044pevnwc9.cloudfront.net/cutout-nuxt/videoMatting/bgimg_big_2.jpg"
picupVideoBgSwapTest.changeBackground(background)
Temporarily stop the video processing
picupVideoBgSwapTest.disable()
Enable the video processing
picupVideoBgSwapTest.enable()
Permanently stop video processing
picupVideoBgSwapTest.stop()
Change the video frame rate
let rate = 30
picupVideoBgSwapTest.requestFrameRate(rate)
Get canvas object
picupVideoBgSwapTest.captureCanvas()
FAQs
cutout-video-sdk
The npm package cutout-video-sdk receives a total of 1 weekly downloads. As such, cutout-video-sdk popularity was classified as not popular.
We found that cutout-video-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.