Tool
Enter the resolution, fps and pixel format of your encoded video and the original, and this tool builds the FFmpeg command that measures VMAF with libvmaf. It writes the input order, the resolution matching and the model path escaping that so often trips people up on Windows, all tailored to your shell (PowerShell, cmd or bash). It never reads or uploads your files; only the names go into the command.
1. Shell to run the command in
2. Files
Type the file name or path as-is. The tool never reads the files; it only puts the names into the command.
3. Properties of the two videos (check with ffprobe or a file info tool)
4. Model and output
n_subsample 1 = every frame, first N seconds 0 = the whole video.
5. Finished command
ffmpeg -hide_banner ` -i 'encoded.mp4' ` -i 'original.mp4' ` -lavfi '[0:v]format=yuv420p,setpts=PTS-STARTPTS[dist];[1:v]format=yuv420p,setpts=PTS-STARTPTS[ref];[dist][ref]libvmaf=model=version=vmaf_v0.6.1:n_threads=4:log_fmt=json:log_path=vmaf.json' ` -f null -
Input order: the first -i is the video to compare (the encoded one) and the second -i is the original. Swapping them changes the score.
Both videos are converted to 8-bit (yuv420p) for measuring. If the original is 10-bit, matching to 10-bit loses no information.
n_threads is the number of threads libvmaf uses. Our lab tests used 4 per job on a 6-core, 12-thread PC.
When it finishes, vmaf.json is created. Load it into the VMAF log viewer tool to see per-frame scores.
The command takes two inputs, reshapes each one with filters, passes them to libvmaf, and saves the result as a JSON log. There is no video to display, so the output is -f null -.
-i is the video to compare (the encoded one) and the second is the original. Swapping them changes the score, so check this first.fps filter is added to the encoded video. If frames are off by even one, the comparison itself goes off, so for variable frame rate video, check with the VFR detector first.In an FFmpeg filter string, the colon (:) separates options, so using the drive-letter colon in C:/models/... as-is cuts the path off right there. You have to put a backslash before the colon, and because escaping is applied in layers (the filtergraph level and the option level), the number of backslashes grows. The rules this tool uses are below. They were built from the escaping description in the FFmpeg documentation, so please read ‘Limitations’ further down as well.
log_path=): C\\:/work/vmaf.json — two backslashes.model=path=): C\\\\:/ffmpeg/model/vmaf_v0.6.1.json — the model= value has one more inner key=value level, so four backslashes.model=version=vmaf_v0.6.1, no file path is needed (for libvmaf builds that include the built-in models). And if you keep the log as a relative path like vmaf.json, there is no colon.If an example you found online shows model_path=...pkl, psnr=1 or ssim=1, that is known to be the libvmaf 1.x syntax. Recent FFmpeg builds use model=version=... or model=path=...json, and feature=name=psnr.
scale in it. Scaling the encoded video to the original's size is the common approach.vmaf.json is created, load it into the VMAF log viewer to see the per-frame graph, the bottom 1% and the minimum. Judging by a single average can hide the bad moments; that is covered in Is an average VMAF of 95 safe? A lab test.vmaf and vmaf_neg.libvmaf appears in ffmpeg -filters. If it doesn't, inspect your build with the FFmpeg build checker and switch builds. The model syntax here is for libvmaf 2.x with FFmpeg 5 and later, and may not fit older builds.