Closed milahu closed 6 months ago
I think there are two issues at play here:
An apparently broken algorithm that is not fixed upstream (which seems to be worked on in some fork of FFmpeg, so it seems like that should be merged back into FFmpeg itself).
Usage notes that would help prevent issues from an end-user perspective.
What are you suggesting specifically? If "Going higher (> -14 LUFS) than source LUFS is forcing dynamic processing" (per the comment thread) then there could be a warning that dynamic mode is being used.
There is a warning already affecting the loudness range: https://github.com/slhck/ffmpeg-normalize/blob/94c2c6a6e05cbf6bc29aa5f052d7c5fdb111b8a9/ffmpeg_normalize/_streams.py#L426-L438
Are you suggesting something akin to this?
What are you suggesting specifically?
"show warning when using non-default target level"
if cli_args.target_level < -23:
print(f"warning: using non-default target level {cli_args.target_level}. this can produce volume glitches. please verify the result.")
I find this a bit too drastical. In your original issue you talked about increasing the target beyond the input loudness. I can imagine adding a warning for that.
I did some checks on some files and it seems like the filter does not always revert to dynamic mode when the target is higher than the existing target. Instead, I'll parse the second pass loudnorm output and check if it shows that dynamic mode was used, compare that with the user's intent (i.e., if they wanted linear mode), and if there's a mismatch, print a warning.
Fixed in v1.28.0, see #256
setting the target level too high can produce broken output
for example, increasing the target level from -23 to -14 can create ugly volume glitches see also https://github.com/milahu/ffmpeg-loudnorm-volume-glitches-bug/issues/1
in my case, the volume glitches were hidden in the middle of the album so the defect is not obvious, and requires manual inspection of the result
https://github.com/slhck/ffmpeg-normalize/blob/94c2c6a6e05cbf6bc29aa5f052d7c5fdb111b8a9/ffmpeg_normalize/__main__.py#L140-L155