├── .gitignore ├── compare.png ├── compare2.png ├── defish.sh ├── sidebyside.sh ├── fishandstab.sh ├── fishcompare.sh ├── web-install.sh ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | packages 2 | workspace 3 | .idea 4 | -------------------------------------------------------------------------------- /compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoharbabin/ffmpeg-build-macosx/HEAD/compare.png -------------------------------------------------------------------------------- /compare2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoharbabin/ffmpeg-build-macosx/HEAD/compare2.png -------------------------------------------------------------------------------- /defish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ffmpeg -i $1 -vf frei0r=defish0r:0.8:y:0.6:0 -vcodec libx264 -pix_fmt yuv420p -acodec copy $2 3 | -------------------------------------------------------------------------------- /sidebyside.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ffmpeg -i $1 -i $2 -filter_complex "[0:v]setpts=PTS-STARTPTS, pad=iw*2:ih[bg]; [1:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=w; amerge,pan=stereo:c0= Wheezy, Ubuntu => Trusty, other Distros might work too 31 | * build-essentials installed: 32 | 33 | ``` 34 | # Debian and Ubuntu 35 | sudo apt-get install build-essential curl 36 | 37 | # Fedora 38 | sudo dnf install @development-tools 39 | ``` 40 | 41 | Installation 42 | ------------ 43 | 44 | ### Quick install and run 45 | 46 | Open your command line and run (needs curl to be installed): 47 | 48 | ``` 49 | bash <(curl -s https://raw.githubusercontent.com/zoharbabin/ffmpeg-build-macosx/master/web-install.sh?v1) 50 | ``` 51 | This command downloads the build script and automatically starts the build process. 52 | 53 | ### Common installation 54 | 55 | ``` 56 | git clone https://github.com/zoharbabin/ffmpeg-build-macosx.git 57 | cd ffmpeg-build-script 58 | ./ffmpeg-build-script --help 59 | ``` 60 | 61 | Usage 62 | ------ 63 | 64 | ``` 65 | ./build-ffmpeg --help Display usage information 66 | ./build-ffmpeg --build Starts the build process 67 | ./build-ffmpeg --cleanup Remove all working dirs 68 | ``` 69 | 70 | 71 | Contact 72 | ------- 73 | 74 | You can file an issue on this repo; or tweet @zohar; or E-Mail at z [dot] babin (@) gmail . 75 | 76 | If you'd like to contact the original creators: 77 | * Github: [http://www.github.com/markus-perl](http://www.github.com/markus-perl) 78 | * Github: [https://github.com/rtgoodwin](https://github.com/rtgoodwin) 79 | 80 | Tested on 81 | --------- 82 | 83 | * Mac OSX 10.11 64Bit XCode 7.* 84 | * Debian 8.3 85 | 86 | Example fisheye removal for GoPro/Mobius 87 | ------- 88 | * For Mobius lens "C": 89 | 90 | ```ffmpeg -i -vf frei0r=defish0r:0.8:y:0.6:0 -vcodec libx264 -pix_fmt yuv420p -acodec copy ``` 91 | 92 | ![Example of cleaned up image](https://github.com/rtgoodwin/ffmpeg-build-script-plus-frei0r-freetype/blob/master/compare.png) 93 | 94 | and another 95 | 96 | ![Example of cleaned up image](https://github.com/rtgoodwin/ffmpeg-build-script-plus-frei0r-freetype/blob/master/compare2.png) 97 | 98 | (Blur at edges is in the original video; keep those lenses clean, people! :) ) 99 | 100 | * For GoPro (or other cameras with less barrel distortion): 101 | 102 | ```ffmpeg -i -vf frei0r=defish0r:0.75:y:0.6:0 -vcodec libx264 -pix_fmt yuv420p -acodec copy ``` 103 | 104 | 105 | 106 | Example compilation output 107 | ------- 108 | 109 | ``` 110 | zohar.babin$ ./build-ffmpeg --build 111 | ffmpeg-build-script v 112 | ========================= 113 | 114 | Using 4 make jobs simultaneously. 115 | 116 | building nasm 117 | ======================= 118 | Downloading http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.gz... Done 119 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace 120 | $ make -j 4 121 | $ make install 122 | 123 | building yasm 124 | ======================= 125 | Downloading http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz... Done 126 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace 127 | $ make -j 4 128 | $ make install 129 | 130 | building opencore 131 | ======================= 132 | Downloading http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz?r=http0X0P+00.0000000.000000sourceforge.net0.000000projects0.000000opencore-amr0.000000files0.000000opencore-amr0.000000&ts=1442256558&use_mirror=netassist 133 | Failed to download http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencore-amr%2Ffiles%2Fopencore-amr%2F&ts=1442256558&use_mirror=netassist. Exitcode 18. Retrying in 10 seconds 134 | ... Done 135 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --disable-shared --enable-static 136 | $ make -j 4 137 | $ make install 138 | 139 | building libvpx 140 | ======================= 141 | Downloading https://github.com/webmproject/libvpx/archive/v1.5.0.tar.gz... Done 142 | sed: -i may not be used with stdin 143 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --disable-unit-tests --disable-shared 144 | $ make -j 4 145 | $ make install 146 | 147 | building lame 148 | ======================= 149 | Downloading http://kent.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz... Done 150 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --disable-shared --enable-static 151 | $ make -j 4 152 | $ make install 153 | 154 | building xvidcore 155 | ======================= 156 | Downloading http://downloads.xvid.org/downloads/xvidcore-1.3.4.tar.gz... Done 157 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --disable-shared --enable-static 158 | $ make -j 4 159 | $ make install 160 | $ rm /Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib/libxvidcore.4.dylib 161 | 162 | building x264 163 | ======================= 164 | Downloading ftp://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20170328-2245.tar.bz2... Done 165 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --disable-shared --enable-static 166 | $ make -j 4 167 | $ make install 168 | $ make install-lib-static 169 | 170 | building libogg 171 | ======================= 172 | Downloading http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz... Done 173 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --disable-shared --enable-static 174 | $ make -j 4 175 | $ make install 176 | 177 | building libvorbis 178 | ======================= 179 | Downloading http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz... Done 180 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --with-ogg-libraries=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib --with-ogg-includes=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/include/ --enable-static --disable-shared --disable-oggtest 181 | $ make -j 4 182 | $ make install 183 | 184 | building libtheora 185 | ======================= 186 | Downloading http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz... Done 187 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --with-ogg-libraries=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib --with-ogg-includes=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/include/ --with-vorbis-libraries=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib --with-vorbis-includes=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/include/ --enable-static --disable-shared --disable-oggtest --disable-vorbistest --disable-examples --disable-asm 188 | $ make -j 4 189 | $ make install 190 | 191 | building pkg-config 192 | ======================= 193 | Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.1.tar.gz... Done 194 | $ ./configure --silent --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --with-pc-path=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib/pkgconfig --with-internal-glib 195 | $ make -j 4 196 | $ make install 197 | 198 | building freetype 199 | ======================= 200 | Downloading http://download.savannah.gnu.org/releases/freetype/freetype-2.8.tar.gz... Done 201 | $ ./configure --silent --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --with-pc-path=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib/pkgconfig --disable-shared --enable-static 202 | $ make -j 4 203 | $ make install 204 | 205 | building fontconfig 206 | ======================= 207 | Downloading http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.94.tar.gz... Done 208 | $ ./configure --silent --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --with-pc-path=/Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib/pkgconfig --disable-shared --enable-static 209 | $ make -j 4 210 | $ make install 211 | 212 | building cmake 213 | ======================= 214 | Downloading https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz... Done 215 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace 216 | $ make -j 4 217 | $ make install 218 | 219 | building vid_stab 220 | ======================= 221 | Downloading https://codeload.github.com/georgmartius/vid.stab/legacy.tar.gz/release-0.98b... Done 222 | $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/Users/zohar.babin/Downloads/ffmpeg-build/workspace . 223 | $ make install 224 | 225 | building x265 226 | ======================= 227 | Downloading https://bitbucket.org/multicoreware/x265/downloads/x265_2.3.tar.gz... Done 228 | $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/Users/zohar.babin/Downloads/ffmpeg-build/workspace -DENABLE_SHARED:bool=off . 229 | $ make -j 4 230 | $ make install 231 | 232 | building fdk_aac 233 | ======================= 234 | Downloading http://downloads.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.5.tar.gz?r=https0X0P+00.0000000.000000sourceforge.net0.000000projects0.000000opencore-amr0.000000files0.000000fdk-aac0.000000&ts=1457561564&use_mirror=kent... Done 235 | $ ./configure --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --disable-shared --enable-static 236 | $ make -j 4 237 | $ make install 238 | 239 | building frei0r 240 | ======================= 241 | Downloading https://files.dyne.org/frei0r/releases/frei0r-plugins-1.6.1.tar.gz... Done 242 | $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/Users/zohar.babin/Downloads/ffmpeg-build/workspace . 243 | $ make -s install 244 | 245 | building ffmpeg 246 | ======================= 247 | Downloading http://ffmpeg.org/releases/ffmpeg-3.3.4.tar.bz2... Done 248 | $ ./configure --arch=64 --prefix=/Users/zohar.babin/Downloads/ffmpeg-build/workspace --extra-cflags=-I/Users/zohar.babin/Downloads/ffmpeg-build/workspace/include --extra-cflags=-I/Users/zohar.babin/Downloads/ffmpeg-build/workspace/include/vorbis --extra-cflags=-I/Users/zohar.babin/Downloads/ffmpeg-build/workspace/include/freetype2 --extra-ldflags=-L/Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib --extra-version=static --disable-debug --disable-shared --enable-static --enable-libopencore_amrwb --enable-libopencore_amrnb --extra-cflags=--static --disable-ffplay --disable-ffserver --disable-doc --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libvidstab --enable-frei0r --enable-indev=avfoundation 249 | $ make -j 4 250 | $ make install 251 | 252 | Building done. The binary can be found here: /Users/zohar.babin/Downloads/ffmpeg-build/workspace/bin/ffmpeg 253 | 254 | Install the binary to your /usr/local/bin folder? [Y/n] 255 | 256 | The frei0r plugins can be found here: /Users/zohar.babin/Downloads/ffmpeg-build/workspace/lib/ in a folder named "frei0r-1" 257 | 258 | Copy frei0r plugins to your /usr/local/lib/frei0r-1 folder [Y/n] 259 | ``` 260 | --------------------------------------------------------------------------------