Skip to content

Instantly share code, notes, and snippets.

@tgarc
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgarc/8d6507a456b426631946 to your computer and use it in GitHub Desktop.
Save tgarc/8d6507a456b426631946 to your computer and use it in GitHub Desktop.
Compiling opencv 2.4.10 for cygwin with ffmpeg 2.5.3
# download the opencv-2.4.10 for unix
# unzip the library to some temporary folder; let's say it's ~/opencv
# see http://hvrl.ics.keio.ac.jp/kimura/opencv/opencv-2.4.10.html
# for build patch
#build ffmpeg
$ cd /tmp/
$ tar xvjf ffmpeg-2.5.3.tar.bz2
$ cd ffmpeg-2.5.3/
$ ./configure --disable-yasm --disable-iconv
$ make install
# navigate to opencv root directory
$ cd /tmp/opencv
# apply patch
$ patch -p1 < ../opencv-2.4.10-cygwin-patch-20141008.txt
# create build dir
$ mkdir build
$ cd build
$ cmake -D CMAKE_LEGACY_CYGWIN_WIN32=0 \
-D CMAKE_BUILD_TYPE=RELEASE \
-D BUILD_SHARED_LIBS=ON \
-D WITH_OPENMP=ON \
-D WITH_OPENGL=ON \
-D WITH_OPENCL=OFF \
-D WITH_FFMPEG=ON \
-D ENABLE_FAST_MATH=ON \
-D ENABLE_SSE=ON \
-D ENABLE_SSE2=ON \
-D ENABLE_SSE3=ON \
-D ENABLE_SSSE3=ON \
-D ENABLE_SSE41=ON \
-D ENABLE_SSE42=ON \
-D ENABLE_AVX=ON \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_EXAMPLES=OFF \
-D ALIASOF_libavcodec_VERSION=56.13.100 \
-D ALIASOF_libavformat_VERSION=56.15.102 \
-D ALIASOF_libavutil_VERSION=54.15.100 \
-D ALIASOF_libswscale_VERSION=3.1.101 \
-D PYTHON_NUMPY_INCLUDE_DIR=/usr/lib/python2.7/site-packages/numpy/core/include \
-D PYTHON_PACKAGES_PATH=/usr/lib/python2.7/site-packages \
-D CYGWIN_FFMPEG_BUILT_DIR=../../ffmpeg-2.5.3 \
-D CMAKE_INSTALL_PREFIX=/usr/local/ \
..
$ make install
@casmer
Copy link

casmer commented Jul 6, 2015

do you happen to have the 2.4.10 patch? that site only has the 2.4.11 patch now.

@tgarc
Copy link
Author

tgarc commented Aug 25, 2015

I don't, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment