Is it possible to change volume with no reencode with ffmpeg?

I just had this question because I used the following command with ffmpeg:

ffmpeg -i input.wav -filter:a "volume=0.2" output.wav

Following the documentation here:

However, when I created the new file, the output was half the size of the input and the bitrate of the audio track was reduced as well.

So my questions are:

  1. Is the bitrate supposed to decrease with decreasing and increasing volume like so?
  2. Is it possible to change volume without reencoding with ffmpeg?

1 answer

  • answered 2020-02-17 12:28 John Smith

    Okay as someone from Reddit kindly explained to me, I should be able to change the volume without reencoding, however, my input codec was pcm_f321e and the default setting for the output codec for ffmpeg without any specifiers is pcm_f161e.

    The first one pcm_f321e is 32 bits, so it stores more information than the second which is 16 bits.

    So the answer is: 1. Yes it is because in this case I was reencoding unknowingly to a codec with less information.

    1. Yes it is with the same code I used above with an extra specifier:
    ffmpeg -i input.wav -filter:a "volume=0.2" -c:a pcm_f32le output.wav

    However, the codec for input and output must be the same as in both 32 bit or 16 bit or else I have to add a specifier which I was shown how to do by the same person on Reddit.