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 ===============

  1. downloaded , intalled msys2-x86_64-20160205.exe http://msys2.github.io
  2. ran update-core update msys2 install
  3. ran pacman -suu (twice) complete update (following instructions updating shortcuts, etc.)
  4. then quit out of msys2 shell , opened mingw-w64 win64 shell. in new shell:
  5. 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
  6. then cd'd cd /usr/local
  7. ran git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
  8. i wanted build ffmpeg library 'out-of-tree' of msys64 folder. so, in regular file system of windows machine created folder @ c:\ffmpeg
  9. back in win64 shell, cd'd new folder: cd /c/ffmpeg
  10. then ran /usr/loca/ffmpeg/configure --enable-shared
  11. then make -r
  12. 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.

  1. i created new visual c++ 'empty project' in visual studio 2013
  2. 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
  3. i created new source file called 'tut01.c' , copied/pasted code http://dranger.com/ffmpeg/tutorial01.c

  4. 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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -