c++ - Building FFMPEG for Visual Studio development -
i'm trying use ffmpeg in visual studio 2013 c++ software (ultimately part of opencv project) - right i'm trying basic ffmpeg functionality. in general, when building in visual studio, build 64--bit software multi-threaded dll runtime libraries. have built ffmpeg using general instructions 'native windows compilation using ... mingw-w64' @ http://ffmpeg.org/platform.html#windows (i provide more detailed set of steps followed below...).
after building ffmpeg software on system, tried create simple 'hello world' project in visual studio 2013. specifically, tried implement initial tutorial file presented @ http://dranger.com/ffmpeg/tutorial01.html. upon building project, error:
c:\msys64\usr\local\ffmpeg\libavutil\common.h(45): fatal error c1083: cannot open include file: 'libavutil/avconfig.h': no such file or directory
the following detailed steps took build ffmpeg , create basic visual studio project:
============ building ffmpeg ===============
- downloaded , intalled msys2-x86_64-20160205.exe http://msys2.github.io
- ran
update-core
update msys2 install - ran
pacman -suu
(twice) complete update (following instructions updating shortcuts, etc.) - then quit out of msys2 shell , opened mingw-w64 win64 shell. in new shell:
- installed following packages using
pacman -s <package-name>
list of packages installed is: make, pkg-config, diffutils, mingw-w64-x86_64-yasm, mingw-w64-x86_64-gcc, mingw-w64-x86_64-sdl, git - then cd'd
cd /usr/local
- ran
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
- i wanted build ffmpeg library 'out-of-tree' of msys64 folder. so, in regular file system of windows machine created folder @ c:\ffmpeg
- back in win64 shell, cd'd new folder:
cd /c/ffmpeg
- then ran
/usr/loca/ffmpeg/configure --enable-shared
- then
make -r
- and,
make install
now, if had guess, 'flaw' in options used when calling 'configure' script of ffmpeg. need use particular options can take ffmpeg libraries built here , use them dynamic (dll) libraries in visual studio?
========== configuring visual studio project ============
here's how created simple hello world project in visual studio see if ffmpeg working.
- i created new visual c++ 'empty project' in visual studio 2013
i configured project properties follows:
a. in c/c++ => general => additional include directories, put
c:\msys64\usr\local\ffmpeg
b. in linker=>general => additional library directories, pointed each of built library folders (basically pointed @ all of libraries built ensure not inadvertently missing critical one). list follows:
- c:\ffmpeg\libavcodec
- c:\ffmpeg\libavdevice
- c:\ffmpeg\libavfilter
- c:\ffmpeg\libavformat
- c:\ffmpeg\libavutil
- c:\ffmpeg\libswresample
- c:\ffmpeg\libswscale
- c:\ffmpeg
c. in linker=> input => additional dependencies, pointed particular libraries (again - pointed of ones present). list is:
- avcodec.lib
- avdevice.lib
- avfilter.lib
- avformat.lib
- avutil.lib
- swresample.lib
- swscale.lib
i created new source file called 'tut01.c' , copied/pasted code http://dranger.com/ffmpeg/tutorial01.c
- then hit f7 , got error specified above not finding avconfig.h
the above best guess steps need follow working in windows (btw, it's windows 10, 64-bit) & microsoft visual studio 2013. should change basic program build , run?
@halfelf, responses. caused me take @ files , realize pointing @ wrong location include (and lib) files. turns out that, upon building ffmpeg, places in lateral folders /usr/local/include
, /usr/local/bin
, guess, more complete set of include , library files, respectively (including avconfig.h!) updated visual studio project properties point @ these folders solved problem.
but subsequently, ran new problem of 'pix_fmt_rgb24' not being identified. however, think related tutorial file i'm using being out of date. can delete (and related) lines , code build , execute (though not since 'money' lines of code removed). @ least base features of ffmpeg appear working.
Comments
Post a Comment