1, FFMPeg development library download
https://ffmpeg.zeranoe.com/builds/win32/ downloaded from precompiled libraries and header files, in order to ffmpeg3.2 this example to illustrate the environmental structures.
ffmpeg-3.2-win32-dev.zip: lib and header files
ffmpeg-3.2-win32-shared.zip:dll file
ffmpeg-3.2-win32-static.zip: routine EXE file, can be downloaded temporarily.
Since the introduction development now, no trace debug code inside the file to the library, you do not have the source code to compile FFMPeg. FFMPeg introduced later compiled source files.
2, VS2015 create a project based on Dialog
Since the introduction development environment is established, the Dialog based project a little easy points.
To build a CPP file (for example ffmpeg.cpp), the FFMGEG related work on this file, separate from the framework document, to see clearly.
With the establishment of a form of engineering, mainly later need to display video, you would not have the SDL library.
3, extract a copy of the library and header files
Header files and LIB files into the project directory, other directories can also be put under, because the project package upload compressed, so they focus into the project directory.
After extracting the DLL copied to the Debug directory, packaging needs, and it compiled EXE files together.
NOTE:
DLL file storage directory:
(1) can be placed in the system directory system32 under
(2) may also be added in the directory where the DLL in the environment variable Path,
(3) and the EXE or together, as is the case.
4, VC project configuration properties.
(1) Configuration header file path
In this example, the header file is stored in the project directory, it is written ". \ Include"
(2) Configuration LIB library file path
(3) Configuration LIB library file name
In this example the eight libraries are introduced, though not all of them use the library to prepare for future development.
5, configured, began to dry
Ffmpeg.cpp file contents:
#include "stdafx.h"
#ifdef __cplusplus
extern "C" {
#endif
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h>
#ifdef __cplusplus
}
#endif
void TestFFMpeg()
{
av_register_all();// 注册编解码库
avfilter_register_all();// 注册filter库
}
6, compile and run
Compile a success.
Since only the first step, there is no interface output in debug mode to see if there is no problem.
Successful operation, no error.
7, download project files
In the present embodiment Debug - x86 compiler