How to compile OpenCV 2.3 with ffmpeg support with Visual Studio 2010

后端 未结 3 1808
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 21:46

It\'s two days I\'m search around the web for a tutorial to compile OpenCV 2.3 with ffmpeg support under windows, but nothing found. I\'m using pre-built version of OpenCV i

相关标签:
3条回答
  • 2020-12-10 22:01

    The answer your looking for is here and it works for the 32 bit and 64 bit configurations. I used this build of FFMPEG. http://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-git-1aeb88b-win64-dev.7z

    1) Download OpenCV 2.3

    2) Open the root CMakeLists.txt and insert the line set(HAVE_FFMPEG 1)

    3) Download http://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-git-1aeb88b-win64-dev.7z (or the 32 bit build if u fancy it)

    4) Edit avformat.h found in the ffmpeg include dir with #define INT64_C

    5) Edit cap_ffmpeg_impl.hpp from the highgui project with #define snprintf _snprintf

    6) in your highgui project properties under C/C++>Additional Include Directories add path of the include directory of FFMPEG you just downloaded

    7)On the same property page under Linker>General>Additional Library Dependencies add the path of the lib directory of FFMPEG you just downloaded

    8)On the same property page under Linker>Input>Additional dependencies add ALL the names of the libraries of ffmpeg found in lib (avformat.lib, avscale.lib, avcore.lib etc)

    9) build the highgui project

    10) Add the path of the .dll files that came with FFMPEG to the System Path environment variable.

    That's it! 10 easy steps ;)

    0 讨论(0)
  • 2020-12-10 22:10

    In my experiment, FFMPEG is not directly supported in window. The flag WITH_FFMPEG only appears under UNIX(opencv 2.3 CMakeLists.txt). So, if you want to build opencv 2.3 with ffmpeg support, you should edit the CmakeLists.txt or the project opencv_highgui yourself. And then get ffmpeg from WWW. You may also need to edit cap_ffmpeg_impl.hpp.

    0 讨论(0)
  • 2020-12-10 22:18

    Build OpenCV with CMake from sources. Choose USE_FFMPEG flag.

    Get ffmpeg from http://ffmpeg.zeranoe.com/builds/

    0 讨论(0)
提交回复
热议问题