A configurable test fixture generator for MP4 files, built to support Video Commander testing.
Generates a comprehensive library of MP4 (or MOV/MKV) test files covering codecs, resolutions, frame rates, audio variants, container formats, metadata, and edge cases — all driven by a single fixtures.toml config.
ffmpegon your PATH (or setffmpeg_bininfixtures.toml)- Recommended: build from ffmpeg-builder for a static binary with all codecs
- Python 3.8+ (3.11+ preferred for stdlib
tomllib; older versions needpip install tomli)
git clone https://github.com/video-commander/mp4-fixtures
cd mp4-fixtures
chmod +x generate.sh
./generate.shOutput goes to ./output/ by default.
All configuration lives in fixtures.toml. The key sections:
[settings]
ffmpeg_bin = "ffmpeg" # path or binary name
output_dir = "./output"
output_format = "mp4" # mp4 | mov | mkvEnable or disable entire fixture categories:
[categories]
codecs = true
resolutions = true
frame_rates = true
audio = true
container = true
metadata = true
edge_cases = true
hdr = false # disabled by default — slow and largeFallback values used by all fixtures unless overridden:
[defaults]
crf = 23
audio_bitrate = "128k"
duration = 10
resolution = "1920x1080"
fps = 30Override specific parameters per fixture, or disable individual fixtures:
[fixtures.codecs.hevc_main]
enabled = true
crf = 28
[fixtures.edge_cases.long_2hr]
enabled = true
duration = 7200
crf = 40
audio_bitrate = "32k"Add arbitrary fixtures without editing any script. video_args and audio_args are passed verbatim to FFmpeg:
[[custom]]
name = "prores_422"
enabled = true
video_args = "-c:v prores_ks -profile:v 2"
audio_args = "-c:a pcm_s16le"
duration = 10
[[custom]]
name = "low_bitrate_360p"
enabled = true
video_args = "-c:v libx264 -crf 35 -vf scale=640:360"
audio_args = "-c:a aac -b:a 48k"
duration = 30./generate.sh --config path/to/my-config.tomloutput_format swaps the container extension globally (mp4, mov, or mkv). Codec compatibility is your responsibility — not all codecs mux into all containers. For example, mov_text subtitles require MP4/MOV; use srt for MKV.
| Category | What it generates |
|---|---|
codecs |
H.264 (baseline/main/high), HEVC, AV1, VP9 |
resolutions |
360p, 480p, 720p, 1080p, 4K |
frame_rates |
23.976, 24, 25, 29.97, 30, 50, 59.94, 60, VFR |
audio |
AAC-LC, AAC-HE, Opus, AC-3, 5.1, multi-track, audio-only, video-only |
container |
Fragmented fMP4, faststart, moov-at-end, edit list (elst) |
metadata |
Rotation (90/180/270), chapters, embedded subtitle track |
edge_cases |
Very short, 2-hour, truncated, B-frames, many fragments |
hdr |
HEVC HDR10 with correct SEI metadata |
- Create
lib/mycat.sh(sourcelib/helpers.shfunctions —ff,fixture_enabled,fixture_get) - Add
mycat = trueunder[categories]infixtures.toml - Add
[fixtures.mycat.*]entries as needed generate.shpicks it up automatically viarun_category mycat
Each run writes a full log to $output_dir/generate.log. Check it for skipped fixtures (codec not available) vs actual failures.
