Skip to content

Colorspace

Video Single output Transform

Convert between colorspaces.

FFmpeg filter: colorspace — 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 Colorspace());
$result = $node->outputs()[0];

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

$result = $video->apply(new Colorspace());

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
allColorspaceAll0bt470m, bt470bg, bt601-6-525, bt601-6-625, bt709, smpte170m, smpte240m, bt2020Set all color properties together
spaceColorspaceCsp2bt709, fcc, bt470bg, smpte170m, smpte240m, ycgco, gbr, bt2020nclOutput colorspace
rangeColorspaceRng0mpeg, jpegOutput color range
primariesColorspacePrm2bt709, bt470m, bt470bg, smpte170m, smpte240m, smpte428, film, smpte431, …Output color primaries
trcColorspaceTrc2bt709, gamma22, bt470bg, smpte170m, smpte240m, linear, iec61966-2-1, iec61966-2-4, …Output transfer characteristics
formatColorspaceFmt-1yuv420p, yuv420p10, yuv420p12, yuv422p, yuv422p10, yuv422p12, yuv444p, yuv444p10, …Output pixel format
fastboolfalseIgnore primary chromaticity and gamma correction
ditherColorspaceDithernonenone, fsbDithering mode
wpadaptColorspaceWpadaptbradfordbradford, vonkries, identityWhitepoint adaptation method
iallColorspaceAll0bt470m, bt470bg, bt601-6-525, bt601-6-625, bt709, smpte170m, smpte240m, bt2020Set all input color properties together
ispaceColorspaceCsp2bt709, fcc, bt470bg, smpte170m, smpte240m, ycgco, gbr, bt2020nclInput colorspace
irangeColorspaceRng0mpeg, jpegInput color range
iprimariesColorspacePrm2bt709, bt470m, bt470bg, smpte170m, smpte240m, smpte428, film, smpte431, …Input color primaries
itrcColorspaceTrc2bt709, gamma22, bt470bg, smpte170m, smpte240m, linear, iec61966-2-1, iec61966-2-4, …Input transfer characteristics

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