Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume Normalization and Key Binding? #3979

Closed
coolmagnet opened this issue Jan 2, 2017 · 5 comments
Closed

Volume Normalization and Key Binding? #3979

coolmagnet opened this issue Jan 2, 2017 · 5 comments

Comments

@coolmagnet
Copy link

mpv version and platform

mpv-x86_64-20161120 (windows)

The great thing about the VLC player is its adjustable volume normalization feature. VLC appears to be able to even out loud noise, musical score, and spoken dialogue. I've tried the SMPLAYER (with MPV) volume normalization and it does not appear to even out the sound. Sometimes the musical score is louder than the spoken dialogue. So now I'm using MPV without SMPLAYER and everything is working great except I don't know how to turn ON volume normalization and how to key bind it (input.conf)? I'm hoping that MPV would be somewhat equivalent to VLC volume normalization.

Thanks

@garoto
Copy link
Contributor

garoto commented Jan 2, 2017

mpv uses standard ffmpeg audio/video filters and their corresponding syntax detailed here:

https://ffmpeg.org/ffmpeg-filters.html

For audio normalization, I guess the consesus while reading this issue tracker and elsewhere, is that dynaudnorm was the one to use. There's also loudnorm, but I'm not sure if it's even the same thing (don't know much about audio shenanigans).

for keybinding, I have F1 af toggle "lavfi=[dynaudnorm=f=75:g=25:n=0:p=0.58],volume=softclip=yes" in my input.conf that I use for 5.1 content mostly (films) with my headphones and onboard audio.

@coolmagnet
Copy link
Author

Thanks garoto.

I also found the following to work:

--af=drc=1:0.25

So I now have keybinding as follows:

F1 af toggle "drc=1:0.25"
F2 af toggle "lavfi=[dynaudnorm=f=75:g=25:n=0:p=0.58],volume=softclip=yes"

They both sound similar but the keybinding allows me to change when needed.

@kevmitch
Copy link
Member

kevmitch commented Jan 7, 2017

Note that last I checked, dynaudionorm didn't play well with video-sync=display-resample due to the large lookahead audio buffer involved. drc, on the other hand is extremely primitive and is almost guaranteed to clip the audio signal. Haven't looked too closely at loudnorm.

@ghost
Copy link

ghost commented Jan 7, 2017

That's because speed changes aren't tracked well with the large buffer.

In theory you could add dynaudionorm to --lavfi-complex, but this would "break" track selection currently. It should work with DS, because the "normal" filter chain, which also resamples the audio according to playback speed, won't have the large buffer.

@NightMachinery
Copy link

NightMachinery commented Jul 29, 2020

@coolmagnet commented on Jan 6, 2017, 1:48 PM GMT+3:30:

Thanks garoto.

I also found the following to work:

--af=drc=1:0.25

So I now have keybinding as follows:

F1 af toggle "drc=1:0.25"
F2 af toggle "lavfi=[dynaudnorm=f=75:g=25:n=0:p=0.58],volume=softclip=yes"

They both sound similar but the keybinding allows me to change when needed.

What's the CLI option for the second one? I tried --af-add='[dynaudnorm=f=75:g=25:n=0:p=0.58],volume=softclip=yes', but it gives a parsing error.

Update: --af-add='dynaudnorm=g=5:f=250:r=0.9:p=0.5' works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants