I’m trying to compile this example
on Ubunto. This is the compile command:
g++ video.cpp -o video `pkg-config --cflags opencv` `pkg-config --libs opencv` -lpthread -lavutil -lavformat -lavcodec -lz
and this is the errors I’m getting:
/usr/local/include/libavutil/common.h:173:47: error: ‘UINT64_C’ was not declared in this scope
video.cpp: In member function ‘int FFread::init(char*)’:
video.cpp:24:56: error: ‘av_open_input_file’ was not declared in this scope
video.cpp:28:5: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1266) [-Wdeprecated-declarations]
video.cpp:28:35: warning: ‘int av_find_stream_info(AVFormatContext*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1266) [-Wdeprecated-declarations]
video.cpp:32:36: error: ‘dump_format’ was not declared in this scope
video.cpp:37:48: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
Please advise.
Thanks,
Nahum
You are calling FFmpeg libraries from a C++ program. Are you wrapping the #include calls to the relevant headers in
constructs? The headers don’t have automatic C++ support.
EDIT:
I read the linked example source; it does the right thing.
I think the problem is version discrepancy. The example is over 2 years old and the FFmpeg APIs have moved on. You may have to upgrade the API calls on your own.