Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi, guys! I'm trying to use FFMPEG libraries on Qt Creator. I've followed the procedure to install the libraries on my Ubuntu (http://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideLucid). Now, what I want to do, is to include these libraries on my own project with Qt Creator. I've tried to modify the .pro file as the following:
- INCLUDEPATH += /usr/local/include/libavcodec \
- /usr/local/include/libavdevice \
- /usr/local/include/libavutil \
- /usr/local/include/libavfilter \
- /usr/local/include/libavformat \
- /usr/local/include/libswscale \
- /usr/local/include/libpostproc \
- /usr/local/include/libswresample \
- LIBS += /usr/local/lib/libavcodec.a \
- /usr/local/lib/libavdevice.a \
- /usr/local/lib/libavfilter.a \
- /usr/local/lib/libavformat.a \
- /usr/local/lib/libavutil.a \
- /usr/local/lib/libmp3lame.a \
- /usr/local/lib/libpostproc.a \
- /usr/local/lib/libswresample.a \
- /usr/local/lib/libswscale.a \
- /usr/local/lib/libvpx.a \
- /usr/local/lib/libx264.a \
- /usr/local/lib/libyasm.a \
- I've tried a lot of way to set the above parameters, but it is stilling give me the same error. The error is:
- /home/doctor/ffmpegprova/main.cpp:31: undefined reference to `avcodec_register_all()'
- This error comes up when I try to call one function inside the libraries, when I comment all the functions inside the libraries, then the error goes away.
- The code that I've tried is the following:
- #include <libavutil/opt.h>
- #include <libavcodec/avcodec.h>
- #include <libavutil/channel_layout.h>
- #include <libavutil/common.h>
- #include <libavutil/imgutils.h>
- #include <libavutil/mathematics.h>
- #include <libavutil/samplefmt.h>
- #include <QtGui/QApplication>
- #include "mainwindow.h"
- int main(int argc, char *argv[])
- {
- /* register all the codecs */
- avcodec_register_all(); //<---this function gives the error
- QApplication a(argc, argv);
- MainWindow w;
- w.show();
- return a.exec();
- }
- What I have to write inside .pro file? Thank you in advance.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement