Node / Video Ffmpeg · guide
Compose, PiP & frame builds
Current Apexify.js 6.0.0 documentation for Compose, PiP & frame builds.
See also: Compositing & build (merge, splitScreen, pictureInPicture, createFromFrames, createLoop, batch).
merge
Concatenate or simple horizontal stacks (ignores top-level source — uses videos array).
mode | Inputs | Behaviour |
|---|---|---|
sequential (default) | N | concat demuxer, -c copy. |
side-by-side | ≥2 | hstack two inputs (first + second). |
grid | ≥2 | Implementation currently mirrors side-by-side (two-input hstack) — grid dims are not expanded yet. |
SOURCEtypescript
typescript
SOURCEtypescript
typescript
Tip: concat -c copy needs compatible codecs/parameters across clips.
splitScreen
Dedicated layouts (also ignores top-level source).
layout | Minimum clips |
|---|---|
side-by-side | 2 — hstack. |
top-bottom | 2 — vstack. |
grid | 4 — 2×2 (two hstack → vstack). |
SOURCEtypescript
typescript
pictureInPicture
Main source + overlayVideo (path/buffer/URL).
| Field | Default |
|---|---|
position | bottom-right |
size | 320×180 |
opacity | 1 (alpha via colorchannelmixer) |
outputPath | ✓ |
SOURCEtypescript
typescript
createFromFrames
Build video from PNG/JPEG buffers or paths (sequence renamed internally frame-%06d.png).
| Field | Default | Notes |
|---|---|---|
frames | ✓ | Ordered array (≥1). |
outputPath | ✓ | Container by extension. |
fps | 30 | -framerate input hint. |
format | — | Declared in types; encode uses CRF/bitrate path (-pix_fmt yuv420p). |
quality | medium | CRF ladder (low→ultra). |
bitrate | — | Overrides CRF when set. |
resolution | auto | scale + pad centre from first frame dims or forced WxH. |
SOURCEtypescript
typescript
Buffers:
SOURCEtypescript
typescript
createLoop
Concat demuxer plays source twice back-to-back (-c copy). smooth flag not used in helper (reserved).
SOURCEtypescript
typescript
batch
Runs createVideo per item with { source, ...operations }.
| Issue | Detail |
|---|---|
outputPath | Must live inside each operations payload (**e.g. trim.outputPath) — top-level batch outputDirectory name is not injected automatically. |
| Return value | results[].output paths may not match actual FFmpeg outputs until helper wires paths — verify files on disk or avoid batch and loop createVideo yourself. |
SOURCEtypescript
typescript