FFmpeg understanding (4. How to compile and run testing files utilizing FFMPEG in VC ?)

Source: Internet
Author: User

4. How to compile and run testing files
Utilizing FFMPEG in VC?

1. Create a new console application
("File/New/Project") and then select "Win32 Console
Application ". On the appropriate page of the Application Wizard, uncheck
The "precompiled headers" option.

2. Write the source code for your
Application, or, for testing, just copy the code from an existing sample
Application into the source file that VC has already created for you.
Example, you can copy 'output _ example. c' from the FFMPEG distribution.

3. Open the "Project/properties"
Dialog Box. In the "configuration" combo box, select "All
Deployments "so that the changes you make will affect both Debug and
Release builds. In the Tree View on the left hand side, select "C/C ++/
General ", then edit the" Additional include directories "setting
To contain the path where the FFmpeg is installed. Please refer Figure 4-1, and
The "C:/source code/FFMPEG" is used in this instance.


Figure
4-1 additional include directories

4. Still in the "Project/
Properties "dialog box, select" linker/General "from the tree
View and edit the "additional library directories" setting to contain
The 'lib' directory where FFMPEG was installed (referring Figure 4-2). Then
Select "linker/input" from the tree view, and add the files 'avcodec-52.lib
Avdevice-52.lib avformat-52.lib avutil-49.lib 'to the end of "Additional
Dependencies ". Please refer to Figure 4-3.


Figure
4-2 additional library Directories


Figure
4-3 additional dependencies

5. Now, select "C/C ++/code
Generation "from the tree view. Select" debug "in
"Configuration" combo box. Make sure that "Runtime Library"
Is set to "multi-threaded debug DLL". Then, select
"Release" in the "configuration" combo box and make sure
That "Runtime Library" is set to "multi-threaded DLL ".

6. Click "OK" to close
"Project/properties" dialog box.

7. VC lacks some c99 header files that are
Fundamental for FFMPEG. Get msinttypes from msinttypes-r21.zip
And extract it in VC's include directory (I. e. 'C:/program files/Microsoft
Visual Studio 8/VC/include ').

8. VC also does not understand the inline
Keyword used by FFMPEG, so you must add this line before # includeing libav *.
Moreover, some functions, such as snprintf etc, must be added' _ 'before initial
Character. For instance, changing snprintf to _ snprintf.

# Define inline _ inline

9. Compile the testing files and copy
'Avcodec-52.dll avdevice-52.dll avformat-52.dll avutil-49.dll 'into folder
Encapsulating executable file after building completely, and then run it.

 

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.