MrNeedHelpPlease
MrNeedHelpPlease

Reputation: 11

Using FFmpeg or Similar to Normalize audio in a video to EBU R128 standard

This is my first time here on stack overflow asking question.

I am stuck and really struggling with this. I am trying to make some of my MXF video files to be EBU r128 standard for its audio.

This means that it has to be -23 and not higher than 0.5.

My current process

Watch_folder > Encoding to MXF > Output_folder

I need to makesure when its comes to output folder, those MXF files are EBU R128 Loudness compliant.

What I have done so Far:

FFMPEG:

ffmpeg -i input.mxf -af loudnorm=I=-23:LRA=7:tp=-2:print_format=json -f null -

got the result:

Input Integrated: -15.1 LUFS Input True Peak: +0.0 dBTP Input LRA: 17.1 LU Input Threshold: -26.2 LUFS

Output Integrated: -17.1 LUFS Output True Peak: -1.5 dBTP Output LRA: 5.3 LU Output Threshold: -27.6 LUFS

Normalization Type: Dynamic Target Offset: +1.1 LU

then i did

ffmpeg -i input.mxf -af loudnorm=I=-23:LRA=7:tp=-2:measured_I=-15.1:measured_LRA=17.1:measured_tp=0:measured_thresh=-27.6:offset=1.1 -ar 48k -y output.mxf

However, when i put it through the software Eff, it says that its not EBU compliant.

*EDIT: This also reduces the quality. for example; my 6 Gb becomes 250 MB and you can tell the quality downgraded

ffmpeg-normalize

I did the following

ffmpeg-normalize input.mxf -c:a pcm_s32le -ar 48000 -o output.mxf but this gives me errors.

if i do it without the output file type, i get a mkv which will not work for me. i need it to be mxf.

Upvotes: 1

Views: 3805

Answers (1)

kitchensinkodysseus
kitchensinkodysseus

Reputation: 21

OK, a few issues here.

Firstly, if your file is measured at -26.2 LUFS, you'd need to add 3.2 dB to get it to -23. But you can't do that, because your true peak is too high (you'd be over full scale). You'll need to compress (dynamic audio compression, not file/rate compression) the audio or use at least a limiter to achieve this. A good R128 audio track should be mixed properly rather than just run through a normaliser, otherwise you risk it either failing the standard or unwanted audio effects.

If you don't have access to audio editing software or someone who can do this for you, then FFMPEG does include an audio limiter, which will give you enough headroom to raise the level to -23 LUFS. You can do that with something like this:

-filter_complex alimiter=level_in=1:level_out=1:limit=1.5:attack=7:release=100:level=disabled

However, tuning a limiter well depends on what the video file is of (music, speech, etc) and it is something that's worth taking some time over. Alter the attack and release values until you get the result you want.

Secondly, the reason that FFMPEG has produced a smaller file of lower quality is because you didn't specify anything in the video section. FFMPEG's default action with video is (usually) to encode to h264, so whatever your codec here is (I am assuming DNxHD from the fact that you're using an MXF wrapper) needs to be specified. FFMPEG will copy the video stream though and leave it alone if you include the option -c:v copy (which means copy video codec, basically).

Post your results once you have tried these...!

Upvotes: 1

Related Questions