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