Click here to Skip to main content
Click here to Skip to main content

Using FFMpeg in the Microsoft Visual C++ Environment

, 28 Jan 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
Integrate the FFMpeg library into your Visual C++ project.

Sample Image - ffmpeglogo.jpg


FFMpeg is a free video library that can record and convert audio and video data. FFMpeg is under GNU Lesser General Public License, but FFMpeg also uses some third party library which maybe under GNU General Public License. So before using FFMpeg library, you'd better spend some time on the license.

FFMpeg includes the following libraries:

  • libavcodec: All of the video and audio encoders and decoders.
  • libavformat: Demuxers and muxers for audio and video formats.
  • libavutil: Useful utils of FFMpeg.

Get FFMpeg Source Code

There are no formal releases of FFMpeg; however, you can get the FFMpeg source code on a daily basis.


For example, you can checkout the source code using TortoiseSVN,

Checkout FFMpeg Source Code

Compiling FFMpeg

FFmpeg is developed under Linux, but it can be compiled under most Operating Systems.

For Windows, FFMpeg can be compiled with MSYS and MingGW. If you have setup MSYS and MingGW systems correctly, you can compile FFMpeg under its folder.

  1. Cleanup former build results.
  2. make distclean
  3. Setup build parameters.
  4. ./configure --enable-shared --disable-static --enable-memalign-hack

    If there are no errors, and config.mak and config.h were generated, you can build the library, and then, if you want, you can install them into the MSYS environment.

    make install

Using FFMpeg in Your Visual C++ Environment

  1. Create inttypes.h and stdint.h if you don't have them. Provided in the above link is a copy of these two files. You can get them from another place if you want.
  2. Set up additional include directories and additional library directories. By default, these folders are under your MSYS folder, for example:
  3. /usr/local/include
  4. Add FFmpeg's shared libraries, including libavutil.lib, libavcodec.lib, and libavformat.lib.
  5. Include the FFMpeg header:
  6. #include <ffmpeg/avformat.h>
    #include <ffmpeg/avcodec.h>

Using the FFMpeg code

There is an example within FFMpeg, output_example.c. But if you have copied code from this example, following tips may ensure you compile successfully.

  1. Add the required casts.
  2. Change snprintf to _snprintf.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
Australia Australia
No Biography provided

Comments and Discussions

GeneralMy vote of 1 Pinmemberjshaa6-Jan-11 3:44 
not enough
GeneralThe procedure entry point url_fclose could not be located in the dynamic link library avcodec-52.dll exception Pinmemberndquangr9-Nov-10 17:29 
GeneralRe: The procedure entry point url_fclose could not be located in the dynamic link library avcodec-52.dll exception Pinmemberllllskywalker13-Jun-11 13:10 
GeneralVideo Encoding with FFMPEG using avcodec PinmemberGPUToaster4-Jul-10 2:19 
GeneralUsing FFmpeg article Pinmembersoft_support30-Mar-10 13:56 
GeneralRe: Using FFmpeg article Pinmemberlsyueh25-Oct-10 17:05 
Generalno lib files PinmemberAyman Alterawi17-Jan-10 7:41 
GeneralRe: no lib files PinmemberMember 9800116-Mar-10 10:03 
GeneralRe: no lib files PinmemberAyman Alterawi16-Mar-10 10:14 
GeneralRe: no lib files - Instructions for Generating the dynamic libs from dll files. PinmemberQuickshot17-Mar-10 6:39 
GeneralRe: no lib files - main.cpp file that this was tested and verified with. PinmemberQuickshot17-Mar-10 11:48 
GeneralRe: no lib files - swscale lib and configure command PinmemberQuickshot17-Mar-10 11:53 
GeneralRe: no lib files PinmemberJaydeepB17-Mar-10 14:11 
QuestionHow to convert .wma format data to mp3 format, on the fly? Pinmembersemaphore125-Dec-09 0:10 
GeneralLink error Pinmembermetalmonkey16-Jun-09 14:53 
GeneralRe: Link error Pinmembermetalmonkey16-Jun-09 18:15 
GeneralMy vote of 1 Pinmembersquibman25-Mar-09 12:52 
AnswerRe: My vote of 1 Pinmembersquibman26-Mar-09 12:40 
GeneralRe: My vote of 1 PinmemberRajaManikandan_R16-Sep-10 18:38 
Generalexecute configure PinmemberJlkBrgr24-Jul-08 0:32 
GeneralRe: execute configure PinmemberJlkBrgr24-Jul-08 0:56 
GeneralRe: execute configure Pinmembersquibman26-Mar-09 12:48 
QuestionIs it possible to compile the ffmpeg under VC++? PinmemberShuang. Wu22-Jun-08 19:21 
AnswerRe: Is it possible to compile the ffmpeg under VC++? PinmemberRajaManikandan_R16-Sep-10 19:09 
Generalask about the features in this project Pinmembermulyky1-Dec-07 19:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150327.1 | Last Updated 28 Jan 2007
Article Copyright 2007 by Denny50
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid