slhck / ffmpeg-normalize

Audio Normalization for Python/ffmpeg
MIT License
1.28k stars 118 forks source link

Why does EBU normalized output default to 192khz? #177

Closed joshjudgex closed 2 years ago

joshjudgex commented 2 years ago

I read that input should be upsampled to 4x the input sample rate for EBU normalization but afterwards, is there a loss of quality to downsample back to the original sample rate e.g. 44.1khz or 48khz?

joshjudgex commented 2 years ago

Wait a second, just checked the output files and the output sample rate is the same as the input sample rate - 48khz in this case.

Does this mean the default output sample rate for EBU normalization is the same as the other normalization styles?

slhck commented 2 years ago

The output sample rate is changed to 192 kHz for accurate peak detection. Detecting accurate peaks is not possible at the original sample rate due to the Nyquist theorem, more info here: https://techblog.izotope.com/2015/08/24/true-peak-detection/.

I am not sure why your output is at the original input sample rate. That should not be the case when using the loudnorm filter without any additional options. Can you please show a reproducible example?

slhck commented 2 years ago

Actually, you're right, this behavior seems to have changed. I will update the code and docs respectively.

slhck commented 2 years ago

Done in 636b2bedbbab03a0628fe483381e707cd9bafae9. Now the warning will only be printed in the specific case that dynamic mode is forced by ffmpeg or the user.