I have some videos I have taken using a head-mounted video-camera. The camera records the videos with a 'fisheye' effect. How do I remove it?
1 Answer
I tried for ages, different solutions, taking me around all kinds of options, installing Shotcut, and so on. In the end, what worked for me was:
- install the following:
sudo apt-get install pkg-config yasm frei0r-plugins cmake libfaac-dev libx264-dev opencl-headers
- download latest frei0r zip from https://github.com/ddennedy/frei0r/archive/master.zip
unzip frei0r zip, cd inside, do:
cmake .
make
sudo make install
(at this point, I also downloaded and installed vidstab, from https://github.com/georgmartius/vid.stab/archive/master.zip )
- download ffmpeg source-code, from http://ffmpeg.org/releases/ffmpeg-2.3.3.tar.bz2
- untar, cd into the directory, run ./configure as follows:
./configure --enable-frei0r --enable-gpl --enable-libx264 --enable-libfaac --enable-nonfree
(if you've installed vidstab, you can also add--enable-libvidstab
, like I did)
make
sudo make install
Now, you can use frei0r:defish0r like this:
ffmpeg -y -strict -2 -i in.mov -vcodec libx264 -b:v 800k
-pix_fmt yuv420p -vf frei0r=defish0r:0.75:y:0.6:0 -acodec copy out.mov
-
2Another option is the lenscorrection filter which has recently been ported from frei0r on 12 Aug. It is a native FFmpeg filter, so it does not need any external libraries.– lloganAug 21, 2014 at 17:57
-
Yes, I fought with lenscorrection for a bit, but then found that defish0r did what I wanted really easily. I've put the defish0r parameters that I used in the command above. I never quite got lenscorrection to work for me. Feel free of course to add an answer that shows how to use lenscorrection. Aug 22, 2014 at 0:35
-
(@LordNeckbeard, by the way, thanks for your posting on vidstab, which was one of my best sources on information on getting ffmpeg working, and is where I got the vidstab build information above) Aug 22, 2014 at 0:36
-
-
@ArekBulski I've never actually used it and I am unable to test now so I can only refer you to the lenscorrection filter documentation and Correct lens distortion with ffmpeg.– lloganJul 13, 2016 at 16:12