Skip to content

Acrossfade

Audio Single output Transform

Cross fade two input audio streams.

FFmpeg filter: acrossfade — the official reference.

Add it to a graph. The explicit form works for every filter — bind it to its inputs and read the result from outputs():

$node = $audio->addFilter(new Acrossfade(), [$other]);
$result = $node->outputs()[0];

Shorthand. Single-output filters can skip the node — apply() returns the result stream directly:

$result = $audio->apply(new Acrossfade(), $other);

TODO — when this filter shines: what it’s the right tool for, what to reach for instead when it isn’t, and how it composes with neighbouring filters.

TODO — prose: how the filter actually works and what its key parameters mean (the explanation FFmpeg’s terse option help omits).

TODO — runnable PHP, with the equivalent ffmpeg CLI alongside.

TODO

TODO

ParameterTypeDefaultRange / valuesDescription
nb_samplesint441001214748364set number of samples for cross fade duration
durationint0060000000set cross fade duration
overlapbooltrueoverlap 1st stream end with 2nd stream start
curve1AcrossfadeCurvetrinofade, tri, qsin, esin, hsin, log, ipar, qua, …set fade curve type for 1st stream
curve2AcrossfadeCurvetrinofade, tri, qsin, esin, hsin, log, ipar, qua, …set fade curve type for 2nd stream

FFmpeg also names these options (use the parameter shown above): nsnb_samples, dduration, ooverlap, c1curve1, c2curve2.


Maps to FFmpeg’s acrossfade filter. Verified against ffmpeg n7.1.1.

An Artisan Build project.

Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project. Support FFmpeg.