Closed thennicke closed 1 year ago
Thanks for providing the logs. As far as I can see the target loudness range is set correctly. The ffmpeg docs however say:
the change in integrated loudness shouldn’t result in a true peak which exceeds the target TP
You set tp=0
, but measured_tp=0.05
, meaning that the target is exceeded. Maybe this is the case here? (Interesting that the input file has a positive measured true peak…)
I am actually not sure if I have a good set of test clips and settings here with which I can check the linear/dynamic behavior.
I'm happy to upload the raw audio from this video file (just me practising a piano + vocals cover) if it can help you diagnose the bug. It's not possible for me to set tp=0.05
in ffmpeg-normalize, so at the moment this program cannot do a linear normalisation on this file.
Edit: Here's the raw file. It's pcm so I had to keep it in the MOV container. 50MB in size roughly.
You can't set a TP larger than 0 for the filter, that's why that won't work. I will be actually am on vacation right now, so I won't get to this before September.
Realistically I would propose you run the raw commands through ffmpeg itself (using the debug-logged commands), and attempt to get it to normalize linearly. The ffmpeg-normalize
wrapper just tries to help set the right values, and somehow I'm afraid it can't be done for that particular file.
(Maybe if you first lower the overall volume with an RMS normalization?)
So I tried reducing the overall volume with an RMS normalisation, as you suggested, and that worked to get input_tp<=0
. And yet output_lra
is still not working properly: if I use --keep-loudness-range-target
then it goes to 16.8
rather than the measured input of 22.60
(this must be a bug) and if I try to manually set it with -lrt 25
then it goes to 10
(another bug). So still unable to do a linear normalization using this program. Very strange behaviour. I might try using ffmpeg directly later on.
I'll leave the audio in my google drive for you to download and play with when you get back, it's no rush.
I get linear processing, once you set high enough target LRA and enough low target Integrated:
ffmpeg -i ~/Downloads/testaudio.MOV -af loudnorm=measured_tp=0.0:measured_lra=22.8:lra=22.8:measured_i=-15.2:measured_thresh=-37.4:print_format=summary:tp=0.0 -f null -
Not a bug, it happens because target integrated loudness is set to too high value (toward zero). You can not have linear processing in that case.
There is nothing interesting in True Peak being positive (> 0), that is normal when resampling to higher rate and with audio that clipped already.
Formula is quite simple: If Target True Peak is lower than (Measured True Peak + Target Integrated - Measured Integrated) filter will use dynamic processing.
I get linear processing, once you set high enough target LRA and enough low target Integrated:
ffmpeg -i ~/Downloads/testaudio.MOV -af loudnorm=measured_tp=0.0:measured_lra=22.8:lra=22.8:measured_i=-15.2:measured_thresh=-37.4:print_format=summary:tp=0.0 -f null -
Not a bug, it happens because target integrated loudness is set to too high value (toward zero). You can not have linear processing in that case.
There is nothing interesting in True Peak being positive (> 0), that is normal when resampling to higher rate and with audio that clipped already.
Formula is quite simple: If Target True Peak is lower than (Measured True Peak + Target Integrated - Measured Integrated) filter will use dynamic processing.
You're quite right. I completely misunderstood what the algorithm was doing and thought I had a lot more headroom than I did. Closing this because it's not actually a bug.
Checklist
ffmpeg-normalize
ffmpeg
or a recent build from Git masterExpected behavior Linear normalization selected (this is for an acoustic track and the compressor used in dynamic normalization sounds like trash in the loud sections)
Actual behavior Dynamic normalization selected, irrespective of whether I run the command with
--keep-lra-above-loudness-range-target
or with--keep-loudness-range-target
, or if I manually select an outputlra
that is larger than the reportedlra
Command The exact command you were trying to run:
Any output you get when running the command with the
--debug
flag:operating system: Fedora 38 Workstation Python version: 3.11.4 ffmpeg version: 6.0