Node / Video Ffmpeg · guide
Audio tracks
Current Apexify.js 6.0.0 documentation for Audio tracks.
See also: Video audio operations (full) — normalizeAudio, mixAudio.
Multi-step edits: Video pipeline. Generated SFX: Advanced → createAudio → mux with mixAudio or pipeline .audio().
extractAudio
Demux first audio stream (requires audio track).
| Option | Default | Notes |
|---|---|---|
outputPath | ✓ | Target file. |
format | mp3 | mp3 (libmp3lame), wav (pcm_s16le), aac, ogg (libvorbis). |
bitrate | 128 | kbps (-ab). |
SOURCEtypescript
typescript
removeAudio
Video-only output (-an -c:v copy).
SOURCEtypescript
typescript
mute
| Mode | Behaviour |
|---|---|
No ranges | Same strip as removeAudio (-an). |
ranges: [{ start, end }] | volume=enable='between(t,...)':volume=0 segments on audio (-c:v copy). |
SOURCEtypescript
typescript
mixAudio — MixAudioOperation
Mixes N overlay clips onto the output timeline while optionally keeping the original mix.
Top-level
| Field | Default | Notes |
|---|---|---|
outputPath | ✓ | Mixed MP4 (-c:v copy, AAC 192k). |
overlays | ✓ | MixAudioOverlayClip[] — see below. |
keepOriginalAudio | true | false → overlays only (no silent bed mixed under SFX — avoids quiet/muddy mixes). |
originalVolume | 1 | Linear gain on [0:a] before amix. |
originalSpeed | 1 | atempo chain (~0.25–4 clamp). |
originalPitchSemitones | 0 | asetrate trick without rubberband. |
MixAudioOverlayClip
| Field | Notes |
|---|---|
source | Path / URL / Buffer (resolved like video). |
startTime | Seconds on output timeline when clip begins. |
duration | Seconds from overlay after trim — default min(fileRemainder, videoEnd-start) logic inside helper. |
sourceStart | Skip seconds into overlay file (default 0). |
volume | Linear gain (default 1). |
speed | atempo chain (~0.25–4) — changes playback speed of trimmed overlay audio. |
pitchSemitones | asetrate + compensating atempo (duration-preserving, no rubberband). |
Skips overlays whose playable window < ~0.04s or start past video end.
Example — bed music under narrator
SOURCEtypescript
typescript
Example — replace soundtrack entirely
SOURCEtypescript
typescript
adjustVolume
Global mode (no ranges)
volume is percentage of unity (100 = unchanged) → volume={volume/100}.
SOURCEtypescript
typescript
Interval mode (ranges)
Each range:
| Field | Notes |
|---|---|
start, end | Seconds inclusive window (FFmpeg between(t,...)). |
volume | Percent /100 multiplier inside window. |
speed, pitchSemitones | Optional — triggers rubberband filter substring (needs FFmpeg + librubberband). |
SOURCEtypescript
typescript
normalizeAudio
-c:v copy audio pipeline — video pixels unchanged.
For what each option does, LUFS vs peak, and honest limits of peak/rms, see Video audio operations (full).
SOURCEtypescript
typescript