How to remove fisheye from videos on Ubuntu
5,020
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
Related videos on Youtube
Author by
Hugh Perkins
Machine learning engineer. Wrote DeepCL, https://github.com/hughperkins/DeepCL, and a bunch of other GPU/OpenCL things.
Updated on September 18, 2022Comments
-
Hugh Perkins almost 2 years
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?
-
Elisa Cha Cha almost 10 yearsAnother 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.
-
Hugh Perkins almost 10 years(@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)
-
ArekBulski almost 8 years@LordNeckbeard But how do you apply that
lenscorrection
filter? -
Elisa Cha Cha almost 8 years@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.