SDK Reference

Composition

Compose transparent foreground with color/image/video backgrounds.

Composition Model

A composition is a timeline/canvas with layered assets and export settings.

Core Operations

  • Add layer
  • Set anchor/position
  • Scale/fit mode
  • Set output format
  • Export to file/cloud

Best Practices

  • Use consistent FPS across layers when possible.
  • Keep source and target resolutions compatible.
  • Avoid repeated lossy encoding.

Recommended SDK Usage Pattern

  1. Initialize singleton client per service process.
  2. Wrap SDK calls with your own timeout/retry decorators.
  3. Map SDK/domain errors into internal error taxonomy.
  4. Capture job_id and business context in your tracing system.

SDK Hardening Checklist

  • Add per-call timeout defaults and circuit breaking.
  • Track SDK version in logs for post-incident debugging.
  • Test SDK upgrade in staging with archived production payloads.
  • Implement fallback strategy by model and output format.

Composition Testing Strategy

  1. Snapshot-test key composition templates on fixed fixtures.
  2. Check foreground anchor behavior across multiple aspect ratios.
  3. Run regression tests after FFmpeg or SDK upgrades.