Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#4376 closed defect (invalid)

FFmpeg amerge multi input create an output with a lower volume

Reported by: wouha Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: filter_complex amerge volume
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Hello,

When I use -filter_complex & amerge to merge multiple audio files into one audio file but the volume of output file is lower than what it should be! (something like 2 or 3 times lower)

My ffmpeg command:

ffmpeg -i INPUT_1 -i INPUT_2 -i INPUT_3 -i INPUT_4 i INPUT_5 -i INPUT_6 -filter_complex "
[0:a]volume=volume=1:precision=fixed:eval=frame[a0];
[1:a]volume=volume=1:precision=fixed:eval=frame[a1];
[2:a]volume=volume=1:precision=fixed:eval=frame[a2];
[3:a]volume=volume=1:precision=fixed:eval=frame[a3];
[4:a]volume=volume=1:precision=fixed:eval=frame[a4];
[5:a]volume=volume=1:precision=fixed:eval=frame[a5];
[a0][a1][a2][a3][a4][a5]amerge=inputs=6,
pan=stereo|FL<c0+c2+c4+c6+c8+c10|FR<c1+c3+c5+c7+c9+c11[aout]"
 -map "[aout]" -acodec libmp3lame -b:a 256k OUTPUT

I use FFmpeg 2.6.1 on Debian 3.2.63-2+deb7u1 x86_64

Can you help me about my problem?

Thank you a lot !

Best regards,
Max.

Change History (5)

comment:1 by Cigaes, 9 years ago

Component: ffmpegavfilter
Priority: importantnormal
Resolution: invalid
Status: newclosed
Version: 2.6git-master

More precisely, it is exactly six times lower in terms of linear intensity. This is the expected behaviour. A lot of PCM hardware and software code samples in a bounded interval, usually equivalent to the [-1,1] interval after normalization. The problem is that 0.9+0.9=1.8 does not fit to the interval; you have to do an average, not a sum: (0.9+0.9)/2.

That is exactly what "FL<..." does: it is equivalent to "FL=(...)/N", where N is the number of channels you added. You are perfectly free to write "FL=c0+c2+..." instead of "FL<...". You will get normal volume but possibly clipping.

I do not remember if FFmpeg has soft-clipping filters.

comment:2 by wouha, 9 years ago

Oh my god!
This is it!

Thank you A LOT!

comment:3 by wouha, 9 years ago

Now there is a saturation \o/

Maybe because the volume of the input file is too loud!

Do you think I can fix this with a function of ffmpeg?

Thank you :-)

comment:4 by wouha, 9 years ago

Problem solved by converting flac instead of mp3!

It's ok for me!

Thank you for your time! :)

Bye

Last edited 9 years ago by wouha (previous) (diff)

comment:5 by Michael Niedermayer, 8 years ago

Blocked By: low volume

remove invalid blocked by value

Note: See TracTickets for help on using tickets.