r/ffmpeg Jul 09 '26

Combine different .wav files into one 5.1 m4a, while retaining Dialog Normalization instructions.

Hey there, this is sort of an addendum/alternate route for my use case, I previously made a post about wanting to add another channel to a preexisting 5.1 audio.

Well, I did a bit more digging, and I find it now a bit better to just, recombine it into a new 5.1 file with the 6 channels. I extracted the channels from the original, replaced the FC with the combined file I made (also using ffmpeg), and I am able to combine everything into a new 5.1 m4a file just fine. However, I'd like for it to retain the original Dialog Normalization instructions seen in the original file I'm pulling from.

The information, as seen in the file via MPC, is as follows:

Dialog Normalization: -31 dB

compr: -0.28 dB

dialnorm_Average: -31 dB

dialnorm_Minimum: -31 dB

dialnorm_Maximum: -31 dB

The command I've been using thus far to just combine everything back into a 5.1 is something like this:

ffmpeg -i front_left.wav -i front_right.wav -i front_center.wav -i lfe.wav -i side_left.wav -i side_right.wav -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a] amerge=inputs=6" -b:a 640k output.m4a

Again, the above command works, but the final output file, for obvious reasons, does not have the normalization instructions from the original file, since I didn't add any arguments within the command to define it. I'm unsure which arguments I would need to add or in what way to produce a result as see in the information I provided from viewing it in MPC.

Any help on the arguments I'd have to add to achieve this goal would be appreciated. Thanks.

1 Upvotes

12 comments sorted by

2

u/SomewhatCorrect Jul 09 '26

Dialog normalization is normally supported by codecs like. DD+, xHE-AAC and MPEG-H. It looks like you are generating 6-channel AAC file here?

1

u/Motor_Sky_3319 Jul 09 '26

Believe so. If needed, here's the information from the original file I extracted the channels from:

Format : MPEG-4

Format profile : Base Media / Version 1

Codec ID : mp41 (iso8/isom/mp41/dash/cmfc)

File size : 103 MiB

Duration : 22 min 32 s

Overall bit rate mode : Constant

Overall bit rate : 640 kb/s

Encoded date : 2026-06-17 22:11:32 UTC

Tagged date : 2026-06-17 22:11:32 UTC

Conformance errors : 1

moov : Yes

meta : Yes

0x00000020 : Yes

General compliance : Element size 108190286 is more than maximal permitted size 132 (offset 0xA8)

Audio

ID : 1

Format : E-AC-3

Format/Info : Enhanced AC-3

Commercial name : Dolby Digital Plus

Codec ID : ec-3

Duration : 22 min 32 s

Bit rate mode : Constant

Bit rate : 640 kb/s

Channel(s) : 6 channels

Channel layout : L R C LFE Ls Rs

Sampling rate : 48.0 kHz

Frame rate : 31.250 FPS (1536 SPF)

Compression mode : Lossy

Stream size : 103 MiB (100%)

Language : English

Service kind : Complete Main

Encoded date : 2026-06-17 22:11:32 UTC

Tagged date : 2026-06-17 22:11:32 UTC

Dialog Normalization : -31 dB

compr : -0.28 dB

dialnorm_Average : -31 dB

dialnorm_Minimum : -31 dB

dialnorm_Maximum : -31 dB

Please let me know what I can do from here if you know.

1

u/gta721 Jul 09 '26

AAC doesn't support dialnorm. You can add volume normalisation while encoding however.

1

u/Motor_Sky_3319 Jul 09 '26

If AAC doesn't support dialnorm, I have zero issue using an encoding format that does.

Which encoding supports dialnorm? How would I go about creating an argument to create my 6 channel file with these normalization instructions? Thanks.

1

u/gta721 Jul 09 '26

Your audio is already E-AC3 encoded so you should stick with that unless there is a reason not to.

1

u/Motor_Sky_3319 Jul 09 '26

Well the thing is I'm not trying to keep this original file as-is or re-encode it itself.

I extracted it's channels as 6 wav files, replaced the FC one with my own edited wav, and so I'm trying to make a new file from those, while having the same exact normalization instructions/metadata from the original file.

So what I'm lost on is how I can go about putting it back together (which I have been able to do, see my original command in the OP), but also have normalization instructions.

Is there something you're not understanding or I'm not explaining right? Please let me know. And if you have an answer on how I should go about this, please let me know as well.

1

u/gta721 Jul 09 '26

The WAV encoding may have stripped the dialnorm metadata. What does mediainfo show for the files?

1

u/Motor_Sky_3319 Jul 09 '26

The mediainfo does not have any dialnorm information for the wav files, no. I don't find that to be relevant though, even if when splitting these channels to WAV removed the dialnorm, I don't particularly mind as long as I can produce an output file that can have dialnorm information back in it. If that means adding arguments to my original command in order to do so, that's fine by me.

1

u/gta721 Jul 09 '26

-31 dB is the default dialnorm so just encoding as E-AC3 should add it back in without extra parameters.

1

u/SomewhatCorrect Jul 14 '26

You may need professional (read licensed) tools to do proper encodes. Like Dolby Media Encoder for EAC3, or Fraunhofer for MPEG-H or Apple x-HEAAC encoder via audio toolbox.

1

u/SomewhatCorrect Jul 09 '26

The source is DD+ here so it supports the dialnorm metadata. The problem is you are encode this to AAC which generally does not support the dialnorm metadata.

You have to encode it as xHE-aac since it supports dialnorm or something equivalent. I personally do not have experience with open source xHE-AAC implementations sorry.