Gradients
Video Single output Source
Draw a gradients.
FFmpeg filter:
gradients— the official reference.
Generate a stream. Gradients is a source — it has no input, so you create a stream from it rather than applying it to one:
$video = \FFmpeg\VideoStream::generate(new Gradients(…));apply() and addFilter() do not apply to source filters (there is nothing to attach them to).
When to use it
Section titled “When to use it”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.
How to use it
Section titled “How to use it”TODO — prose: how the filter actually works and what its key parameters mean (the explanation FFmpeg’s terse option help omits).
Examples
Section titled “Examples”TODO — runnable PHP, with the equivalent ffmpeg CLI alongside.
Gotchas
Section titled “Gotchas”TODO
See also
Section titled “See also”TODO
Parameters
Section titled “Parameters”| Parameter | Type | Default | Range / values | Description |
|---|---|---|---|---|
size | string | 640x480 | — | set frame size |
rate | string | 25 | — | set frame rate |
c0 | string | random | — | set 1st color |
c1 | string | random | — | set 2nd color |
c2 | string | random | — | set 3rd color |
c3 | string | random | — | set 4th color |
c4 | string | random | — | set 5th color |
c5 | string | random | — | set 6th color |
c6 | string | random | — | set 7th color |
c7 | string | random | — | set 8th color |
x0 | int | -1 | ≥ -1 | set gradient line source x0 |
y0 | int | -1 | ≥ -1 | set gradient line source y0 |
x1 | int | -1 | ≥ -1 | set gradient line destination x1 |
y1 | int | -1 | ≥ -1 | set gradient line destination y1 |
nb_colors | int | 2 | 2–8 | set the number of colors |
seed | int | -1 | ≥ -1 | set the seed |
duration | int | -1 | ≥ -1 | set video duration |
speed | float | 0.01 | 0–1 | set gradients rotation speed |
type | GradientsType | linear | linear, radial, circular, spiral, square | set gradient type |
FFmpeg also names these options (use the parameter shown above): s → size, r → rate, n → nb_colors, d → duration, t → type.
Maps to FFmpeg’s gradients 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.