Before you raise, lower or normalise the volume of a file, you want to know where it is now. volumedetect scans the audio and reports the peak and mean level in dBFS plus a histogram of loud samples — enough to tell whether a recording is too quiet, whether it’s clipping, and how much headroom you have.
Verified: FFmpeg 8.1 on Windows — all 4 commands in this article were executed by the verification script and passed (2026-09-06).
Basic command
ffmpeg -i input.mp3 -af volumedetect -f null /dev/null
-f null /dev/null discards the output; nothing is written. The measurements appear on stderr at the end of the run. On Windows, NUL works in place of /dev/null, and -f null - works everywhere.
Reading the output
[Parsed_volumedetect_0 @ 0x...] n_samples: 13230000
[Parsed_volumedetect_0 @ 0x...] mean_volume: -23.1 dB
[Parsed_volumedetect_0 @ 0x...] max_volume: -0.5 dB
[Parsed_volumedetect_0 @ 0x...] histogram_0db: 12
[Parsed_volumedetect_0 @ 0x...] histogram_1db: 45
| Field | Meaning |
|---|---|
n_samples |
Number of samples analysed (all channels) |
mean_volume |
RMS level of the whole file, in dBFS |
max_volume |
The loudest single sample, in dBFS |
histogram_Xdb |
How many samples fell into the band X dB below full scale. Only bands with samples are printed |
What dBFS means
dBFS (decibels relative to full scale) is the level unit for digital audio.
0 dBFS= the largest value the format can hold; anything louder is clipped-6 dBFS≈ half the amplitude of full scale- Closer to 0 is louder; every value is zero or negative
Checking a video’s audio
ffmpeg -i input.mp4 -af volumedetect -f null /dev/null
Works the same on video files. With several audio tracks, pick one with -map 0:a:1 (the second track). Add -vn to skip decoding the video, which makes the scan considerably faster on long files:
ffmpeg -i input.mp4 -vn -af volumedetect -f null /dev/null
Using the numbers before normalising
If max_volume is −0.5 dB, you can raise the file by 0.5 dB before the peak hits 0 dBFS. Peak normalisation is simply “add the negative of max_volume”:
1. Measure
ffmpeg -i input.mp3 -af volumedetect -f null /dev/null
2. Apply the gain with the volume filter
ffmpeg -i input.mp3 -af "volume=+0.5dB" output.mp3
Peak normalisation only guarantees the file won’t clip; it says nothing about how loud it sounds. For loudness matching to a target such as −16 LUFS (podcasts) or −14 LUFS (streaming platforms), use loudnorm, which implements ITU-R BS.1770 — see Loudness normalisation.
Common checks
Is the recording too quiet?
A mean_volume below about −30 dB usually means a low recording level. Extract just the two lines you need:
ffmpeg -i input.mp3 -af volumedetect -f null /dev/null 2>&1 | grep -E "mean_volume|max_volume"
2>&1 sends stderr to the pipe so grep can filter it.
Is it clipping?
A max_volume of 0.0 dB means at least one sample hit full scale. Whether that’s a problem depends on histogram_0db: a dozen samples is inaudible, thousands is audible distortion. For a sense of scale, when we deliberately summed two identical channels with pan=mono|c0=c0+c1 (a +6 dB mistake) on a file peaking at −0.1 dBFS, histogram_0db came back at 310,400 of 441,000 samples — about 70% — and the result was badly distorted. The measurement and the safe alternative are in Stereo to mono and channel mapping.
How much did a filter change the level?
Run volumedetect before and after. It’s the quickest way to confirm that a pan, amix or -ac 1 step preserved the level, or to see exactly how much amix’s default normalisation reduced it (about 6 dB for two inputs).
FAQ
mean_volume and loudnorm’s LUFS don’t agree
They measure different things. mean_volume is plain RMS over all samples; LUFS applies frequency weighting (K-weighting) and gating that ignores quiet passages. Two files with the same mean_volume can differ by several LU. Use volumedetect for headroom and clipping, loudnorm (or ebur128) for perceived loudness.
Can I get the values per channel?
No — volumedetect reports across all channels. Split first with channelsplit in -filter_complex and run volumedetect on each branch, or use astats, which prints per-channel peak and RMS.
Is there a faster way for very long files?
volumedetect has to decode everything, so speed is bounded by the decoder. Adding -vn for video files is the main win; on a modern CPU an hour of audio takes a few seconds.
Related articles
- Loudness normalisation —
loudnormtwo-pass procedure - Stereo to mono and channel mapping — measured levels for
-ac 1vspan - Remove silence automatically — pick a threshold from the measured level
- Extract audio — pull the audio track out of a video first