First, download Ffnpeg source code
: http://ffmpeg.org/download.html
Second, solve the issue of the version
Perhaps you have compiled FFmpeg, or installed the relevant library, it should be uninstalled first, otherwise it will be reported a lot of version of the error.
Specific procedures for uninstallation:
sudo apt-get remove ffmpeg
sudo apt-get remove libavcodec52 libavdevice52 libavfilter0 libavformat52 libavutil49 Libpostproc
sudo apt-get isntall Remove Libx264-dev
If this does not work, then manually resolve:
Library file path:/usr/lib
Header file path:/usr/include
Enter these paths to see if there are any libraries in the ffmpeg, and if so, delete them all;
Note: Sometimes the library will also be installed under:/use/local.
Third, install FFmpeg dependent Library
sudo apt-get update
sudo apt-get install build-essential git-core checkinstall texi2html Libfaac-dev
Libopencore-amrnb-dev Libopencore-amrwb-dev Libsdl1.2-dev Libtheora-dev Libvorbis-dev
Libx11-dev Libxfixes-dev Libxvidcore-dev Zlib1g-dev
Iv. installation of Yasm dependent libraries
Why alone this depends on the library, because Linux itself has this library, but compile ffmpeg when the library version is too low, at least 1.0 of the version, with the command view: Yasm--version, Found that Linux comes with a version of 0.8, so we need to reinstall each library:
1, from the Internet: http://yasm.tortall.net/Download.html download yasm;
2, after decompression into the yasm directory;
3,./configure
4. Make
5. Sudo make install
V. Installation of LAME Library
This is a library file that supports MP3 encoding.
1, Online: http://lame.sourceforge.net/download.php, download lame source files;
2, after decompression into the lame directory;
3,./configure
4. Make
5. Sudo make install
VI. Installation of X264 Library
1, Online: http://www.videolan.org/developers/x264.html, download x264 source files;
2, after decompression into the x264 directory;
3,./configure--enable-static
4. Make
5. Sudo make install
Vii. Compilation of FFmpeg
At this point most of the required libraries have been installed, and if necessary, you can add the required libraries.
1, into the FFmpeg directory;
2./configure--ENABLE-GPL--enable-nonfree--enable-pthreads--ENABLE-LIBFAAC
--enable-libmp3lame--enable-libtheora--enable-libx264--enable-libxvid--enable-x11grab
--enable-libopencore-amrnb--ENABLE-LIBOPENCORE-AMRWB--enable-version3--disable-optimizations
--disable-asm
3. Make
4. Sudo make install
Eight, the FFmpeg project into eclipse for debugging
1, the establishment of project engineering, here we choose File->new->makefile Project with Existing Code;
2. In the Import Existing Code dialog box, toolchain for Indexer settings Select Linux GCC, then click Browse to find the source code folder for source import, then click Ok->finish, At this point you can see that the new project has included all the source code and compiled files;
3, right click ffmpeg_g Select Debug as->local C + + application->gdb/mi then OK;
4, then debugging can be;
Ix. errors during compilation of import files
After the file is imported to eclipse, it is compiled, and a heap of errors defined by the following macros are reported.
1. Description Resource Path location Type Symbol ' codec_cap_experimental ' could not being resolved Utils.c/ffmpeg-0.8.9/liba Vcodec
Error Analysis:
After carefully looking at the source code, trace to the error, found that the header file contains the problem.
A lot of header files are in the folder: such as avcodec.h in the Libavcodec folder, but in the header file contains no specific path, so that the header file is not included, the natural compilation will be wrong.
Workaround:
Navigate to where the error occurred and see if the header file contains the correct path. such as # include "Libavcodec\avcodec.h"
2, the error in the ALLCODECS.C file is most difficult to find, found reported hundreds of errors, by placing the cursor to the wrong place, there is the following error ' Onfig_vc1_dxva2_hwaccel ' could not be resolved.
Write the error in the file, by right-click Open declaration Find the string definition file, found in the Config.h file, and ALLOCODECS.C does not contain this header file, will naturally report a lot of errors,
So include the config.h in the Allcodecs.h file.
This article references: http://www.linuxidc.com/Linux/2011-05/36286p2.htm
Ubuntu compiles ffmpeg and uses eclipse debugging