Skip to content

Testsrc2

Video Single output Source

Generate another test pattern.

FFmpeg filter: testsrc2 — the official reference.

Generate a stream. Testsrc2 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 Testsrc2(…));

apply() and addFilter() do not apply to source filters (there is nothing to attach them to).

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
sizestring320x240—set video size
ratestring25—set video rate
durationint-1≥ -1set video duration
sarstring——set video sample aspect ratio
alphaint2550–255set global alpha (opacity)

FFmpeg also names these options (use the parameter shown above): s → size, r → rate, d → duration.


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