tags:

views:

506

answers:

2

Hi.

I want to include the libavcodec in my Qt-project. Should I do that with

#include <ffmpeg/libavcodec.h>

or with something more Qt, for example

QLibrary mylib("libavcodec");

And also a question to understand if I really got it: To use libavcodec, do I need to import the source-files or the .dll?

+1  A: 

You should use libavcodec like any other library. That is, include it's headers and link against it's import library. If you are using qmake, you will need to modify the INCLUDEPATH and LIBS variables, see the documentation for some examples.

The QLibrary option is only useful for DLLs that you want to load at run-time (e.g. plugins).

Lukáš Lalinský
A: 

To compile Youre going to want to include
the FFMPEG header paths,
the FFMPEG library paths,
link against the avcodec.lib avformat.lib avdevice.lib avutil.lib files (or whatever your versions are called)

Then at runtime make sure the libraries avcodec.dll avformat.dll avdevice.dll avutil.dll (or whatever your versions are called) are in the same directory or the path.

Vicken Simonian