Skip to content

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 filter

Parameters 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.

MethodFFmpegDoes
scale()scaleResize / convert pixel format
crop()cropCrop to a region
overlay()overlayComposite one stream over another
drawText()drawtextBurn text onto frames
vignette()vignetteDarken 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.