FFmpeg Has a Mandelbrot Generator Built In

Published: (March 4, 2026 at 03:57 PM EST)
2 min read
Source: Dev.to

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 fps
  • maxiter=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

0 views
Back to Blog

Related posts

Read more »

Good software knows when to stop

The “New” ls Experience It’s 9 AM, you’re ready to upgrade your favorite Linux distribution and packages to their latest versions. The process goes smoothly, a...

Git Cheatsheet

This cheatsheet lists the Git commands commonly used to submit a PR pull request to a GitHub repository. It’s mainly for reference. Branch Management bash git c...