FFmpeg Has a Mandelbrot Generator Built In
Source: Dev.to
Overview
Most people use FFmpeg to convert video files. Few know it ships with a virtual device system called lavfi that generates video from pure math — no input file, no external tools, nothing to install. It’s already on your system.
Check Your FFmpeg Install
ffmpeg -version
If FFmpeg is installed, lavfi is included. That’s all you need.
Generate a Mandelbrot and Save It
ffmpeg -f lavfi -i "mandelbrot=size=640x360:rate=24:maxiter=100" -t 30 -c:v libx264 -crf 23 mandelbrot.mp4
Parameters
size=640x360– resolution (keep it low for fast renders)rate=24– 24 fpsmaxiter=100– iteration count; lower to 50 if rendering is slow, raise to 500+ for more detail (at the cost of render time)
Live Playback with ffplay
ffplay -f lavfi "mandelbrot=size=640x360:rate=24:maxiter=100"
ffplay is FFmpeg’s built‑in player. It shows live output—no MP4, no VLC needed. Kill with q.
Applying Filters
ffmpeg -f lavfi -i "mandelbrot=size=640x360:rate=24:maxiter=100" \
-vf "hue=h=t*20" -c:v libx264 -crf 23 mandelbrot_rotated.mp4
The hue filter rotates the color spectrum over time (t is elapsed seconds).
You can also inspect the frequency content of a video (or audio) file:
ffplay -showmode 1 mandelbrot.mp4
There is no audio in the Mandelbrot video, but -showmode 1 works on any music file to visualise sound.
Other lavfi Sources
ffmpeg -f lavfi -i testsrc2 -t 10 test.mp4 # test pattern
The lavfi system includes many other sources worth exploring.
TrueLinux – March 2026