Advertisement
angelosalatino

FFMPEG and QT Creator

Jan 15th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.06 KB | None | 0 0
  1. 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:
  2.  
  3. INCLUDEPATH += /usr/local/include/libavcodec \
  4.                 /usr/local/include/libavdevice \
  5.                 /usr/local/include/libavutil \
  6.                 /usr/local/include/libavfilter \
  7.                 /usr/local/include/libavformat \
  8.                 /usr/local/include/libswscale \
  9.                 /usr/local/include/libpostproc \
  10.                 /usr/local/include/libswresample \
  11.  
  12.  
  13.  
  14. LIBS += /usr/local/lib/libavcodec.a \
  15. /usr/local/lib/libavdevice.a \
  16. /usr/local/lib/libavfilter.a \
  17. /usr/local/lib/libavformat.a \
  18. /usr/local/lib/libavutil.a \
  19. /usr/local/lib/libmp3lame.a \
  20. /usr/local/lib/libpostproc.a \
  21. /usr/local/lib/libswresample.a \
  22. /usr/local/lib/libswscale.a \
  23. /usr/local/lib/libvpx.a \
  24. /usr/local/lib/libx264.a \
  25. /usr/local/lib/libyasm.a \
  26.  
  27. I've tried a lot of way to set the above parameters, but it is stilling give me the same error. The error is:
  28. /home/doctor/ffmpegprova/main.cpp:31: undefined reference to `avcodec_register_all()'
  29.  
  30. 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.
  31. The code that I've tried is the following:
  32. #include <libavutil/opt.h>
  33. #include <libavcodec/avcodec.h>
  34. #include <libavutil/channel_layout.h>
  35. #include <libavutil/common.h>
  36. #include <libavutil/imgutils.h>
  37. #include <libavutil/mathematics.h>
  38. #include <libavutil/samplefmt.h>
  39.  
  40. #include <QtGui/QApplication>
  41. #include "mainwindow.h"
  42.  
  43. int main(int argc, char *argv[])
  44. {
  45.    /* register all the codecs */
  46.     avcodec_register_all(); //<---this function gives the error
  47.  
  48.    QApplication a(argc, argv);
  49.    MainWindow w;
  50.    w.show();
  51.    return a.exec();
  52. }
  53.  
  54.  
  55. What I have to write inside .pro file? Thank you in advance.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement