Skip to main content

1. Install the SDK

Choose your development environment and install the VideoBGRemover SDK:

Node.js Installation

npm install @videobgremover/sdk

Python Installation

pip install videobgremover

FFmpeg Installation (Required)

The SDK requires FFmpeg for video composition operations:
brew install ffmpeg

2. Get Your API Key

You’ll need an API key for background removal:
1

Sign up for an account

Visit videobgremover.com and create an account.
2

Purchase credits

Buy credits for video processing. Pricing is based on video duration.
3

Create an API key

Go to API Management and create your first API key.

3. Remove Backgrounds

Now you’re ready to remove backgrounds from videos:
// Perfect for: Node.js apps, TypeScript projects

import { VideoBGRemoverClient, Video } from '@videobgremover/sdk'

const client = new VideoBGRemoverClient('vbr_your_api_key')
const video = Video.open('https://example.com/video.mp4')

// Remove background (handles everything automatically)
const transparent = await video.removeBackground(client)

console.log('Background removed! Format:', transparent.getFormat())

4. Create Compositions

After removing backgrounds, create professional video compositions:
import {
  Background,
  Composition,
  EncoderProfile,
  Anchor,
  SizeMode
} from '@videobgremover/sdk'

// 1. Create custom background
const background = Background.fromColor('#FF0000', 1920, 1080, 30)

// 2. Create composition
const composition = new Composition(background)

// 3. Add your transparent video
composition.add(transparent, 'main_video')
  .at(Anchor.CENTER)
  .size(SizeMode.CONTAIN)

// 4. Export final video (local FFmpeg processing)
await composition.toFile('final.mp4', EncoderProfile.h264())

console.log('✅ Composition created: final.mp4')

5. Complete End-to-End Example

Here’s a complete workflow from background removal to final video:
import {
  VideoBGRemoverClient,
  Video,
  Background,
  Composition,
  EncoderProfile,
  Anchor,
  SizeMode
} from '@videobgremover/sdk'

async function completeWorkflow() {
  // 1. Remove background (API call - uses credits)
  const client = new VideoBGRemoverClient('vbr_your_api_key')
  const video = Video.open('https://example.com/person.mp4')
  const transparent = await video.removeBackground(client)

  // 2. Create composition (local FFmpeg - no credits)
  const background = Background.fromImage('office.jpg', 30)
  const comp = new Composition(background)

  // 3. Position and layer
  comp.add(transparent, 'person')
    .at(Anchor.CENTER)
    .size(SizeMode.CONTAIN)
    .opacity(0.95)

  // 4. Export final video
  await comp.toFile('person_in_office.mp4', EncoderProfile.h264())

  console.log('✅ Complete! Person now appears in office background.')
}

completeWorkflow()

6. What’s Next?