Video Editing

Apply local video edits with the Wonda CLI: trim, crop, merge, overlay, captions, audio mixing, and more.


Video editing is CLI-first. wonda edit video downloads inputs when needed, renders locally with ffmpeg or hyperframes, uploads the output media, and prints the resulting mediaId. There is no server-side editor job for current video edits.

The retired POST /api/v1/video/edit endpoint returns 410 Gone with a migration hint for known operations. Move scripts to the CLI commands below.

Setup

npm i -g @degausai/wonda
wonda auth login
wonda doctor

wonda doctor checks local prerequisites such as ffmpeg. Hyperframes operations such as textOverlay and animatedCaptions also need the bundled Chromium renderer.

Usage

wonda edit video --operation <operation> \
  --media <media-id-or-local-file> \
  --params '{...}' \
  --wait -o ./out.mp4

Common flags:

FlagDescription
--operationRequired operation name. Run wonda operations list to see the local registry.
--mediaMedia IDs or local file paths. Pass multiple inputs as a comma-separated value, such as --media <base>,<overlay>.
--paramsRaw JSON object for operation-specific params. Run wonda operations info <operation> for the shape.
--presetFeatured preset name scoped to --operation. Explicit --params values override preset params.
--audio-mediaAudio media ID or local audio file for editAudio.
--prompt-textRequired text for textOverlay.
--caption-segmentsRaw JSON array for animatedCaptions. Produce timing data with wonda alignment extract-timestamps.
--waitAccepted for compatibility. Local renders finish before output is printed.
-o, --outputDownload the rendered output to a local file path. Implies --wait.

Video-only shortcut flags:

FlagApplies toDescription
--thresholdsplitScenesScene-change sensitivity from 0.01 to 0.9.
--min-clip-durationsplitScenesMinimum scene duration in seconds.
--modesplitScenessplit for separate scene files or omit to remove one scene and concatenate the rest.
--output-selectionsplitScenesfirst, last, or a 1-indexed scene number.
--duration-msimageToVideoHold a still image for this many milliseconds, from 500 to 60000.
--silence-threshold-dbskipSilenceSilence detection noise floor in dB.
--min-silence-durationskipSilenceShortest gap that counts as silence, in seconds.
--max-silence-durationskipSilenceSilence beyond this gets cut; remaining silence is bounded to this value.

Output

Without --output, a successful local render prints:

{
  "mediaId": "019e1b70-6f9e-80fd-8c49-690bcbdaf8db",
  "status": "succeeded"
}

With --output, the CLI downloads the result and prints the local path plus mediaId:

{
  "path": "./trimmed.mp4",
  "mediaId": "019e1b70-6f9e-80fd-8c49-690bcbdaf8db"
}

splitScenes in split mode prints a scenes array because it can produce multiple media outputs.

Operations

OperationRendererInputsKey params
trimffmpegOne videotrimStartMs, trimEndMs
cropffmpegOne videoaspectRatio, customWidth, customHeight, cropPercent, cropAxis, position, paddingTop
mergeffmpegMultiple videosInput order comes from --media <id1>,<id2>,...
overlayffmpegBase video plus overlay videoposition, resizePercent, resizeAxis, baseVideoVolume, overlayVideoVolume, overlayStartMs, overlayDurationMs
splitScreenffmpegTwo videostargetAspectRatio
speedffmpegOne videospeed, preservePitch
volumeffmpegOne videovolume, muted
reverseVideoffmpegOne videoNone
extractFrameffmpegOne videotimestampMs or timestampPercent
extractAudioffmpegOne videoNone
editAudioffmpegOne video plus one audio inputvideoVolume, audioVolume, audioStartMs, audioEndMs, audioOffsetMs
imageToVideoffmpegOne imagedurationMs, or the --duration-ms shortcut
skipSilenceffmpegOne video with audiosilenceThresholdDb, minSilenceDuration, maxSilenceDuration
splitScenesffmpegOne videomode, outputSelection, threshold, minClipDuration
textOverlayhyperframesOne video or image plus --prompt-textStyling params such as fontFamily, position, sizePercent, fontSizeScale, strokeWidth
animatedCaptionshyperframesOne video plus --caption-segmentsCaption styling params such as fontFamily, position, sizePercent, fontSizeScale, strokeWidth, highlightColor

For exact parameter defaults and ranges, run:

wonda operations info trim
wonda operations info textOverlay

Examples

Trim a video:

wonda edit video --operation trim --media 019e1b70-6f9e-80fd-8c49-690bcbdaf8db \
  --params '{"trimStartMs":3000,"trimEndMs":10000}' \
  --wait -o ./trimmed.mp4

Merge videos locally:

wonda edit video --operation merge \
  --media 019e1b70-6f9e-80fd-8c49-690bcbdaf8db,019e1b72-0742-8bae-bb93-b569036d05af \
  --wait -o ./merged.mp4

Add a static text overlay:

wonda edit video --operation textOverlay --media 019e1b70-6f9e-80fd-8c49-690bcbdaf8db \
  --prompt-text "Launch day" \
  --params '{"fontFamily":"TikTok Sans SemiCondensed","position":"top-center","sizePercent":66,"fontSizeScale":0.5,"strokeWidth":4.5}' \
  --wait -o ./with-text.mp4

Render animated captions:

wonda edit video --operation animatedCaptions --media 019e1b70-6f9e-80fd-8c49-690bcbdaf8db \
  --caption-segments '[{"text":"Launch","startS":0},{"text":"day","startS":0.4}]' \
  --params '{"fontFamily":"TikTok Sans SemiCondensed","position":"bottom-center","sizePercent":80}' \
  --wait -o ./captioned.mp4

Replace or mix audio:

wonda edit video --operation editAudio \
  --media 019e1b70-6f9e-80fd-8c49-690bcbdaf8db \
  --audio-media 019e1b73-32a4-8c9e-8bbf-3661a14a5716 \
  --params '{"videoVolume":30,"audioVolume":80,"audioOffsetMs":2000}' \
  --wait -o ./with-audio.mp4