i have 2 machines ubuntu 12.04.2 lts (64 mb) , other snow leopard os. in mac work ffmpeg without trouble try use ffmpeg in ubuntu , 6700 (!) errors appear:
error: undefined reference `av_freep' error: undefined reference `av_strstart' error: undefined reference `av_freep' ... i use qt 4.8.5 , g++ x86 64b installed ffmpeg following http://ffmpeg.org/trac/ffmpeg/wiki/ubuntucompilationguide without errors or warnings.
my test code is:
.h
qt += core gui includepath += \ /usr/local/include libs += /usr/local/lib/libavcodec.a libs += /usr/local/lib/libavutil.a libs += /usr/local/lib/libavformat.a libs += /usr/local/lib/libswscale.a sources += main.cpp .cpp:
extern "c" { #ifndef __stdc_constant_macros # define __stdc_constant_macros #endif #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" } #include <stdio.h> int main() { avformatcontext *pformatctx; av_register_all(); const char* fil = "/home/cits/desktop/movfile.mov"; if(avformat_open_input(&pformatctx, fil, null, null)!=0) { return -1; // couldn't open file } if(avformat_find_stream_info(pformatctx, null)<0) { return -1; // couldn't find stream information } return 0; } any ideas??
thanks in advance.
your .pro file should read like:
qt += core gui includepath += \ /usr/local/include libs += -l/usr/local/lib/ -llibavcodec -llibavutil -llibavformat -llibswscale sources += main.cpp
Comments
Post a Comment