Expand description
A grade’s raw ffmpeg filters (extra, after the grade) as GPU hooks: the colour filters the
prototype’s edits use, parsed from ffmpeg’s filter syntax (name=k=v:k=v, positional
arguments, comma-separated chains) and run as PREOUTPUT hooks in chain order, so nothing
falls back to the CPU.
Supported: eq (contrast, brightness, saturation, gamma, gamma_r/g/b, gamma_weight), hue
(h, s, H, b), colorbalance (rs..bh, pl), curves (preset, master/red/green/blue/all point
lists, natural spline), unsharp (luma and chroma sizes and amounts), vignette (angle) and
colorlevels (per-channel input and output black and white points).
eq, hue and unsharp work on BT.601 limited-range YUV code values, as ffmpeg’s
auto-inserted conversion from RGB gives them; vignette and colorlevels work on RGB.
hooks reports anything else and doesn’t apply it; strict_hooks and filter_hook
(comp layers’ filters) refuse it. colorlevels is layer-only for now: hooks (timeline
extra, whose cache keys predate it) still skips it.
Structs§
- Curves
curvesas per-channel tables over0..=1with the master curve folded in.- Filter
- One filter of a chain: its name and arguments,
(None, value)for positional ones.
Constants§
- CURVE_
SAMPLES - Samples per channel of a
Curvestable.
Functions§
- colorbalance
- ffmpeg’s
colorbalance: shadows/midtones/highlights offsets per channel weighted by the input’smax + min(ffmpeg’s weights, seecrate::shaders::look), and withplffmpeg’s lightness preservation (HSL, at the input’s lightness). - colorlevels
- ffmpeg’s
colorlevelson RGB: per channel(v − imin) / (imax − imin) · (omax − omin) + omin, clamped to 0..1. - eq
- ffmpeg’s
eqon BT.601 code values: per planev = k (v − ½) + ½ + b(luma: contrast and brightness; chroma: saturation), thenv (1 − w) + v^(1/gamma) w, 0 below 0, 1 above. - eval
- Evaluates a constant ffmpeg expression: numbers,
PI,PHI,E,+ - * /, parentheses. - filter_
hook - One filter’s hook; an error if it isn’t supported, or any of its options isn’t.
- hooks
- The hooks for a grade’s
extrafilter strings, in order, and what isn’t applied. - hue
- ffmpeg’s
hue: chroma rotated byhueradians and scaled bysat, luma code values moved bybright× 25.5 / 255. - parse
- Parses a filter chain (
eq=contrast=1.1:saturation=0.9,hue=s=0). Link labels ([in]) are dropped; graphs (;) are an error. - strict_
hooks - The hooks for filter chains, in order; an error for anything
hookswould skip or warn about (comp layers’filters: never silently dropped). - unsharp
- ffmpeg’s
unsharpwith lumalx x lyand chromacx x cymatrices (sizes), the binomial blur ffmpeg’s repeated[1 2 1]passes give, amountslumaandchromaas params: luma on BT.601 Y (the same delta on R, G and B), chroma on the rest of the pixel. - vignette
- ffmpeg’s
vignette: RGB timescos(angle · d)^4,dthe distance from the middle over the half diagonal.