Latest FFmpeg compiling and using Eclipse for source code debugging

Source: Internet
Author: User

Recently because of the project needs, must modify the FFmpeg source to modify to meet the needs of the project, but I have never to compile and use the FFmpeg source code, has been compiled with someone else's SDK, coupled with the custom vs convenient compilation environment, It is really difficult to compile and debug so many sources of code under Linux. There is no good in Linux under the integrated development environment easy to use, no way eclipse can do it. All right, no more nonsense, just get to the point. Part I: Compilation of FFmpeg

First download the latest FFmpeg source code:

Because I used the education network, with SVN download too tm slow, 1kb/s, it is estimated that next year will not finish. Recommend a website, in addition to have ffmpeg source code and source code, and with off-the-shelf SDK (under Windows).

The Web site is as follows:

STEP1: Web site

http://ffmpeg.zeranoe.com/builds/

STEP2: Version Issues

After downloading, a very important work to do, or later you in the use or debugging FFmpeg will appear a lot of inexplicable problems. Be sure to check to see if you have installed the FFmpeg library files under your Linux if installed, to remove first, otherwise to the recent, your library has some new, some old, to use the time to give you a pile of version error, you cry ... Specific practices:

Here is the version error I had when I compiled:

Ffmpeg:relocation error:ffmpeg:symbol postproc_configuration, version libpostproc_51 not defined in file libpostproc.so . Wuyi with Link Time reference

Solution:

$: Apt-get Remove FFmpeg

$: Apt-get Remove libavcodec52 libavdevice52 libavfilter0 libavformat52 libavutil49

$: Apt-get Remove Libx264-dev

The solution above may be different on various machines, because the installed libraries may be different

If not, fix it manually:

Path to library file:/usr/lib

Path to header file:/usr/include

Enter these paths to see if there are any libraries in the ffmpeg, and if so, delete them.

STEP3: installation FFmpeg library files that are dependent on:

$: sudo apt-get update

$: sudo apt-get install build-essential git-core checkinstall yasm texi2html/

Libopencore-amrnb-dev Libopencore-amrwb-dev Libsdl1.2-dev Libtheora-dev/

Libvorbis-dev Libx11-dev Libxfixes-dev Libxvidcore-dev Zlib1g-dev

This step provides only the library files that are required for the most commonly used configurations, and if there are additional configurations in the compilation ffmpeg, install them using the new software manager.

STEP4: installation x264

Download the x264 source from the Web site in STEP1:

$:./configure–enable-static

$:make

$:make Install

STEP5: installation FFmpeg

Attention:

1. If you are installing a library file, be sure to use--enable-shared, or you will not generate the. so file.

2. The default library file directory is/usr/local/lib and we modify it to/usr so that it is easy to install

$:./configure--ENABLE-GPL--enable-shared--enable-version3--enable-nonfree--enable-postproc-- Enable-libopencore-amrnb--ENABLE-LIBOPENCORE-AMRWB--enable-libtheora--enable-libvorbis--enable-libxvid-- Enable-x11grab--PREFIX=/USR

$: Make

$: sudo make install Part two: Debugging with Eclipse

There is no good integrated development environment under Linux, just eclipse.

First Download Eclispe + CDT, this online with Ubuntu Software Center can be.

Here to note that the use of Eclipse for debugging, if the FFmpeg source code in the compilation of the use of the-enable-shared option, then in the debugging will be unable to step into the situation, this problem tortured me for a long time, later found that the. so file, alas ...

reconfiguration: Enter in FFmpeg source directory

$:./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-libopencore-amrnb--enable-version3--disable-optimizations--disable-asm

$: Make

To build the project, here we choose File->new->makefile Project with Existing Code

N Select Linux GCC in toolchain for Indexer settings in the Import Existing Code dialog box

Then click Browse to locate the source code folder

Then dot Ok->finish

You can see that the new project already contains all the source code and the compiled files.

Right-click Ffmpeg_g to select Debug as->local C + + Application->gdb/mi then OK

OK, you can adjust it as much as you want.

Shortcut keys for Eclipse:

Using VS is customary, the shortcut keys in Eclipse Debugging are not very useful and want to change.

Window->preference->general->keys->scheme:microsoft Visual Studio

But then came a question that f10!

This key in VS inside is step over, but in eclipse as long as you press F10 will come out of the file dialog box, then online check, the solution is as follows:

Eclipse F10 Key mapping bug

$: Gconftool-2--get/desktop/gnome/interface/menubar_accel

F10

$: Gconftool-2--type string--set/desktop/gnome/interface/menubar_accel "Ctrl-shift-m"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.