Current location - Health Preservation Learning Network - Slimming men and women - Find the compilation of ffmpeg under centeOS 64-bit.
Find the compilation of ffmpeg under centeOS 64-bit.
Software installation

(1).MinGW+ Microsoft system installation

Download MSYS and extract it to the E:/ffmpeg64/msys directory.

Download MinGW-w64 to the E:/ffmpeg64/msys/mingw64 directory.

Start msys.bat, open a terminal similar to Linux, and import the environment variables of mingw64.

"echo" export path =. :/local/bin:/mingw 64/bin:/bin ' & gt; . outline

Source. outline

(2).SDL device

Download SDL 1.2. 14, and extract it to the e:/ffmpeg64/SDL-1.2.14 directory.

Enter the SDL- 1.2. 14 directory and execute in turn:

. /configure-host = x86 _ 64-w64-mingw 32

manufacture

Carry out installation

During compilation, the following error occurred:

Take a look at the source code of SDL_dx5video.c, as shown in the figure below. We can see that if the predefined NONAMELESSUNION is enabled, the structure of u 1 and u2 will be referenced, and the above error will occur.

The solution is to delete the predefined unnamed symbols.

Another simple solution is to replace the SDL library with SDL- 1.2. 15 or SDL-2.0.3. Since ffplay.c is mainly implemented by using the interface of SDL- 1.2, the source code of ffplay.c needs to be modified if SDL-2.0.3 is used. So this paper recompiles with SDL- 1.2. 15 to generate SDL library and install SDL-65438+.

The compilation process is completed, but the following error occurs during make install, prompting that "the system cannot find the specified file", but /bin/install and sdl-config both exist.

After inquiring the relevant information, it is found that the error may be caused by the terminal's error in explaining the path, such as:/problem-with-ran lib-while-running-make-install-for-SDL-td3282130.html. When MinGW+Msys and Cygmin coexist, the path conflict will occur. In Cygmin, the root directory "/"is interpreted as the root directory of the current directory, that is, "E:/", and Cygmin will interpret "/bin/install" as "E:/install", resulting in the error that the system cannot find the specified file.

Solution: Modify Makefile and reset the installation path.

(3).x264 Installation

Download x264, and extract it to the E:/ffmpeg64/x264 directory.

Enter the x264 directory and execute in turn:

. /configure-host = x86 _ 64-w64-Ming W32-enable-shared

manufacture

Carry out installation

(4).FFmpeg installation

Download FFmpeg 1.2 and extract it to E:/ffmpeg64/ffmpeg 1.2.

Enter the ffmpeg directory and execute in turn:

Copy code

. /configure-enable-GPL-enable-libx 264-enable-shared-enable-static-arch = x86 _ 64-extra-cflags = '-I/local/include-I/local/cross-tools/i386-mingw 32/ include/SDL '-extra-LD flags = '-L/local/lib-L/local/cross-tools/i386-mingw 32/lib '

manufacture

Carry out installation

Copy code

-extra-cflags is used to specify the header file path, while-extrac-ldflags is used to specify the library file path.

Note: Be sure to specify the header file and library file path of SDL library and x264 library.

(5). Verify the installation

Verify whether the generated ffmpeg tool can be executed, and play the video file with ffplay to see if it can be played normally.

Verify whether the generated dynamic library and executable program are 64-bit, and use dumpbin to view the attribute information of dynamic library and executable program.