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

Keep original loudness range unchanged, EBU R 128 does not specify a default 7 #269

Open
wyup opened this issue Oct 14, 2024 · 3 comments
Open

Comments

@wyup
Copy link

wyup commented Oct 14, 2024

According to command help and wiki examples, default loudness range for ffmpeg-normalize for EBU R 128 normalization is 7.
However, a default LRA is not specified by EBU R128, only that Program Loudness Level target is −23.0 LUFS, and -1 db True Peak, as specified:
https://tech.ebu.ch/files/live/sites/tech/files/shared/r/r128.pdf
Minimum requirements for authentic programmes range from values 5 for a narrow loudness range (commercial/promo) to wide loudness range of 15 (movie/drama), as specified here:
https://tech.ebu.ch/files/live/sites/tech/files/shared/tech/tech3342.pdf

A default LRA of 7 is arguably a compressed loudness range.
Given that ffmpeg-normalized is used for a unspecified content that can be movies which need a high dynamic range, in order to get a target EBU R 128 normalized volume, IMHO LRA should be left untouched by default.

@slhck
Copy link
Owner

slhck commented Oct 14, 2024

While I understand your argumentation, ffmpeg itself uses a default of 7, and this is why the same default is set here.

Asking the user to specify a range explicitly for every command would also be very confusing.

If there were a set of recommended parameters, I could imagine adding certain presets (e.g. music, dialog, movie,...) that set these values automatically.

@wyup
Copy link
Author

wyup commented Oct 14, 2024

I see. And an option to keep the source range? After all, EBU R 128 is mainly volume normalization, not so much compression. The user should provide a custom range, if needed.
Otherwise, the user would find compression not wished for.

@slhck
Copy link
Owner

slhck commented Oct 14, 2024

The issue is that ffmpeg's loudnorm filter should also work in a single pass, for which you won't have an input loudness range calculated. Perhaps it would have been a better choice to make the loudness range target a mandatory setting, but this would have kind of forced a two-pass approach onto users. I guess the original author just picked something that was meaningful for them.

An option to keep the loudness range target is already implemented in ffmpeg-normalize! It's --keep-loudness-range-target. This will set the LRA to the input's LRA and override the default of 7 LUFS:

if self.media_file.ffmpeg_normalize.keep_loudness_range_target:
_logger.debug(
"Keeping target loudness range in second pass loudnorm filter"
)
input_lra = self.loudness_statistics["ebu_pass1"]["input_lra"]
if input_lra < 1 or input_lra > 50:
_logger.warning(
"Input file had measured loudness range outside of [1,50] "
f"({input_lra}), capping to allowed range"
)
self.media_file.ffmpeg_normalize.loudness_range_target = self._constrain(
self.loudness_statistics["ebu_pass1"]["input_lra"], 1, 50
)

PS: So far, I have not received feedback about the loudnorm filter being too aggressive by default. There is no ticket in FFmpeg about it either. I assume that most users don't care, and those who do will already set their target value per their needs.

That being said, I am still thinking about whether presets would make sense as a more user-friendly set of options. But I have limited experience with what works and what is recommended in various industries.

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

No branches or pull requests

2 participants