fmaf - Linux


Overview

fmaf is a command-line tool for comparing video and audio files. It uses a perceptual quality metric to assess the similarity between two files, and can be used to compare files that are encoded with different codecs, bitrates, or resolutions.

Syntax

fmaf [options] file1 file2

Options/Flags

  • -m, –model: Specify the perceptual quality metric to use. Available options are:
    • vmaf: Video Multi-Method Assessment Fusion
    • psnr: Peak Signal-to-Noise Ratio
    • ssim: Structural Similarity Index Metric
  • -v, –verbosity: Set the verbosity level. Higher values produce more output.
  • -d, –debug: Enable debug mode.
  • -h, –help: Print help and exit.

Examples

  • Compare two videos using the VMAF metric:
fmaf -m vmaf video1.mp4 video2.mp4
  • Compare two audio files using the PSNR metric:
fmaf -m psnr audio1.wav audio2.wav

Common Issues

  • Error: File not found. Ensure that both files exist and are accessible.
  • Error: Invalid file format. Make sure that both files are in a supported format.
  • Error: Perceptual quality metric not found. Ensure that the specified metric is installed or supported by the version of fmaf you are using.

Integration

fmaf can be integrated into scripts or command chains for automated video and audio quality assessment. For example, the following command compares two videos and prints the VMAF score:

fmaf -m vmaf video1.mp4 video2.mp4 | awk '{print $2}'

Related Commands

  • ffmpeg: A command-line tool for converting and transcoding video and audio files.
  • vmafinfo: A tool for displaying the VMAF score of a video file.