R.L. Dane :Debian: :OpenBSD: 🍵<p>Update: Thanks to <span class="h-card"><a href="https://mastodon.social/@furicle" class="u-url mention" rel="nofollow noopener noreferrer" target="_blank">@<span>furicle</span></a></span> for this suggestion. I think it's about perfect:</p><pre><code>tmp $ AV_LOG_FORCE_NOCOLOR=true ffmpeg -hide_banner -i example.opus -filter:a volumedetect -f null /dev/null
Input #0, ogg, from 'example.opus':
Duration: 02:13:19.89, start: 0.007500, bitrate: 118 kb/s
Stream #0:0(eng): Audio: opus, 48000 Hz, stereo, fltp
Metadata:
encoder : Lavf58.45.100
[Parsed_volumedetect_0 @ 0x563ea07eeb00] n_samples: 0
Stream mapping:
Stream #0:0 -> #0:0 (opus (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
Metadata:
encoder : Lavf61.7.100
Stream #0:0(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
encoder : Lavc61.19.101 pcm_s16le
[Parsed_volumedetect_0 @ 0x7f9920003c00] n_samples: 767987856
[Parsed_volumedetect_0 @ 0x7f9920003c00] mean_volume: -21.0 dB
[Parsed_volumedetect_0 @ 0x7f9920003c00] max_volume: -2.8 dB
[Parsed_volumedetect_0 @ 0x7f9920003c00] histogram_2db: 1
[Parsed_volumedetect_0 @ 0x7f9920003c00] histogram_3db: 70
[Parsed_volumedetect_0 @ 0x7f9920003c00] histogram_4db: 3872
[Parsed_volumedetect_0 @ 0x7f9920003c00] histogram_5db: 98331
[Parsed_volumedetect_0 @ 0x7f9920003c00] histogram_6db: 750534
[out#0/null @ 0x563ea084bf80] video:0KiB audio:1499976KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
size=N/A time=02:13:19.87 bitrate=N/A speed= 573x
</code></pre><p>Dear sound/audio folks and engineers,</p><p>[Update: just for clarity: I'm looking for a command line utility that will help me decide which of 70 audio recordings need amplification/compression/normalization. Something that can print out media stats like average loudness, or something like that]</p><p>I have a directory with 3.5GiB of audio files (chiefly opus & m4a) which are spoken word recordings.</p><p>Some of them are quite low, and some of them are quite dynamic such that it's a whisper at times and nearly a shout at other times.</p><p>I've processed a lot of them with <a href="https://polymaths.social/tags/audacity" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>audacity</span></a>'s compressor filter or <a href="https://polymaths.social/tags/ffmpeg" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ffmpeg</span></a> (<code>ffmpeg -i audio.m4a -filter:a "speechnorm=e=50:r=0.0001:l=1" audio-normalized.m4a</code>), but there are some unprocessed files in the collection, which are a pain to individually find and fix.</p><p>Is there a way from the <a href="https://polymaths.social/tags/commandline" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>CommandLine</span></a> to detect the loudness and/or dynamic range of audio files so that I can automatically flag them for processing with ffmpeg?</p><p>Thanks!!</p><p><a href="https://polymaths.social/tags/audio" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>audio</span></a> <a href="https://polymaths.social/tags/sound" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sound</span></a> <a href="https://polymaths.social/tags/soundengineering" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SoundEngineering</span></a> <a href="https://polymaths.social/tags/askfedi" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AskFedi</span></a> <a href="https://polymaths.social/tags/hivemind" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>HiveMind</span></a></p>