Skip to main content

Composition Class

The Composition class is the core of the media layer - it handles local FFmpeg operations for professional video editing. No API calls or credits required.
Media Layer: This class processes videos locally using FFmpeg. No internet connection or credits required. For background removal (API layer), see VideoBGRemoverClient.

Creating Compositions

Adding Layers

Add transparent videos as layers in your composition:

Canvas Configuration

Export Methods

LayerHandle Class

The LayerHandle provides a fluent API for configuring individual layers. You get a handle when calling comp.add().

Positioning Methods

Sizing Methods

Visual Effects

Timing Methods

Audio Control

Method Chaining

All LayerHandle methods return the handle itself, allowing for fluent chaining:

Duration Control

Compositions follow a simple 3-rule system for determining duration:

Rule 1: Video Background Controls Duration

Rule 2: Color/Image Backgrounds Use Longest Foreground

Rule 3: Explicit Duration Override

Audio System

The composition system automatically handles audio from multiple sources:

Single Audio Source

Multiple Audio Sources

Advanced Examples

Multi-Layer News Layout

Timed Presentation

Debugging

Dry Run

See the FFmpeg command without executing:

Verbose Export

See FFmpeg output in real-time: