Skip to content
Apexify.jsDocs
Apexify.js version v5.4.5

Node / Video Ffmpeg · guide

Presets, transitions, stabilize & batch caveats

Current Apexify.js 6.0.0 documentation for Presets, transitions, stabilize & batch caveats.

apexify.jsRuntime: nodeCURRENTSince 6.0.0

See also: Transcode & export presets (exportPreset, convert, compress) · Transitions & stabilize · Progress callback.


exportPreset

Calls convertVideo with fixed resolution / fps / bitrate / format presets.

presetResolutionFPSBitrate (kbps)Format
youtube1920×1080308000mp4
instagram1080×1080303500mp4
tiktok1080×1920304000mp4
twitter1280×720305000mp4
facebook1280×720304000mp4
4k3840×21603050000mp4
1080p1920×1080308000mp4
720p1280×720305000mp4
mobile720×1280302500mp4
web1280×720303000webm

Names matched case-insensitively.

SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './master.mp4',  exportPreset: {    preset: 'tiktok',    outputPath: './out/vertical.mp4',  },  onProgress: (p) => console.log(`${p.percent}%`),});

stabilize

Two-pass vidstab when available:

  1. vidstabdetect → transforms .trf
  2. vidstabtransform=smoothing=N (**default smoothing 10)

Fallback: hqdn3d spatial/temporal denoise if analyse/transform throws.

SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './handheld.mp4',  stabilize: {    outputPath: './stable.mp4',    smoothing: 15,  },});

addTransition

Fade-in / fade-out single clip

type: 'fade' without secondVideo:

directionFilter
out (default behaviour if you choose fade-out semantics)fade=t=out:st=0:d=duration
in / otherfade=t=in:st=0:d=duration
SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './clip.mp4',  addTransition: {    type: 'fade',    duration: 1.5,    direction: 'in',    outputPath: './clip-fadein.mp4',  },});

Between two clips (xfade)

Requires secondVideo. Videos scaled to max(width)×max(height) then xfade at offset = duration(video1) - duration (transition straddles cut point).

type → xfade transition name mapping (defaults fade):

RequestedMapped
fade, dissolve, blurfade
wipe + directionwipeleft / wiperight / wipeup / wipedown
slide + directionslideleft, …
zoom + in/outzoomin / zoomout
circlecircleopen
pixelizepixelize
SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './a.mp4',  addTransition: {    type: 'fade',    duration: 0.8,    secondVideo: './b.mp4',    outputPath: './ab-crossfade.mp4',  },  onProgress: (p) => console.log(p.speed),});

batch — recap

Prefer explicit for loops calling createVideo until batchProcessVideos assigns outputs automatically.


These exist on ApexPainter for lower-level control:

  • extractFrames(videoSource, options) — always interval mode (ms).
  • extractAllFrames — same engine as createVideo.extractAllFrames.
  • extractFrameAtTime, extractMultipleFrames — convenience wrappers.
  • #createVideoFromFrames / #createVideoLoop — internal; createVideo already exposes createFromFrames / createLoop.

Operational checklist

  1. Install FFmpeg on PATH (ffmpeg, ffprobe).
  2. One primary operation key per createVideo call — see router table.
  3. source required by TypeScript even when unused (merge, splitScreen, createFromFrames, batch).
  4. Windows vs POSIX — detectScenes shell pipeline may need Git Bash / WSL for grep|awk|sed reliability.
  5. Heavy ops — reverse, extractAllFrames, stabilize — plan timeouts & disk space (.temp-frames grows).

Next steps