Skip to Content
API ReferenceExport Options

Export Options

await project.export(options?: ExportOptions): Promise<string>

Returns the output file path when complete.

All options

OptionTypeDefaultDescription
outputPathstring'./output.mp4'Output file path
videoCodecstring'libx264'Video codec (libx264, libx265, libvpx-vp9, prores_ks, hardware codecs)
crfnumber23Quality level (0–51, lower = better)
presetstring'medium'Encoding speed preset (ultrafastveryslow)
videoBitratestringTarget bitrate (e.g. '5M'). Overrides CRF when set.
audioCodecstring'aac'Audio codec (aac, libmp3lame, libopus, flac, copy)
audioBitratestring'192k'Audio bitrate
audioSampleRatenumber48000Audio sample rate in Hz
hwaccelstring'none'Hardware acceleration (auto, videotoolbox, nvenc, vaapi, qsv)
outputWidthnumberScale output width
outputHeightnumberScale output height
outputResolutionstringResolution shorthand ('720p', '1080p', '4k')
audioOnlybooleanfalseExport audio only (no video stream)
twoPassbooleanfalseTwo-pass encoding for better quality at target bitrate
metadataobjectEmbed metadata (e.g. { title, artist, date })
thumbnailobjectGenerate a thumbnail image alongside the video
verbosebooleanfalseEnable verbose FFmpeg logging
saveCommandstringSave the generated FFmpeg command to this file path
onProgressfunctionProgress callback — see Progress, Logging, Cancellation
onLogfunctionRaw FFmpeg log callback
signalAbortSignalCancellation signal from AbortController
watermarkobjectWatermark overlay — see Watermarks
compensateTransitionsbooleantrueAuto-adjust text, subtitle, and audio clip timings for transition overlap

Example configurations

// High-quality H.265 with embedded metadata await project.export({ outputPath: "./output.mp4", videoCodec: "libx265", crf: 18, preset: "slow", audioCodec: "libopus", audioBitrate: "256k", metadata: { title: "My Video", artist: "My Name", date: "2025" }, }); // Hardware-accelerated encoding (macOS) await project.export({ outputPath: "./output.mp4", hwaccel: "videotoolbox", videoCodec: "h264_videotoolbox", }); // Two-pass encoding for a target file size await project.export({ outputPath: "./output.mp4", twoPass: true, videoBitrate: "5M", preset: "slow", }); // Scale to 720p await project.export({ outputPath: "./720p.mp4", outputResolution: "720p" }); // Audio-only export await project.export({ outputPath: "./audio.mp3", audioOnly: true, audioCodec: "libmp3lame", audioBitrate: "320k", }); // Generate a thumbnail at 5s alongside the video await project.export({ outputPath: "./output.mp4", thumbnail: { outputPath: "./thumb.jpg", time: 5, width: 640 }, }); // Debug — inspect the generated FFmpeg command await project.export({ outputPath: "./output.mp4", verbose: true, saveCommand: "./ffmpeg-command.txt", });

compensateTransitions is true by default. FFmpeg’s xfade transitions compress the timeline — a 1s fade between two clips reduces total duration by 1s. With compensation enabled, text, subtitle, and standalone audio clip timings are adjusted so they appear at the correct visual moment regardless of how many transitions precede them. Set to false only if you have pre-calculated offsets yourself. See Timeline Behavior for details.

Last updated on