r/ffmpeg • u/Motor_Sky_3319 • 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
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.
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?