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

Node / Video Ffmpeg · guide

Effects, colour & overlays

Current Apexify.js 6.0.0 documentation for Effects, colour & overlays.

apexify.jsRuntime: nodeCURRENTSince 6.0.0

See also: Visual filters & overlays · Text overlays (addTextOverlay recommended; legacy addText / addAnimatedText below are deprecated).


applyEffects

Sequential -vf filters (comma-separated).

typeParameterFFmpeg mapping
blurintensity (default 5)boxblur=
brightnessvalue (−100…100)eq=brightness=value/100
contrastvalueeq=contrast=1+value/100
saturationvalueeq=saturation=1+value/100
grayscale—hue=s=0
sepia—colorchannelmixer=… preset matrix
invert—negate
sharpenintensity (default 1)unsharp=5:5:intensity:…
noiseintensity (default 20)noise=alls=intensity:allf=t+u
SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './flat.mp4',  applyEffects: {    outputPath: './graded-quick.mp4',    filters: [      { type: 'brightness', value: -5 },      { type: 'contrast', value: 12 },      { type: 'saturation', value: -15 },      { type: 'sharpen', intensity: 1.2 },    ],  },});

colorCorrect

Uses eq, hue, colorbalance for warmth.

FieldMapping
brightnesseq=brightness=brightness/100
contrasteq=contrast=1+contrast/100
saturationeq=saturation=1+saturation/100
huehue=h=hue (degrees)
temperaturecolorbalance offsets (positive = warmer, negative = cooler heuristic).
outputPath✓
SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './flat.mp4',  colorCorrect: {    brightness: 6,    contrast: 10,    saturation: -8,    hue: 0,    temperature: 15,    outputPath: './warm.mp4',  },});

applyLUT

Applies 3D LUT file (.cube typical).

FieldNotes
lutPathResolved vs cwd when not URL.
intensityPresent in types — blend strength not wired in helper today (reserved).
outputPath✓ — re-encodes libx264 -crf 18.
SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './log.mp4',  applyLUT: {    lutPath: './luts/teal-orange.cube',    outputPath: './graded.mp4',  },  onProgress: (p) => console.log(p.percent),});

addWatermark

Second input image overlaid with alpha multiplier.

FieldDefaultNotes
watermarkPath✓Local path (non-URL resolved vs cwd).
positionbottom-righttop-left, top-right, bottom-left, bottom-right, center.
opacity0.5colorchannelmixer=aa=
sizenativescale=w:h before overlay.
outputPath✓
SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './episode.mp4',  addWatermark: {    watermarkPath: './brand-mark.png',    position: 'top-right',    opacity: 0.65,    size: { width: 200, height: 80 },    outputPath: './episode-branded.mp4',  },});

addText

Static drawtext (requires FFmpeg default font / OS fonts).

FieldDefault
text✓
positionbottom-center
fontSize24
fontColorwhite
backgroundColorblack@0.5 (drawtext box)
startTime, endTimeOmit → always on
outputPath✓

Colon : and ' escaped for ffmpeg filter syntax.

SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './talk.mp4',  addText: {    text: 'Episode 12 · Spoilers ahead',    position: 'top-center',    fontSize: 28,    fontColor: 'yellow',    backgroundColor: 'black@0.65',    startTime: 0,    endTime: 6,    outputPath: './talk-caption.mp4',  },});

addFade

Video fade (-vf fade). Audio untouched.

FieldNotes
fadeInSeconds from t=0.
fadeOutEnds duration - fadeOut when duration known via getVideoInfo.
outputPath✓
SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './intro.mp4',  addFade: {    fadeIn: 1.2,    fadeOut: 2,    outputPath: './intro-soft.mp4',  },});

addAnimatedText

Drawtext with enable=between(start,end).

Position

Either named (same set as addText minus finer granularity) or { x, y } pixel coords.

animation — type vs runtime

VideoCreationOptions unionActually honoured in addAnimatedTextToVideo
fadeIn, fadeOut, …Implementation checks fade and slide only — extra expressions appended to drawtext.
Missing / othersStatic visibility window only.

Working animated keywords today: fade, slide (plus none / omitted).

SOURCEtypescript
typescript
Studio
await painter.createVideo({  source: './promo.mp4',  addAnimatedText: {    text: 'Coming soon',    animation: 'fade',    startTime: 2,    endTime: 7,    position: 'center',    fontSize: 54,    fontColor: 'white',    backgroundColor: 'black@0.4',    outputPath: './promo-title.mp4',  },  onProgress: (p) => console.log(p.percent),});

fontPath, fontName, fontFamily appear on VideoCreationOptions but are not injected into the FFmpeg drawtext filter in addAnimatedTextToVideo today (reserved). addText uses the same limitation — system default font only unless you extend the helper.


Next steps