OpenCV Admin

Install

  1. Install FFmpeg.
  2. Download, untar opencv-x.y.z.
  3. Edit /tmp/opencv-1.1.0/otherlibs/highgui/cvcap_ffmpeg.cpp, changing includes from:
    #include <ffmpeg/avformat.h>
    #include <ffmpeg/avcodec.h>
    #if defined(HAVE_FFMPEG_SWSCALE)
    #include <ffmpeg/swscale.h>
    #endif
    

    to:

    #include <libavformat/avformat.h>
    #include <libavcodec/avcodec.h>
    #if defined(HAVE_FFMPEG_SWSCALE)
    #include <libswscale/swscale.h>
    #endif
    
  4. Show configure where to look for the modified libraries:

    sed -e 's/ffmpeg\/avcodec.h/libavcodec\/avcodec.h/' -e 's/ffmpeg\/swscale.h/libswscale\/swscale.h/' -i configure

  5. ./configure --prefix=/util/opencv-1.1.0 --with-gtk=yes --with-ffmpeg --without-python --without-quicktime CPPFLAGS="-I/util/libpng/include -I/util/ffmpeg/include" LDFLAGS="-L/util/libpng/lib -L/util/ffmpeg/lib"

    Maybe:

    ./configure --prefix=/util/opencv-1.1.0 --with-gtk --with-ffmpeg --without-python --without-quicktime CFLAGS="-I/util/gtk+/include/gtk-2.0 -I/util/libpng/include -I/util/ffmpeg/include" CPPFLAGS="-I/util/gtk+/include/gtk-2.0 -I/util/libpng/include -I/util/ffmpeg/include" LDFLAGS="-L/util/gtk+/lib -L/util/libpng/lib -L/util/ffmpeg/lib"

    Maybe:

    ./configure --prefix=/util/opencv-1.1.0 --with-gtk --with-gthread --with-ffmpeg --without-python --without-quicktime CFLAGS="-I/util/libpng/include -I/util/ffmpeg/include -I/util/ffmpeg/include/libavcodec -I/util/ffmpeg/include/libavdevice -I/util/ffmpeg/include/libavfilter -I/util/ffmpeg/include/libavformat -I/util/ffmpeg/include/libavutil -I/util/ffmpeg/include/libavpostproc -I/util/ffmpeg/include/libswscale" CPPFLAGS="-I/util/libpng/include -I/util/ffmpeg/include -I/util/ffmpeg/include/libavcodec -I/util/ffmpeg/include/libavdevice -I/util/ffmpeg/include/libavfilter -I/util/ffmpeg/include/libavformat -I/util/ffmpeg/include/libavutil -I/util/ffmpeg/include/libavpostproc -I/util/ffmpeg/include/libswscale" LDFLAGS="-L/util/libpng/lib -L/util/ffmpeg/lib"

  6. make
  7. sudo make install

References

  1. http://opencv.willowgarage.com/wiki/CompileOpenCVUsingLinux