Draws how often each loudness level occurs, updated over time, with a scrolling history below. Quiet, dynamic music spreads wide, and heavily compressed masters pile up near the top. A simple way to see dynamic range.
The command
ffmpeg -i input.aiff \
-filter_complex "[0:a]ahistogram,format=yuv420p[v]" \
-map "[v]" -map 0:a \
output.mp4 What each part does
ahistogram defaults: 1280×720, 25 fps
format=yuv420p 4:2:0 for H.264
-map "[v]" -map 0:a the histogram plus the original audio When to use it
Use this when you want to see a track's dynamic range rather than its shape or pitch. It works well for comparing two masters of the same song, or for checking whether a mix has been squashed. Quiet, dynamic material spreads wide. Heavily compressed audio piles up near the top. The header explains each flag.
For other views, use a different script:
- showwaves.sh for the waveform over time.
- showcqt.sh for pitch and frequency content.
- avectorscope.sh or aphasemeter.sh for stereo image and phase.
To adapt it, change input.aiff and output.mp4 to your own file names. The output uses the filter's defaults of 1280×720 at 25 fps.
If the output looks wrong:
- Histogram bunched at the top: this is usually the master being loud and compressed, not a bug.
- No sound: confirm
-map 0:ais still present. - File won't play in some players: check that
format=yuv420pwasn't removed. - Command fails immediately: make sure the input actually contains an audio stream.
Notes
- Source
- ffmpeg-utilities/notes/ffmpeg-filters.txt