audio-metrics

Defines ffmpeg audio metrics for spectral statistics, loudness, and level measurements.

716|31|Updated Mar 13, 2023
One-click install
npx skills add https://github.com/wimpysworld/nix-config --skill audio-metrics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audio-metrics
Source: https://github.com/wimpysworld/nix-config/tree/main/home-manager/_mixins/agentic/assistants/skills/audio-metrics
Command: npx skills add https://github.com/wimpysworld/nix-config --skill audio-metrics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Interpreting ffmpeg audio measurements is error-prone because metrics like spectral crest, crest factor, LUFS, and true peak are easily confused, and ffmpeg's documentation is terse about exact computations, units, and ranges. This Skill provides verified, source-checked definitions of every metric produced by the aspectralstats, astats, ebur128, and loudnorm filters.

Core Features & Use Cases

  • Metric Definitions: Precise computation formulas, units, ranges, and confidence levels for every aspectralstats, astats, ebur128, and loudnorm metric, verified against FFmpeg 8.1 source.
  • Disambiguation: Clarifies commonly confused pairs such as spectral crest vs time-domain crest factor, kurtosis vs excess kurtosis, and sample peak vs oversampled true peak.
  • Standards Reference: Documents loudness targets from ITU-R BS.1770, EBU R128, ATSC A/85, and platform norms for Spotify, Apple Podcasts, YouTube, and ACX.
  • Use Case: When a user reports their podcast measures -18 LUFS integrated with a -1.5 dBTP true peak, use this Skill to explain what those numbers mean and which platform targets they satisfy.

Quick Start

Ask the assistant to explain what the loudnorm output fields input_i, input_tp, and input_lra mean for your measured audio file.

Frequently Asked Questions about audio-metrics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure loudness in LUFS with ffmpeg?

Run ffmpeg with the ebur128 filter: ffmpeg -i in.wav -af ebur128 -f null -. It reports integrated loudness in LUFS, loudness range in LU, and true peak in dBTP using ITU-R BS.1770 K-weighting.

What is the difference between LUFS, LU, and dBTP in ffmpeg?

LUFS measures absolute loudness per ITU-R BS.1770 K-weighting, LU measures relative loudness differences such as loudness range, and dBTP measures inter-sample true peak on the oversampled signal. The ebur128 filter reports all three.

What loudness level should I target for Spotify or Apple Podcasts?

Spotify normalizes playback to -14 LUFS with mastering at or below -1 dBTP, while Apple Podcasts targets -16 LKFS plus or minus 1 dB with true peak at or below -1 dBFS. These are platform norms, not formal standards like EBU R128's -23 LUFS.

Does loudnorm true peak match ebur128 true peak?

No. The loudnorm filter's input_tp and output_tp fields are sample peaks computed as 20*log10 of the maximum sample, while the standalone ebur128 filter's True Peak uses oversampling per BS.1770 Annex 2. They can differ on the same audio.

What is the difference between spectral crest and crest factor?

Spectral crest from aspectralstats is max magnitude bin divided by mean magnitude in the frequency domain, while astats crest factor is peak sample divided by RMS in the time domain. Both are linear dimensionless ratios of at least 1, never dB.

How do I export per-frame ffmpeg audio statistics to a file?

Chain the ametadata filter after the measurement filter, for example: ffmpeg -i in.wav -af aspectralstats,ametadata=mode=print:file=spectral.log -f null -. This writes per-frame metadata keys to a log file for downstream parsing.