ffmpeg-normalize icon indicating copy to clipboard operation
ffmpeg-normalize copied to clipboard

normalize amplitude modulation

Open engartst opened this issue 5 years ago • 12 comments

I'm using ffmpeg-normalize on a .wav file to create a EBU Normalized .mp3.

Settings for ffmpeg-normalize: target level = -16 LUFS true peak = -0.1 audio codec = libmp3lame audio bitrate = 320 k

I am having some issues that I am not having when I reproduce the settings through Steinburg's Wavelab . The sound seems to come and go instead of staying at a constant level (amplitude modulation).

Do you know why this might be happening? Is there an issue with window size of analysis/is there a way to set that? or are these peculiarities the results in running the script on a mono file vs. dual-mono?

Cheers, Stewart

engartst avatar May 03 '19 22:05 engartst

As mentioned by the OP in an email, adding --dual-mono seems to fix it, since the input files are mono, but I'm not sure if that is a proper workaround or if something else is going on. Stewart, would you have an example WAV file available for testing?

slhck avatar May 06 '19 17:05 slhck

I have audio examples but cannot attach them here.

I could link to a GoogleDrive Folder but not sure if it is appropriate in the forum, let me know and I will.

Cheers, Stewart

engartst avatar May 15 '19 18:05 engartst

go for it Stewart. I think a link to Google drive location is appropriate.

ilessing avatar May 15 '19 18:05 ilessing

Hi all,

I have uploaded three mp3s here: https://drive.google.com/drive/folders/1DC9PY-3wJTSsQVPvf-ipGV35CCCY1vIN?usp=sharing

wavelabEBU.mp3 is the output with the above settings through WaveLab 8.5 ffmpegEBU.mp3 is the output with the above settings through ffmpeg-normalize without the --dual-mono tag ffmpegEBU_dualMono.mp3 is the output with the above settings through ffmpeg-normalize with the --dual-mono tag

The flag seemingly fixed the issue, let me know what you think

engartst avatar May 21 '19 22:05 engartst

Thanks for sending these files. Since the file is indeed mono and meant to be played back on a stereo system, using the -dual_mono flag seems to be correct usage. I don't know the underlying reason for that. I briefly looked into the relevant recommendations:

But I can't find a passage dealing with this topic in particular.

Note that it's actually an “issue” with the loudnorm filter in ffmpeg itself, but I'll leave this open for the time being.

slhck avatar May 22 '19 07:05 slhck

I notice modulation in ffmpegEBU_dualMono.mp3 also, right in the beginning between 0:02…0:06. It's less, but still quite annoying.

I have a difficult file too: https://vimeo.com/292682053

Adobe Media Encoder EBU-normalized it correctly, or at least without sudden volume drop during the loudest part at 0:41. Loudnorm refuses to to linear normalization:

ffmpeg -i U48_2018_Her_Fish.mp4 -af loudnorm=i=-23.0:lra=7.0:tp=0.0:offset=0.0:measured_i=-14.04:measured_lra=25.7:measured_tp=0.01:measured_thresh=-30.84:linear=true:print_format=summary -c:v copy Her_Fish_loudnorm2passHandBrew.mp4
[…]
[Parsed_loudnorm_0 @ 0x7fb5e580ba80] 
Input Integrated:    -14.0 LUFS
Input True Peak:      +0.0 dBTP
Input LRA:            25.7 LU
Input Threshold:     -30.8 LUFS

Output Integrated:   -18.0 LUFS
Output True Peak:     -2.1 dBTP
Output LRA:           25.7 LU
Output Threshold:    -34.8 LUFS

Normalization Type:   Dynamic
Target Offset:        -5.0 LU

My guess is @engartst your input file also has true peak 0 dB? Mine actually has "+0.01 dB" with json output. Changing that to 0.0 in the above ffmpeg command does not fix the issue.

Who dares report this upstream? 😅

sampumon avatar May 28 '19 11:05 sampumon

Hi,

@engartst can you please share your source file. I'll take a look and see what's happening. It's possible that there's a bug in the ffmpeg filter, but I'd need the source file to dig in.

Thanks, Kyle

kylophone avatar May 30 '19 17:05 kylophone

@ilessing can you share this?

thanks

engartst avatar May 30 '19 23:05 engartst

Closing for now. Please reopen if you have an original source file that you can share.

slhck avatar Jun 17 '19 18:06 slhck

Hey @ilessing , can you share the source file?

engartst avatar Jul 11 '19 16:07 engartst

@engartst, I think that Ian asked you for a source file since you were the one originally reporting the error? Ian never mentioned having issues.

slhck avatar Jul 11 '19 16:07 slhck

Sorry for the miscommunication on my part!

I have added the original .wav to the google drive folder here (original.wav): https://drive.google.com/drive/folders/1DC9PY-3wJTSsQVPvf-ipGV35CCCY1vIN

Thanks all

engartst avatar Jul 16 '19 16:07 engartst