Composition Class
TheComposition 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
- Node.js
- Python
Adding Layers
Add transparent videos as layers in your composition:- Node.js
- Python
Canvas Configuration
- Node.js
- Python
Export Methods
- Node.js
- Python
LayerHandle Class
TheLayerHandle provides a fluent API for configuring individual layers. You get a handle when calling comp.add().
Positioning Methods
- Node.js
- Python
Sizing Methods
- Node.js
- Python
Visual Effects
- Node.js
- Python
Timing Methods
- Node.js
- Python
Audio Control
- Node.js
- Python
Method Chaining
All LayerHandle methods return the handle itself, allowing for fluent chaining:- Node.js
- Python
Duration Control
Compositions follow a simple 3-rule system for determining duration:Rule 1: Video Background Controls Duration
- Node.js
- Python
Rule 2: Color/Image Backgrounds Use Longest Foreground
- Node.js
- Python
Rule 3: Explicit Duration Override
- Node.js
- Python
Audio System
The composition system automatically handles audio from multiple sources:Single Audio Source
- Node.js
- Python
Multiple Audio Sources
- Node.js
- Python
Advanced Examples
Multi-Layer News Layout
- Node.js
- Python
Timed Presentation
- Node.js
- Python
Debugging
Dry Run
See the FFmpeg command without executing:- Node.js
- Python
Verbose Export
See FFmpeg output in real-time:- Node.js
- Python
Related Classes
- Background: Background creation guide
- EncoderProfile: Export format configuration
- Video: Video loading and background removal
- Positioning Guide: Complete positioning and sizing guide
- Timing Guide: Timeline and duration control
