-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
linear normalization with same configuration for input_LRA <1 and >7 #227
Comments
Thanks for this detailed description. I have to give it some thought … but wouldn't automatically setting |
Then again I do see your point. Would you like to file a PR for your new flag? I think if it's backwards compatible it's a good solution. |
I can give it a try - probably additional rounding up to 1 is a good solution to allow both flags to work for a broad range of Just one question: I am wondering if there is a reason for ffmpeg_normalize currently only supporting linear normalization with unchanged LRA in the second run? I mean, is it sufficient to set |
I would probably just add a check before setting the ffmpeg-normalize/ffmpeg_normalize/_streams.py Line 435 in 7cd65d5
loudness_range_target is below 1 (or above 50), saying that it was increased to 1 (or decreased to 50). That ensures we always produce a working command line. But I welcome a PR, since you also have the files to test with!
I believe that if you set LRA, you need to set it for the second run, since that will actually do the processing. The first run is only there to identify the properties of the file. |
I forked your project's master branch at 7cd65d5 and tried and setup (for me I use a virtual environment with pipenv install
pipenv install --dev -r .\requirements.dev.txt I just wanted to make sure, I am able to run everything and don't miss anything. So I tried to execute help with with
seems to fail in 5 out of 25 tests.
Do I miss something or is this currently fine? |
Could you please try to create a PR against this repository? I have automated tests that should ensure everything is fine. |
If you like, I could also create a PR to silently set |
Fixed by c49480c. |
I added a constraint for the input LRA between 1 and 7 in 3187a02 |
Is your feature request related to a problem? Please describe.
Yes, I am currently using
ffmpeg-normalize 1.26.4
inPython 3.10.9
withwhere 2nd runs with
ffmpeg
execute withlra={input_lra}
which produces alinear
normalized audio for anyinput_lra >= 1
. If I try to convert a song withinput_lra < 1
(e.g.0.7
in audio from https://www.youtube.com/watch?v=HTYOa2_1aH4) I get the following error:I am able to resolve this issue by using
loudness_range_target=7.0,
instead ofkeep_loudness_range_target=True
for anyinput_lra <= 7.0
, but then get the following warning forinput_lra > 7
(e.g.16.10
in audio from https://www.youtube.com/watch?v=GibiNy4d4gc):which does perform
dynamic
normalization instead oflinear
normalization.Describe the solution you'd like
In order to solve this and ensure backwards compatibility I'd suggest to a add a flag
--keep-lra-above-loudness-range-target
(constructor parameter:keep_lra_above_loudness_range_target=True
). In combination withloudness_range_target=7.0
. This should ensureLRA=7
forinput_lra <= 7
andLRA=input_lra
forinput_lra > 7
and allows to convert any song with the same parameter-set independent ofinput_lra
Describe alternatives you've considered
An alternative solution would be to set
input_lra < 1
toLRA=1
in order to fit into the range of[1 - 50]
with something like--force-linear-normalization
Without any change in
ffmpeg_normalize
I would need to measureinput_lra
in order to know what parameters to set, but then I can basically useffmpeg
directly without usingffmpeg_normalize
at all.Additional context
I am new to the topic of audio normalization, followed some tutorials and weblinks, played around with ffmpeg in order to achieve
linear
normalization, as I did not like howdynamic
normalization changed the audio. I read thattarget_LRA
should be7.0
(EBU R128) and therefore used7.0
when possible (so ifinput_lra < 7
) and usedLRA=input_lra
forLRA > 7
. Using--keep-loudness-range-target
inffmpeg_normalize
seems to override--loudness-range-target = 7.0
and therefore only useLRA=7.0
, if theinput_lra
is already7.0
. So I hope--keep-lra-above-loudness-range-target
might be an improvement by respecting--loudness-range-target = 7.0
as long as possible.The text was updated successfully, but these errors were encountered: