Skip to main content

FFmpeg Quality Metrics

FFmpeg Quality Metrics logo

All Contributors

PyPI version Docker Image Version Python package

Calculate various video quality metrics with FFmpeg.

Currently supports:

  • ✅ PSNR
  • ✅ SSIM
  • ✅ VIF
  • ✅ MSAD
  • ✅ VMAF

It will output:

  • the per-frame metrics
  • global statistics (min/max/average/standard deviation)
  • a GUI, if you want to visualize the results interactively in a browser

Author: Werner Robitza werner.robitza@gmail.com

Contents:


Requirements

What you need:

  • OS: Linux, macOS, Windows
  • Python 3.10 or higher
  • FFmpeg 7.1 or higher:
    • Linux: Download a build matching your platform from here.
    • macOS: Download the snapshot build from here or install via brew install ffmpeg.
    • Windows: Download an FFmpeg binary from here. The git essentials build will suffice.

Put the ffmpeg executable in your $PATH, e.g. /usr/local/bin/ffmpeg. If you have ffprobe, also put it next to it. It is used to check the inputs before the calculation (see Input Checks) and as a fallback for FPS detection.

If you want to calculate VMAF, your ffmpeg build should include libvmaf. You also need the VMAF model files, which we bundle with this package, or you can download them from the VMAF GitHub. Note that the new VMAF v1 models (see Specifying VMAF Model) require an ffmpeg build linked against libvmaf 3.2.1 or newer.

Using uv:

uvx ffmpeg-quality-metrics

Using pipx:

pipx install ffmpeg-quality-metrics

Or, using pip:

pip3 install --user ffmpeg-quality-metrics

Usage

In the simplest case, if you have a distorted (encoded, maybe scaled) version and the reference:

ffmpeg-quality-metrics distorted.mp4 reference.y4m

The distorted file will be automatically scaled to the resolution of the reference, and the default metrics (PSNR, SSIM) will be computed.

If your distorted file is not in time sync with the reference, use --dist-delay to trim the unmatched lead-in before comparison. A positive value means the distorted file starts that many seconds later than the reference, so the reference lead-in is trimmed. A negative value means the distorted file starts earlier, so its lead-in is trimmed:

# distorted.mp4 begins with reference content from 12.5 seconds onward
ffmpeg-quality-metrics distorted.mp4 reference.mp4 \
  --metrics vmaf --dist-delay 12.5

The files are decoded and trimmed in the filtergraph; neither input is re-encoded. Metrics stop at the end of the shorter aligned stream, so trailing content from the longer file is not compared against a repeated final frame.

Input Checks

Before calculating the metrics, the tool probes both inputs with ffprobe and compares their resolution, frame rate, and duration (or frame count). If they differ, it prints a warning that explains the consequence, for example:

WARNING - Resolutions differ: distorted 854x480, reference 1280x720. The distorted video will be scaled to 1280x720 (bicubic) before comparison, which affects the metric values.
WARNING - Durations differ: distorted 3.000 s, reference 2.000 s. Only the first 2.000 s are compared; the rest of the distorted video is ignored.

The tool stops with an error if an input cannot be read or has no video stream. ffprobe is expected next to the ffmpeg executable (see --ffmpeg-path) or in your PATH. If it is not found, the checks are skipped.

Metrics

The following metrics are available in this tool:

Metric Description Scale Components/Submetrics Calculated by default?
PSNR Peak Signal to Noise Ratio dB (higher is better) mse_avg
mse_y
mse_u
mse_v
psnr_avg
psnr_y
psnr_u
psnr_v
✔️
SSIM Structural Similarity 0-100 (higher is better) ssim_y
ssim_u
ssim_v
ssim_avg
✔️
VMAF Video Multi-Method Assessment Fusion 0-100 (higher is better) vmaf
integer_adm2
integer_adm_scale0
integer_adm_scale1
integer_adm_scale2
integer_adm_scale3
integer_motion2
integer_motion
integer_vif_scale0
integer_vif_scale1
integer_vif_scale2
integer_vif_scale3
No
VIF Visual Information Fidelity 0-100 (higher is better) scale_0
scale_1
scale_2
scale_3
No
MSAD Mean Sum of Absolute Differences depends on input video, minimum is 0 (higher is worse) msad_y
msad_u
msad_v
msad_avg
No

As shown in the table, every metric can have more than one submetric computed, and they will be printed in the output. The exact set of VMAF submetrics depends on the chosen model and the libvmaf version; the table above shows the output for the default (v0) model. VMAF v1 models output different submetrics (e.g. CAMBI and chroma-related features).

If you want to calculate additional metrics, enable them with the --metrics option:

ffmpeg-quality-metrics distorted.mp4 reference.avi --metrics psnr ssim vmaf

Specify multiple metrics by separating them with a space (e.g., in the above example, psnr ssim vmaf).

Here, VMAF uses the default model. You can specify a different model with the --vmaf-model option. VMAF also allows you to calculate even more additional features as submetrics. You can enable these with the --vmaf-features option.

Extended Options

You can configure additional options related to scaling, speed etc.

See ffmpeg-quality-metrics -h:

usage: ffmpeg-quality-metrics [-h] [-n] [-v] [-p] [-k] [--tmp-dir TMP_DIR]
                              [-m {vmaf,psnr,ssim,vif,msad} [{vmaf,psnr,ssim,vif,msad} ...]]
                              [-s {fast_bilinear,bilinear,bicubic,experimental,neighbor,area,bicublin,gauss,sinc,lanczos,spline}]
                              [-r FRAMERATE] [--dist-delay DIST_DELAY] [-t THREADS]
                              [--num-frames NUM_FRAMES] [--start-offset START_OFFSET]
                              [--ffmpeg-path FFMPEG_PATH] [-o OUTPUT_FILE] [-of {json,csv}]
                              [--no-summary] [--gui] [--gui-host GUI_HOST] [--gui-port GUI_PORT]
                              [--vmaf-model-path VMAF_MODEL_PATH]
                              [--vmaf-model-params VMAF_MODEL_PARAMS [VMAF_MODEL_PARAMS ...]]
                              [--vmaf-threads VMAF_THREADS] [--vmaf-subsample VMAF_SUBSAMPLE]
                              [--vmaf-10bit] [--vmaf-features VMAF_FEATURES [VMAF_FEATURES ...]]
                              dist ref

ffmpeg-quality-metrics v3.11.4

positional arguments:
  dist                                  input file, distorted
  ref                                   input file, reference

options:
  -h, --help                            show this help message and exit

General options:
  -n, --dry-run                         Do not run commands, just show what would be done (default:
                                        False)
  -v, --verbose                         Show verbose output (default: False)
  -p, --progress                        Show a progress bar (default: False)
  -k, --keep-tmp                        Keep temporary files for debugging purposes (default: False)
  --tmp-dir TMP_DIR                     Directory to store temporary files in (will use system
                                        default if not specified) (default: None)

Metric options:
  -m, --metrics {vmaf,psnr,ssim,vif,msad} [{vmaf,psnr,ssim,vif,msad} ...]
                                        Metrics to calculate. Specify multiple metrics like '--
                                        metrics ssim vmaf' (default: ['psnr', 'ssim'])

FFmpeg options:
  -s, --scaling-algorithm {fast_bilinear,bilinear,bicubic,experimental,neighbor,area,bicublin,gauss,sinc,lanczos,spline}
                                        Scaling algorithm for ffmpeg (default: bicubic)
  -r, --framerate FRAMERATE             Force an input framerate (default: None)
  --dist-delay DIST_DELAY               Temporally align the inputs by trimming unmatched leading
                                        frames. Positive trims the reference; negative trims the
                                        distorted input. (default: 0.0)
  -t, --threads THREADS                 Number of threads to do the calculations (default: 0)
  --num-frames NUM_FRAMES               Number of frames to analyze from the input files (default:
                                        all frames) (default: None)
  --start-offset START_OFFSET           Seek to this position before analyzing. Accepts timestamp
                                        (e.g., '00:00:10' or '10.5') or frame number with 'f:'
                                        prefix (e.g., 'f:100'). Note: seeking may not be frame-
                                        accurate due to keyframe constraints. (default: None)
  --ffmpeg-path FFMPEG_PATH             Path to ffmpeg executable (default: ffmpeg)

Output options:
  -o, --output-file OUTPUT_FILE         Output file for the metrics. If not specified, stdout will
                                        be used. (default: None)
  -of, --output-format {json,csv}       Output format for the metrics (default: json)
  --no-summary                          Do not print a summary of the global stats to stderr after
                                        the calculation (default: False)
  --gui                                 Open interactive GUI dashboard after computing metrics
                                        (requires 'gui' extra: pip install 'ffmpeg-quality-
                                        metrics[gui]') (default: False)
  --gui-host GUI_HOST                   Host address for the GUI dashboard (default: 127.0.0.1)
  --gui-port GUI_PORT                   Port for the GUI dashboard (default: 8050)

VMAF options:
  --vmaf-model-path VMAF_MODEL_PATH     Use a specific VMAF model file. If none is chosen, picks a
                                        default model. You can also specify one of the following
                                        built-in models: ['vmaf_4k_v0.6.1.json', 'vmaf_v0.6.1.json',
                                        'vmaf_v0.6.1neg.json', 'vmaf_v1.0.16_1d5h_2160.json',
                                        'vmaf_v1.0.16_3d0h.json', 'vmaf_v1.0.16_3d0h_2160.json',
                                        'vmaf_v1.0.16_5d0h.json', 'vmaf_v1.0.16_hfr_1d5h_2160.json',
                                        'vmaf_v1.0.16_hfr_3d0h.json',
                                        'vmaf_v1.0.16_hfr_3d0h_2160.json',
                                        'vmaf_v1.0.16_hfr_5d0h.json'] (default: /opt/homebrew/opt/li
                                        bvmaf/share/libvmaf/model/vmaf_v0.6.1.json)
  --vmaf-model-params VMAF_MODEL_PARAMS [VMAF_MODEL_PARAMS ...]
                                        A list of params to pass to the VMAF model, specified as
                                        key=value. Specify multiple params like '--vmaf-model-params
                                        enable_transform=true enable_conf_interval=true' (default:
                                        None)
  --vmaf-threads VMAF_THREADS           Set the value of libvmaf's n_threads option. This determines
                                        the number of threads that are used for VMAF calculation.
                                        Set to 0 for auto. (default: 0)
  --vmaf-subsample VMAF_SUBSAMPLE       Set the value of libvmaf's n_subsample option. This is the
                                        subsampling interval, so set to 1 for default behavior.
                                        (default: 1)
  --vmaf-10bit                          Convert both inputs to 10 bit before calculating VMAF. This
                                        is recommended for VMAF v1 models (vmaf_v1.0.16 and newer),
                                        which should ideally be applied at 10-bit precision for SDR
                                        content. (default: False)
  --vmaf-features VMAF_FEATURES [VMAF_FEATURES ...]
                                        A list of feature to enable. Pass the names of the features
                                        and any optional params. See https://github.com/Netflix/vmaf
                                        /blob/master/resource/doc/features.md for a list of
                                        available features. Params must be specified as 'key=value'.
                                        Multiple params must be separated by ':'. Specify multiple
                                        features like '--vmaf-features cambi:full_ref=true ciede'
                                        (default: None)

Seeking and Frame Selection

You can control which portion of the input videos to analyze using the --start-offset and --num-frames options.

To analyze only a specific number of frames (e.g., for faster processing or testing), use the --num-frames option:

ffmpeg-quality-metrics distorted.mp4 reference.y4m --num-frames 100

To skip the beginning of the video and start analysis at a specific position, use the --start-offset option. This accepts either a timestamp or a frame number:

# Seek to 10 seconds
ffmpeg-quality-metrics distorted.mp4 reference.y4m --start-offset 10

# Or use HH:MM:SS format
ffmpeg-quality-metrics distorted.mp4 reference.y4m --start-offset 00:00:10

# Seek to frame 100 (prefix with "f:")
ffmpeg-quality-metrics distorted.mp4 reference.y4m --start-offset f:100

VMAF-specific Settings

As VMAF is more complex than the other metrics, it has a few more options.

Specifying VMAF Model

Use the --vmaf-model-path option to set the path to a different VMAF model file. The default is vmaf_v0.6.1.json.

This program has built-in support for the following models:

vmaf_v0.6.1.json
vmaf_v0.6.1neg.json
vmaf_4k_v0.6.1.json
vmaf_v1.0.16_3d0h.json
vmaf_v1.0.16_5d0h.json
vmaf_v1.0.16_1d5h_2160.json
vmaf_v1.0.16_3d0h_2160.json
vmaf_v1.0.16_hfr_3d0h.json
vmaf_v1.0.16_hfr_5d0h.json
vmaf_v1.0.16_hfr_1d5h_2160.json
vmaf_v1.0.16_hfr_3d0h_2160.json

The vmaf_v0.6.1* and vmaf_4k_v0.6.1 files are the previous generation of models (VMAF v0). Use the 4k version if you have a 4K reference sample. The neg version is explained here.

The vmaf_v1.0.16* files are the new generation of models (VMAF v1), released in June 2026, which offer better accuracy than the v0 models. Pick the model based on your viewing scenario:

Scenario Display Normalized viewing distance Model file Score range
Standard 1080p 1080p 3H vmaf_v1.0.16_3d0h.json [0, 100]
Phone 1080p 5H vmaf_v1.0.16_5d0h.json [0, 100]
4K default 2160p 1.5H vmaf_v1.0.16_1d5h_2160.json [0, 100]
4K consumer TV 2160p 3H vmaf_v1.0.16_3d0h_2160.json [0, 110]

For high-frame-rate content (roughly 50/60 fps, e.g. sports), use the corresponding vmaf_v1.0.16_hfr_* variant instead.

VMAF v1 should ideally be applied at 10-bit precision for SDR content, which helps more accurately capture the presence of banding. Use the --vmaf-10bit option to convert both inputs to 10 bit before calculating VMAF, even if they are 8-bit:

ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-model-path vmaf_v1.0.16_3d0h.json --vmaf-10bit

You can either specify an absolute path to an existing model, e.g.:

/usr/local/opt/libvmaf/share/model/vmaf_v0.6.1neg.json

Or pass the file name of a built-in model. So all of these work:

# use a built-in VMAF v0 model
ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-model-path vmaf_v0.6.1neg.json

# use a built-in VMAF v1 model, measured at 10 bit as recommended
ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-model-path vmaf_v1.0.16_3d0h.json --vmaf-10bit

# use a different path for models on your system
ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-model-path /usr/local/opt/libvmaf/share/model/vmaf_v0.6.1neg.json

Specifying VMAF Features

VMAF includes several metrics, each of which correspond to a feature name. By default, only three core features are used. Use the --vmaf-features option to enable additional features on top of the core features.

The following table shows the available features:

Metric Feature name Core feature in VMAF?
PSNR psnr
PSNR-HVS psnr_hvs
CIEDE2000 ciede
CAMBI cambi
VIF vif ✔️
ADM adm ✔️
Motion motion ✔️
SSIM float_ssim
MS-SSIM float_ms_ssim

To find out more about the features, check out the VMAF documentation.

For example, to enable the CAMBI feature, use:

ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-features cambi

To enable more than one feature, separate them with a space:

ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-features cambi psnr

VMAF Feature Parameters

Some features additionally take a number of optional parameters. The following table shows the available parameters for each feature:

Feature Parameter Default Description
adm adm_csf_mode 0 Contrast sensitivity function
adm adm_enhn_gain_limit 100.0 Enhancement gain imposed on adm, must be >= 1.0, where 1.0 means the gain is completely disabled
adm adm_norm_view_dist 3.0 Normalized viewing distance = viewing distance / ref display's physical height
adm adm_ref_display_height 1080 Reference display height in pixels
adm debug false Debug mode: enable additional output
cambi enc_bitdepth Encoding bitdepth.
cambi enc_height Encoding height.
cambi enc_width Encoding width.
cambi eotf bt1886 Determines the EOTF used to compute the visibility thresholds.
cambi full_ref false Set to true to enable full-reference CAMBI calculation.
cambi heatmaps_path Set to a target folder where the CAMBI heatmaps will be stored as .gray files
cambi max_log_contrast 2 Maximum contrast in log luma level (2^max_log_contrast) at 10-bits.
cambi src_height Source height. Only used when full_ref=true.
cambi src_width Source width. Only used when full_ref=true.
cambi topk 0.2 Ratio of pixels for the spatial pooling computation.
cambi tvi_threshold 0.75 Visibility threshold for luminance ΔL < tvi_threshold*L_mean.
cambi window_size 63 Window size to compute CAMBI: 63 corresponds to ~1 degree at 4k.
motion debug true Enable additional output for debugging.
motion motion_force_zero false Force the motion score to be zero. This parameter is a feature-specific parameter.
ms_ssim clip_db false Clip dB scores
ms_ssim enable_db false Write MS-SSIM values as dB
ms_ssim enable_lcs false Enable luminance, contrast and structure intermediate output
ssim clip_db false Clip dB scores
ssim enable_db false Write SSIM values as dB
ssim enable_lcs false Enable luminance, contrast and structure intermediate output
vif debug false Debug mode: enable additional output
vif vif_enhn_gain_limit 100.0 Enhancement gain imposed on vif, must be >= 1.0, where 1.0 means the gain is completely disabled
vif vif_kernelscale 1.0 Scaling factor for the gaussian kernel (2.0 means multiplying the standard deviation by 2 and enlarge the kernel size accordingly)

The parameters are specified as key=value pairs, separated by :. For example, to enable the full-reference CAMBI calculation, use:

ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-features cambi:full_ref=true

To generate the CAMBI heatmaps, use:

ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-features cambi:heatmaps_path=/tmp/cambi

VMAF Model Parameters

These parameters control the VMAF model itself (not the features).

Parameter Description Default
enable_transform Enable the transform feature, which transforms the scores to represent quality as perceived on a phone (used to be called phone_model) false
enable_conf_interval Enable the confidence interval calculation false

To specify these parameters, use the --vmaf-model-params option, and separate each parameter with a space. For example:

ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf --vmaf-model-params enable_transform=true enable_conf_interval=true

You can also override individual feature options of the model by prefixing the option with the feature name and a dot. This is useful for the CAMBI feature used by VMAF v1 models: if you know the encode-side width, height, and bit depth of the distorted video (i.e., the dimensions and bit depth at which the video was actually encoded, before any rescaling for display), you can pass them along. For example, for a 1280x720 8-bit encoded video that is measured against a 1080p reference:

ffmpeg-quality-metrics dist.mkv ref.mkv -m vmaf \
    --vmaf-model-path vmaf_v1.0.16_3d0h.json --vmaf-10bit \
    --vmaf-model-params cambi.enc_width=1280 cambi.enc_height=720 cambi.enc_bitdepth=8

These overrides are merged into the model's CAMBI feature options. When they are not provided, CAMBI falls back to the input width/height and bit depth.

Examples

Run PSNR, SSIM, VMAF and VIF at the same time:

ffmpeg-quality-metrics dist.mkv ref.mkv \
    -m psnr ssim vmaf vif

Run VMAF with all the features:

ffmpeg-quality-metrics dist.mkv ref.mkv \
    -m vmaf \
    --vmaf-features ciede cambi psnr psnr_hvs motion adm vif

Enable feature options for CAMBI full-reference calculation:

ffmpeg-quality-metrics dist.mkv ref.mkv \
    -m vmaf \
    --vmaf-features cambi:full_ref=true

Running with Docker

You can use the pre-built image from Docker Hub:

docker run -v "$(pwd):/videos" -it slhck/ffmpeg-quality-metrics

Alternatively, download this repository and run

docker build -t ffmpeg-quality-metrics .

You can then run the container, which basically calls the Python script. To help you with mounting the volumes (since your videos are not stored in the container), you can run a helper script:

./docker_run.sh <dist> <ref> [OPTIONS]

Check the output of ./docker_run.sh for more help.

For example, to run the tool with the bundled test videos and enable VMAF calculation:

./docker_run.sh test/dist-854x480.mkv test/ref-1280x720.mkv -m vmaf

Output

This tool supports JSON or CSV output, including individual fields for planes/components/submetrics, and global statistics, as well as frame numbers (n). By default, the output is written to stdout. If you want to write the output to a file, use the -o/--output-file option:

ffmpeg-quality-metrics dist.mkv ref.mkv -m psnr -o output.json

The output file will be in the same format as the JSON output.

After the calculation, a summary of the global stats (average, minimum, and maximum) of the main submetrics is printed to stderr, so it does not interfere with the JSON or CSV output on stdout:

INFO - Summary over 3 frames:
  metric         average        min        max
  vmaf            14.258     14.055     14.464
  psnr_avg        20.840     20.830     20.850
  ssim_avg         0.945      0.945      0.946

Use --no-summary to disable it.

JSON Output

The JSON output will include a key for each metric, and the value will be a list of values for each frame. Each frame is a dictionary with individual metrics per frame.

For instance, PSNR and SSIM output averages as well as per-component metrics. VMAF outputs different metrics depending on the enabled features.

The global key contains global statistics for each metric and its submetrics.

See the example.json file for an example of the output.

CSV Output

CSV output is using the tidy data principle, using one column per feature and one line per frame (observation).

Example:

n,adm2,motion2,ms_ssim,psnr,ssim,vif_scale0,vif_scale1,vif_scale2,vif_scale3,vmaf,mse_avg,mse_u,mse_v,mse_y,psnr_avg,psnr_u,psnr_v,psnr_y,ssim_avg,ssim_u,ssim_v,ssim_y,input_file_dist,input_file_ref
1,0.70704,0.0,0.89698,18.58731,0.92415,0.53962,0.71805,0.75205,0.77367,15.44212,536.71,234.48,475.43,900.22,20.83,24.43,21.36,18.59,0.945,0.96,0.942,0.934,test/dist-854x480.mkv,test/ref-1280x720.mkv
2,0.7064,0.35975,0.89806,18.60299,0.9247,0.54025,0.71961,0.75369,0.77607,15.85038,535.29,239.4,469.49,896.98,20.84,24.34,21.41,18.6,0.946,0.96,0.943,0.934,test/dist-854x480.mkv,test/ref-1280x720.mkv
3,0.70505,0.35975,0.89879,18.6131,0.92466,0.5391,0.71869,0.75344,0.77616,15.63546,535.04,245.8,464.43,894.89,20.85,24.22,21.46,18.61,0.945,0.959,0.943,0.934,test/dist-854x480.mkv,test/ref-1280x720.mkv

As there is no tidy way to represent global data in the same CSV file, you can use other tools to aggregate the data.

GUI Visualization

This tool includes an optional interactive dashboard powered by Plotly Dash for visualizing quality metrics in the browser.

GUI screenshot

Installation

To use the GUI features, you need to install the optional gui dependencies.

Using uvx (recommended, no installation needed), you can run it directly:

# Run with GUI after calculation
uvx 'ffmpeg-quality-metrics[gui]' ffmpeg-quality-metrics dist.mp4 ref.mp4 --gui

# Or use the standalone viewer
uvx --from 'ffmpeg-quality-metrics[gui]' ffmpeg-quality-metrics-gui output.json

Or, if you've already installed the package as a local dependency, add the GUI extra dependencies:

# With uv
uv add 'ffmpeg-quality-metrics[gui]'

# Or with pip
pip install 'ffmpeg-quality-metrics[gui]'

Interactive Dashboard

After calculating metrics, you can launch an interactive dashboard with the --gui flag:

ffmpeg-quality-metrics dist.mp4 ref.mp4 --gui

This will:

  1. Calculate the quality metrics as usual
  2. Save the output (if --output-file is specified, otherwise will be kept in memory)
  3. Open an interactive dashboard in your browser at http://127.0.0.1:8050

You can customize the host and port if needed:

ffmpeg-quality-metrics dist.mp4 ref.mp4 --gui --gui-host 0.0.0.0 --gui-port 8080

The dashboard includes:

  • separate line charts for each primary metric (PSNR, SSIM, VMAF) with appropriate scales
  • per-component breakdowns (Y/U/V planes, VIF scales)
  • metric distributions
  • statistics tables
  • sortable table with all per-frame data

You can also visualize previously saved metrics files using the standalone viewer:

ffmpeg-quality-metrics-gui output.json

The GUI viewer supports loading multiple metrics files for side-by-side comparison:

ffmpeg-quality-metrics-gui file1.json file2.json file3.json

When multiple clips are loaded, the dashboard provides a distinct color for each clip.

API

The program exposes an API that you can use yourself:

from ffmpeg_quality_metrics import FfmpegQualityMetrics

ffqm = FfmpegQualityMetrics("path/to/reference-video.mp4", "path/to/distorted-video.mp4")

# compare the inputs and log warnings if they differ (calculate() also runs this)
# returns (ref_info, dist_info), or None if ffprobe is not available
input_info = ffqm.check_inputs()

metrics = ffqm.calculate(["ssim", "psnr"])

# check the available metrics
print(metrics.keys())
# ['ssim', 'psnr']

# get the SSIM values for the first frame
print(metrics["ssim"][0])
# {'n': 1, 'ssim_y': 0.934, 'ssim_u': 0.96, 'ssim_v': 0.942, 'ssim_avg': 0.945}

# average the ssim_y values over all frames
print(sum([frame["ssim_y"] for frame in metrics["ssim"]]) / len(metrics["ssim"]))

# or just get the global stats
print(ffqm.get_global_stats()["ssim"]["ssim_y"]["average"])

# print a short summary table of the main submetrics
print(ffqm.get_summary())

# probe a single file
print(FfmpegQualityMetrics.probe_input("path/to/reference-video.mp4"))
# {'path': 'path/to/reference-video.mp4', 'width': 1280, 'height': 720, 'framerate': 25.0, 'duration': 10.0, 'nb_frames': 250}

For more usage please read the docs.

Contributors

Orkun Koçyiğit
Orkun Koçyiğit

💻
Hamas Shafiq
Hamas Shafiq

💻
Chris Griffith
Chris Griffith

💻
Ignacio Peletier
Ignacio Peletier

💻
Nav
Nav

🐛
Alexey Slobodiskiy
Alexey Slobodiskiy

💻
ls-milkyway
ls-milkyway

💻
Anton Kesy
Anton Kesy

📖 💻
Rogue Kernel
Rogue Kernel

💻
David Lindero
David Lindero

💻

License

ffmpeg-quality-metrics, Copyright (c) 2019-2025 Werner Robitza

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For VMAF models, see ffmpeg_quality_metrics/vmaf_models/LICENSE.

Metadata

Release files for ffmpeg-quality-metrics 3.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ffmpeg-quality-metrics 3.13.0
File Size Uploaded
ffmpeg_quality_metrics-3.13.0.tar.gz 76.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ffmpeg-quality-metrics 3.13.0
File Interpreter ABI Platform
ffmpeg_quality_metrics-3.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 186.2 kB

Release files / ffmpeg_quality_metrics-3.13.0.tar.gz

Download URL ffmpeg_quality_metrics-3.13.0.tar.gz
Size 76.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cc02eea97794b25185146225c50c527d4f898e602f7492757e94c38ba69dea6d
BLAKE2b-256 checksum
How to use checksums
ead83979bb5ec27cdc91ae4b7727f15171abf246d856bc25b31ec041da8af2c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / ffmpeg_quality_metrics-3.13.0-py3-none-any.whl

Download URL ffmpeg_quality_metrics-3.13.0-py3-none-any.whl
Size 109.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f285503e863580f23bec54fe197fe807460f254d3464122a4f168b0e91b21500
BLAKE2b-256 checksum
How to use checksums
4704a75f3501d37cc98e12172e23902bbf8411254d92fc49dc63b3fe82e43399
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

3.13.0 This release

2 release files

3.12.7

2 release files

3.12.6

2 release files

3.12.2

2 release files

3.12.1

2 release files

3.12.0

2 release files

3.11.4

2 release files

3.11.3

2 release files

3.11.2

2 release files

3.11.1

2 release files

3.11.0

2 release files

3.9.0

2 release files

3.8.0

2 release files

3.7.2

2 release files

3.7.1

2 release files

3.7.0

1 release file

3.6.2

1 release file

3.6.1

1 release file

3.6.0

1 release file

3.5.3

1 release file

3.5.2

1 release file

3.5.1

1 release file

3.5.0

2 release files

3.4.2

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.7

2 release files

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.1

1 release file

0.12.1

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

1 release file

0.3.5

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page