Node / Video Ffmpeg · guide
Compositing & building videos
Current Apexify.js 6.0.0 documentation for Compositing & building videos.
merge
Ignores top-level source — uses videos only.
mode | Behaviour |
|---|---|
sequential (default) | concat demuxer -c copy — fast; clips should match codecs for reliability. |
side-by-side | hstack first two inputs only. |
grid | Currently same as side-by-side in code (two-input hstack) — grid dims reserved. |
splitScreen
Ignores top-level source.
layout | Needs | Behaviour |
|---|---|---|
side-by-side | ≥2 | hstack. |
top-bottom | ≥2 | vstack. |
grid | ≥4 | 2×2 pipeline. |
pictureInPicture
Uses source as background and overlayVideo as inset.
| Field | Default | Effect |
|---|---|---|
overlayVideo | ✓ | Path / buffer / URL. |
position | bottom-right | Corner placement. |
size | 320×180 | Scales overlay before composite. |
opacity | 1 | Alpha via colorchannelmixer. |
outputPath | ✓ |
createFromFrames
Ignores source for logic — still required by type.
What it does: Writes frames as frame-%06d.png, runs FFmpeg -framerate → encoded video -pix_fmt yuv420p.
| Field | Default | Effect |
|---|---|---|
frames | ✓ | Paths or Buffers. |
fps | 30 | Timeline speed. |
quality | medium | CRF ladder unless bitrate set. |
bitrate | — | Overrides CRF. |
resolution | auto | scale+pad from first frame or forced WxH. |
format | typed | Container hint; encode uses libx264-style path. |
createLoop
What it does: Concat demuxer plays source twice (-c copy). smooth flag unused in helper.
batch
What it does: Loops videos[] calling createVideo({ source, ...operations }) per row.
Important: Put outputPath inside each nested operation (trim.outputPath, etc.). The outputDirectory helper field does not auto-inject paths into operations.
Prefer your own for loop until batch wiring saves outputs predictably.