[FFmpeg-user] Set audio level in aevalsrc audio filter

Massimo Battistel battistel at gmail.com
Tue Jul 1 11:52:35 CEST 2014


Hello,
with the following command line I can generate 1kHz tone:

ffmpeg -f lavfi -i aevalsrc=0.165*sin(1000*2*PI*t) -acodec pcm_s16le -ac 2
-ar 48000 -t 10 tone.wav

I cannot understand how to set the signal amplitude (0.165 in my case).

My target is -18dB. "0.165" is an empiric value that generates a level
close to -18 (but not identical).

Using the formulas:

dB = 20 * log10(val)    0<=val<=1
val = 10 ^ (dB/20)

I should obtain ~0.12589 for -18dB

Removing the constant 0.165 (multipling by 1) I do not get 0 dB as expected.


Can you explain how to properly generate the amplitude constant starting
from a dB level?

thanks,
MB


More information about the ffmpeg-user mailing list