FFmpeg git repo
Go to file
Stephen Seo 0ea20124b7 Add lensfun filter
Lensfun is a library that applies lens correction to an image using a
database of cameras/lenses (you provide the camera and lens models, and
it uses the corresponding database entry's parameters to apply lens
correction). It is licensed under LGPL3.

The lensfun filter utilizes the lensfun library to apply lens
correction to videos as well as images.

This filter was created out of necessity since I wanted to apply lens
correction to a video and the lenscorrection filter did not work for me.

While this filter requires little info from the user to apply lens
correction, the flaw is that lensfun is intended to be used on indvidual
images. When used on a video, the parameters such as focal length is
constant, so lens correction may fail on videos where the camera's focal
length changes (zooming in or out via zoom lens). To use this filter
correctly on videos where such parameters change, timeline editing may
be used since this filter supports it.

Note that valgrind shows a small memory leak which is not from this
filter but from the lensfun library (memory is allocated when loading
the lensfun database but it somehow isn't deallocated even during
cleanup; it is briefly created in the init function of the filter, and
destroyed before the init function returns). This may have been fixed by
the latest commit in the lensfun repository; the current latest release
of lensfun is almost 3 years ago.

Bi-Linear interpolation is used by default as lanczos interpolation
shows more artifacts in the corrected image in my tests.

The lanczos interpolation is derived from lenstool's implementation of
lanczos interpolation. Lenstool is an app within the lensfun repository
which is licensed under GPL3.

v2 of this patch fixes license notice in libavfilter/vf_lensfun.c

v3 of this patch fixes code style and dependency to gplv3 (thanks to
Paul B Mahol for pointing out the mentioned issues).

v4 of this patch fixes more code style issues that were missed in
v3.

v5 of this patch adds line breaks to some of the documentation in
doc/filters.texi (thanks to Gyan Doshi for pointing out the issue).

v6 of this patch fixes more problems (thanks to Moritz Barsnick for
pointing them out).

v7 of this patch fixes use of sqrt() (changed to sqrtf(); thanks to
Moritz Barsnick for pointing this out). Also should be rebased off of
latest master branch commits at this point.

Signed-off-by: Stephen Seo <seo.disparate@gmail.com>
2018-07-15 10:07:54 +02:00
compat compat: remove in-tree NVidia headers 2018-02-27 16:22:12 +01:00
doc Add lensfun filter 2018-07-15 10:07:54 +02:00
ffbuild
fftools ffplay: add support for various YUV conversion modes 2018-07-13 22:24:33 +02:00
libavcodec avcodec/dirac_dwt_template: Fix signedness regression in interleave() 2018-07-14 18:02:26 +02:00
libavdevice avdevice/v4l2enc: add video4linux2 name alias 2018-06-18 16:26:23 -08:00
libavfilter Add lensfun filter 2018-07-15 10:07:54 +02:00
libavformat aadec: improve seeking in mp3 content 2018-07-14 19:04:48 +02:00
libavresample avresample: remove deprecated attribute from the AVAudioResampleContext struct 2018-01-09 10:56:53 -03:00
libavutil avutil/pixelutils: correct the function name in comments 2018-07-11 20:12:33 +08:00
libpostproc Bump minor versions after release/4.0 branching 2018-04-16 12:35:12 +02:00
libswresample swresample/arm: rename labels to fix xcode build error 2018-04-28 18:08:52 +02:00
libswscale lsws/rgb2rgb_template: Do not compile unneeded shuffle functions on big-endian. 2018-06-10 03:22:59 +02:00
presets
tests fate: allow temp files for passed test to be kept 2018-07-10 10:12:38 +05:30
tools tools/target_dec_fuzzer: set parser codec id to avoid assertion failure 2018-07-07 12:09:34 +02:00
.gitattributes
.gitignore Remove the ffserver program 2018-01-06 18:31:37 +00:00
.travis.yml
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
Changelog lavc: implement an ATRAC9 decoder 2018-07-03 20:15:01 +01:00
INSTALL.md
LICENSE.md
MAINTAINERS MAINTAINERS: add myself to qsv section 2018-06-07 23:57:27 +01:00
Makefile Revert "lavd: add new API for iterating input and output devices" 2018-03-31 23:26:31 +01:00
README.md Remove the ffserver program 2018-01-06 18:31:37 +00:00
RELEASE
configure Add lensfun filter 2018-07-15 10:07:54 +02:00

README.md

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.