Skip to content

Colorchannelmixer

Video Single output Transform

Adjust colors by mixing color channels.

FFmpeg filter: colorchannelmixer — the official reference.

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

$node = $video->addFilter(new Colorchannelmixer(…));
$result = $node->outputs()[0];

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

$result = $video->apply(new Colorchannelmixer(…));

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
rrfloat1-2–2set the red gain for the red channel
rgfloat0-2–2set the green gain for the red channel
rbfloat0-2–2set the blue gain for the red channel
rafloat0-2–2set the alpha gain for the red channel
grfloat0-2–2set the red gain for the green channel
ggfloat1-2–2set the green gain for the green channel
gbfloat0-2–2set the blue gain for the green channel
gafloat0-2–2set the alpha gain for the green channel
brfloat0-2–2set the red gain for the blue channel
bgfloat0-2–2set the green gain for the blue channel
bbfloat1-2–2set the blue gain for the blue channel
bafloat0-2–2set the alpha gain for the blue channel
arfloat0-2–2set the red gain for the alpha channel
agfloat0-2–2set the green gain for the alpha channel
abfloat0-2–2set the blue gain for the alpha channel
aafloat1-2–2set the alpha gain for the alpha channel
pcColorchannelmixerPreservenonenone, lum, max, avg, sum, nrm, pwrset the preserve color mode
pafloat00–1set the preserve color amount

Maps to FFmpeg’s colorchannelmixer 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.