Bug 471135

Summary: [Feature] Add dynamic range compressor audio filter
Product: [Applications] Haruna Reporter: Marcus Sundman <sundman>
Component: genericAssignee: george fb <georgefb899>
Status: REPORTED ---    
Severity: wishlist CC: beavailable, sundman
Priority: NOR    
Version First Reported In: 0.10.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Dedynamicizer-curve

Description Marcus Sundman 2023-06-16 23:13:59 UTC
Created attachment 159726 [details]
Dedynamicizer-curve

SUMMARY
In many environments (e.g. noisy) a video with wide dynamic range audio is impossible to listen to; either silent parts are too silent or loud parts get too loud. A dynamic range compressor (or a compressor/limiter) works by boosting low volume and/or lowering high volume. This way you can hear a whisper, and still not damage your hearing by a gunshot in the film. This is one of the most useful filters a movie player can have.

It would be nice if the "high volume lowering" would actually keep the peaks where they are, but instead boost everything else, except very low volume. Like in the attached picture of a top-biased S-curve.

The filter should have at least one setting: the amount of boosting to do. (Other minor things, like attack, release, and window size, could be hidden as long as they're at least somewhat sensible.)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 23.04
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Comment 1 Marcus Sundman 2025-08-13 22:00:41 UTC
There is plenty of existing code for doing this, since most players have it, so the code can probably be copied from some other project, such as vlc.
Comment 2 Marcus Sundman 2025-08-13 22:24:31 UTC
Since haruna already uses mpv, you can simply add the option to specify custom audio (and video) filters.
E.g., dynamic range compression can be performed with an mpv audio filter like:
lavfi=[loudnorm=I=-14.0:TP=-1.5:LRA=8.0]