Node / Video Ffmpeg · guide
Timeline edits
Current Apexify.js 6.0.0 documentation for Timeline edits.
Trim, splice, freeze, reverse, and speed changes on the timeline.
Several timeline steps in one project? Use videoPipeline() (advanced) instead of chaining createVideo calls.
Single operation: use the createVideo keys below (one per call).
trim
What it does: Copies [startTime, endTime] into a new file with stream copy (-c copy) — fast, no re-encode, but cuts must land on keyframes for frame-accuracy.
| Field | Effect |
|---|---|
startTime | Where output starts (seconds). |
endTime | Where output ends — not duration; length = endTime - startTime. |
outputPath | ✓ |
replaceSegment (splice)
What it does: Splices replacement footage into [targetStartTime, targetEndTime] of source, keeping head/tail. Same operation as videoPipeline().splice({ … }).
Modes
| You provide | Behaviour |
|---|---|
replacementVideo | Trims replacementStartTime for replacementDuration (default = gap length). |
replacementFrames | Builds a temp clip at replacementFps (default 30) via createVideoFromFrames. |
Cannot pass both replacementVideo and replacementFrames.
Options
| Field | Effect |
|---|---|
targetStartTime, targetEndTime | Region replaced in main timeline (seconds). |
replacementStartTime | In-point inside replacement file (default 0). |
replacementDuration | Length taken from replacement (default matches gap). |
replacementFps | FPS for frame sequence mode. |
outputPath | ✓ |
freezeFrame
What it does: Output = before clip + still image held duration seconds + after clip (concat).
| Field | Effect |
|---|---|
time | Which frame to freeze (seconds). |
duration | How long the freeze lasts on the output. |
outputPath | ✓ |
Supports onProgress on final concat.
reverse
What it does: Plays video backwards (-vf reverse -af areverse). CPU heavy, long runs on big files.
changeSpeed
What it does: setpts on video; atempo (possibly chained) on audio. >2× or <0.5× speed uses multiple atempo stages (FFmpeg limit 0.5–2 per stage).
| Field | Effect |
|---|---|
speed | 2 = double speed (half duration); 0.5 = slow motion. |
outputPath | ✓ |
createTimeLapse
What it does: Same helper as changeSpeed — speed defaults to 10 if omitted.