[FFmpeg-user] lenscorrection and vignette filters

Michael Koch astroelectronic at t-online.de
Tue Feb 23 10:00:47 CET 2016

> I found a bug in the documentation of the lenscorrection filter:
> https://www.ffmpeg.org/ffmpeg-all.html#lenscorrection
> It's written there "0.5 means no correction" for the coefficients k1 
> and k2.
> This can't be right, or the formula is wrong. It's obvious that the 
> formula makes no correction if k1=k2=0.

The remarks "0.5 means no correction" in the documentation are wrong. 
This can easily be tested:

ffmpeg -i input.png -vf lenscorrection=k1=0.5:k2=0.5 output.png
It's clearly visible that the output is not the same as the input.

ffmpeg -i input.png -vf lenscorrection=k1=0:k2=0 output.png
Now the output is the same as the input. It is clear that 0 means no 

But unfortunately this isn't the only error in the documentation. I 
haven't yet found out which formula is actually used in the 
lenscorrection filter, but one thing is absolutely sure: It's not the 
formula from the documentation.

I've done some tests. The input picture is 5472x3648. Half of the 
diagonal is 3288.
With k1=0.1, half of the diagonal becomes 3030.
With k1=0.2, half of the diagonal becomes 2856.
With k1=0.3, half of the diagonal becomes 2723.
With k2=0.1, half of the diagonal becomes 3058.

None of these results can be explained by the documented formula.


More information about the ffmpeg-user mailing list