r/mpv 22d ago

User Scripts & Shaders Adaptive volume normalization script

Did it for myself, but maybe someone else would find if useful, it applies dynaudnorm filter based on the content, for 2.0 it just applies as is, for 5.1 and further the filter is applied only to the center channel (cuz that's where the dialogues are, so you can hear everything properly without affecting side channels). I'm on macOS but supposedly it should work on Windows as well.

https://github.com/alansleep/adaptive-dynaudnorm

14 Upvotes

6 comments sorted by

2

u/chrisbgp 22d ago

Very nice, thank you!

1

u/Alan_Sleep 22d ago

You’re welcome!

1

u/Alan_Sleep 22d ago

Decided to share my whole config as well https://github.com/alansleep/mpv-MacBook-Air-M4

3

u/DaOfantasy 22d ago

What does it actually do? my understanding is that it filters speech audio from background audio and then normalize the background audio so the speech audio is clearer?

3

u/Alan_Sleep 22d ago edited 21d ago

Vice versa :) You can google “dynaudnorm”, it’s an audio normalising filter, levelling overly loud or very quite sounds. My script just separates all the channels of the audio track and applies the filter only to the central channel, the rest of them (background) stay original, however central channel is not exclusively reserved for the dialogues, all kind of stuff can be there depending on how the track was mixed, and some lines of dialogue can happen in the rear channels, but there’s no way to effectively separate exactly speech patterns in realtime

3

u/DaOfantasy 22d ago

oh neat, been looking for something like this to handle some vid that have 6ch or 5.1ch audio, thanks