[FFmpeg-user] 'equalizer' audio filter

Nicholas Robbins nickrobbins at yahoo.com
Thu May 8 20:09:13 CEST 2014


> On Thursday, May 8, 2014 1:20 PM, Darkmoon <darkmoon at verizon.net> wrote:

> > I read the entry for this filter in the User Guide, then searched the 
> web when I found the Guide entry mostly limited to identifying options 
> for the filter, with little explanation of how the options actually 
> function, and how they are to be used to create an actual "equalizer." 
> 
> What I found was no help either to a casual user who is not conversant 
> with concepts of audio engineering (like "Q-Factor" or 
> "slope," and how 
> to determine what values to use in a filter). I hope I can frame my 
> question a bit more clearly than what I found in my search.
> 
> I would like to use 'equalizer' in the manner of a simple graphic 
> equalizer, complete with band sliders that have '0 gain' center 
> positions. My ideal comand-line 'equalizer' filter would take a series 
> of "band=gain" pairs, where each "band" would represent a 
> slider, and 
> "gain" the position of each slider. "Gain" would default to 
> 0 if a 
> specific "band" is not identified, equivalent to the center position 
> of 
> a slider on a graphic equalizer.
> 
> Is there a way to use ffmpeg 'equalizer' in this manner? How would it 
> be done?

I think you need to look at http://ffmpeg.org/ffmpeg-filters.html#equalizer again. Carefully, twice.

Each equalizer filter is a single slider. For that slider you specify a central frequency fc (in hz) and a width you have four ways of specifying that width. I don't know anything about audio engineering, or what Q-factor, slope or octave mean in the context of a filter, but if we work just with the 'h' setting that that speficies how wide each range is. I'm not sure if the w is from fc to either edge or from one edge to the other.  I'm working on from one edge to the other, if it is center to edge, then you would half my bw values. I hope gain is self evident.

So for each filter (slider) you pick those numbers, fc,bw,gn. You add the following to your filterchain.

equalizer=f=fc:width_type=h:width=bw:g=gn

and you separate your sliders with comas if this is going in a '-filter' argument to a command line ffmpeg call.

So if we work with a 100 - 10k in six  approximately logarithmicly equal steps we would get something like the following ranges (all in hz)

125 +/- 75
500 +/- 300
2000 +/- 1200
8000 +/- 4800
3200 +/- 19200
9600 +/- 44800

These don't overlap, I don't know if it is better if they do or they don't, and some snooping around on google indicates you probably want to use Q factors rather than 'h'.

Ok, so those are the fc and bw pairs. So if you want to have gains g1 ... g6 you would do

equalizer=f=125:width_type=h:width=150:g=g1,\
equalizer=f=500:width_type=h:width=600:g=g2,\
equalizer=f=2000:width_type=h:width=2400:g=g3,\
equalizer=f=8000:width_type=h:width=9600:g=g4,\
equalizer=f=32000:width_type=h:width=38400:g=g5,\
equalizer=f=96000:width_type=h:width=89600:g=g6

all in one line (without the \'s) 

> What are some sane and practical values for setting the center 
> and width of each band (or where can I find that info)? Some examples 
> would be lovely. Thank you...

I have no idea how sensible that is from an audio engineering standpoint, but it seems reasonable to me and that is what the documentation says. 

Nick


More information about the ffmpeg-user mailing list