FFMPEG amix filter volume issue with inputs of different duration

I noticed that ffmpeg amix filter doesn't output good result in specific situation. It works fine if input files have equal duration. In that case volume is dropped in constant value and could be fixed with ",volume=2".

In my case I'm using files with different duration. Resulted volume is not good. First mixed stream resulted in lowest volume, and last one is highest. You can see on image that volume is increased linearly withing a time.

enter image description here

My command:

ffmpeg -i temp_0.mp4 -i user_2123_10.mp4  -i user_2123_3.mp4  -i user_2123_4.mp4  
-i user_2123_7.mp4  -i user_2123_5.mp4  -i user_2123_1.mp4  -i user_2123_8.mp4  
-i user_2123_0.mp4  -i user_2123_6.mp4  -i user_2123_9.mp4  -i user_2123_2.mp4  
-i user_2123_11.mp4 -filter_complex "[1:a]adelay=34741.0[aud1];
-vcodec copy -y temp_1.mp4

That could be fixed by applying silence at the beginning and end of each clip, then they will have same duration and volume will be at the same level.

Please suggest how I can use amix to mix many inputs and ensure constant volume level.


  • amix scales each input's volume by 1/n where n = no. of active inputs. This is evaluated for each audio frame. So when an input drops out, the volume of the remaining inputs is scaled by a smaller amount, hence their volumes increase.

    Changing the dropout_transition for all earlier inputs, as suggested in other answers, is one approach, but I think it will result in coarse volume modulations. Better method is to normalize the audio after the amix.

    At present, you have two options, the loudnorm or the dynaudnorm filter. The latter is much faster

    Syntax is to add it after the amix, so


    Read the documentation, if you wish to tweak parameters for maximum volume or RMS mode normalization..etc