Debugging is a very effective way to work with the code in the process. The project that we used to build in Visual Studio makes it easy to debug the program. But for a project like FFmpeg, it's not so easy to get a single-step debug. If you have to debug run FFMpeg, it's best to follow the instructions in our previous blog post to compile, and put it in eclipse for debugging.
Before you begin, you need to install Ubuntu and compile the source code for FFmpeg as described in the previous posts.
specific links to the interview:
compiling ffmpeg http://www.linuxidc.com/Linux/2014-11/109840.htm under Ubuntu
Windows 7 Hard Drive installation Ubuntu 14.10 Graphics Tutorial http://www.linuxidc.com/Linux/2014-10/108430.htm
USB flash drive installs Ubuntu 14.10 http://www.linuxidc.com/Linux/2014-10/108402.htm
Ubuntu 14.10 Official release Download http://www.linuxidc.com/Linux/2014-10/108363.htm
Ubuntu 14.04 LTS How to upgrade to Ubuntu 14.10 Http://www.linuxidc.com/Linux/2014-10/108381.htm
1. Install Eclipse
FFmpeg is written in C, so our eclipse needs to install the CDT. On the internet to find a lot of information on how to install the compilation environment, but there are some problems, after the installation is still unable to establish a C + + project. Pit Daddy is, finally found that this step is simply incomparable, a statement can be done:
sudo apt-get install eclipse ECLIPSE-CDT g++
If the g++ has been installed, it can be omitted from the above command.
Reference: HTTP://STACKOVERFLOW.COM/QUESTIONS/14721514/HOW-TO-INSTALL-ECLIPSE-WITH-C-IN-UBUNTU-12-10
2. New project in Eclipse
After we have completed installing Eclipse CDT, select File->new->makefile Project with Existing Codes.
In the dialog box that pops up, browse to the directory of the FFmpeg that we compiled earlier, and project name will automatically fill it out for us. Then select Linux GCC in the toolchain for indexer settings. Click OK, and the project is now ready to be built.
- Note 1: If FFmpeg was previously compiled in a different directory, you must first build a separate directory in Eclipse's workspace and copy all the contents of the previous directory. If you browse directly to workspace, you will not be able to build the project.
- Note 2: The source code directory does not contain Chinese, otherwise eclipse is not recognized, there will be no source could not debug the situation. The safest way to do this is to copy the FFmpeg source code into Eclipse's workspace to compile and debug it to ensure that it is foolproof.
3. Setting Debug parameters
We found the Ffplay_g file in the source directory--binary directory, right-click, select Debug Configuration:
In the pop-up dialog box, double-click the application, select Debug parameters, such as the file to play:
Then apply at debug, you can start debugging.
By default, the breakpoint stops at the first line of the main function, but now the interface shown is Jiangzi:
What about the source code we want? In fact, do a simple operation can: click on the upper right corner of the debug front button and select C + +, you can see the C code.
Four control keys used during commissioning:
- F5: One-step debugging, the function is encountered inside the function, equivalent to the F11 of VS;
- F6: Single-step debugging, the function is skipped, equivalent to the F10 of VS;
- F7: Single-step debugging, jumping out of the current method, equivalent to the shift+f11 in VS;
- F8: Debug the Run program until the first breakpoint, equivalent to the F5 in vs.
Linux under compile ffmpeg download source files and compile http://www.linuxidc.com/Linux/2012-02/54565.htm
Linux compilation upgrade FFmpeg step http://www.linuxidc.com/Linux/2013-08/88190.htm
Install FFMPEG http://www.linuxidc.com/Linux/2011-09/42793.htm on CentOS 5.6
Install FFmpeg http://www.linuxidc.com/Linux/2012-12/75408.htm under Ubuntu
FFmpeg Details : please click here
FFmpeg : please click here.
For more information about Ubuntu see the Ubuntu feature page http://www.linuxidc.com/topicnews.aspx?tid=2
This article permanently updates the link address : http://www.linuxidc.com/Linux/2014-11/109841.htm
Debugging FFmpeg with Eclipse