Video filters
Video filters transform a VideoStream. The common ones read as
methods; the whole FFmpeg catalog is reachable as Filter classes through apply().
$clip = Media::open('in.mp4')->videoStream();
$clip->scale(1280, 720)->drawText(text: 'DRAFT', x: 40, y: 40); // friendly methods$clip->apply(new \FFmpeg\Filter\Vignette()); // any video filterParameters can be a number, an FFmpeg expression, or a per-frame closure that receives the
filter’s own variables — see the
Architecture. To check
a graph as you build it, VideoStream::frameAt() renders a
single frame.
A few you’ll reach for
Section titled “A few you’ll reach for”| Method | FFmpeg | Does |
|---|---|---|
scale() | scale | Resize / convert pixel format |
crop() | crop | Crop to a region |
overlay() | overlay | Composite one stream over another |
drawText() | drawtext | Burn text onto frames |
vignette() | vignette | Darken toward the edges |
Full recipes are in the Examples. A page per filter follows.
An Artisan Build project.
Built on FFmpeg — an independent binding, not affiliated with or endorsed by the FFmpeg project. Support FFmpeg.