What does "-vol" parameter mean in ffmpeg?
Hi, I can't understand how to use "-vol" parameter to increase volume in ffmpeg. I know "-vol 256" mean keep volume unchanged. But I don't know how to choose a proper number for a video file to increase volume. For example, does "-vol 512" mean volume intensity is twice as original file? ( volume intensity: http://en.wikipedia.org/wiki/Decibel#Power_quantities ) thanks. littlebat
L'octidi 28 floréal, an CCXIX, littlebat a écrit :
I can't understand how to use "-vol" parameter to increase volume in ffmpeg. I know "-vol 256" mean keep volume unchanged. But I don't know how to choose a proper number for a video file to increase volume. For example, does "-vol 512" mean volume intensity is twice as original file?
Just try it for yourself: perl -e 'print pack("s*", 3000, 2000, 1000, 0, -1000, -2000)' | ffmpeg -f s16le -i - -vol 512 -f s16le - 2> /dev/null | perl -e '$/=\2; while(<>) { print unpack("s", $_), "\n" }' Of course, you can do exactly the same with any GUI PCM editor. By looking at the result, you can see that obviously each sample is multiplied by vol/256. Regards, -- Nicolas George
On Wed, 18 May 2011 15:11:03 +0200 Nicolas George <nicolas.george@normalesup.org> wrote:
L'octidi 28 floréal, an CCXIX, littlebat a écrit :
I can't understand how to use "-vol" parameter to increase volume in ffmpeg. I know "-vol 256" mean keep volume unchanged. But I don't know how to choose a proper number for a video file to increase volume. For example, does "-vol 512" mean volume intensity is twice as original file?
Just try it for yourself:
perl -e 'print pack("s*", 3000, 2000, 1000, 0, -1000, -2000)' | ffmpeg -f s16le -i - -vol 512 -f s16le - 2> /dev/null | perl -e '$/=\2; while(<>) { print unpack("s", $_), "\n" }'
Of course, you can do exactly the same with any GUI PCM editor.
By looking at the result, you can see that obviously each sample is multiplied by vol/256.
Maybe I have understood the "-vol volnumber" parameter in old version ffmpeg and "volume=volumenumber" audio filter in new version ffmpeg. According to the page: http://en.wikipedia.org/wiki/Decibel "volnumber/256" in old ffmpeg and "volumenumber"(not dB number) in new ffmpeg audio filter, is the "amplitude ratio" or "sound pressure level" ratio. So, "-vol 2560" in old ffmpeg or "volume=10" in new ffmpeg equal to "volume=20dB" in new ffmpeg. The formula is dBnumber=20*lg(amplitude ratio).
participants (2)
-
littlebat -
Nicolas George