#audio-video #metrics #ssim #quality #psnr #algorithm #ciede2000

av-metrics

A collection of algorithms for measuring audio/video metrics

15 releases (8 breaking)

0.9.1 Apr 23, 2023
0.9.0 Oct 5, 2022
0.8.1 Mar 24, 2022
0.7.2 Oct 15, 2021
0.3.0 Nov 11, 2019

#180 in Algorithms

Download history 2409/week @ 2024-07-23 2351/week @ 2024-07-30 1793/week @ 2024-08-06 1694/week @ 2024-08-13 1542/week @ 2024-08-20 1573/week @ 2024-08-27 1643/week @ 2024-09-03 1632/week @ 2024-09-10 1867/week @ 2024-09-17 1924/week @ 2024-09-24 2194/week @ 2024-10-01 1926/week @ 2024-10-08 1934/week @ 2024-10-15 1416/week @ 2024-10-22 1635/week @ 2024-10-29 1893/week @ 2024-11-05

7,142 downloads per month
Used in 6 crates (3 directly)

MIT license

100KB
2.5K SLoC

Quality metrics

crate docs LICENSE Actions Status IRC zulip chat

Video Metrics implemented

  • PSNR
  • APSNR
  • PSNR HVS
  • SSIM
  • MSSSIM
  • CIEDE2000

Installation

As a library

Add the following to your Cargo.toml

av-metrics = "0.7"

Then check out the API docs.

As a binary

Windows

Download the latest binary from the Releases tab.

OS X and Linux

Pre-built binaries are coming soon. In the meantime, have the latest stable Rust installed and run the following:

cargo install av-metrics-tool

Usage

From any terminal, run the executable with your two video files as arguments:

➜ av-metrics-tool lossless.y4m lossy.y4m

You should receive output for all supported metrics:

PSNR - Y: 32.5281  U: 36.4083  V: 39.8238  Avg: 33.6861
APSNR - Y: 32.5450  U: 36.4087  V: 39.8244  Avg: 33.6995
PSNR HVS - Y: 34.3225  U: 37.7400  V: 40.5569  Avg: 31.8674
SSIM - Y: 13.2572  U: 10.8624  V: 12.8369  Avg: 12.6899
MSSSIM - Y: 18.8343  U: 16.6943  V: 18.7662  Avg: 18.3859
CIEDE2000 - 36.2820

By default, the tool can only decode y4m files. Both files must match in resolution, bit depth, and color sampling.

Alternate input formats can be supported by enabling FFMpeg support. Due to limitations, this currently has to be enabled at compile time.

In the crate, this can be enabled with the feature "ffmpeg-decode". In the binary, this can be enabled with the feature "ffmpeg".


lib.rs:

av_metrics is a collection of quality metrics for audio and video files. Currently only includes video metrics. Audio metrics will likely be added in the future.

Dependencies

~2–2.9MB
~58K SLoC