FFMPEG Link error

末鹿安然 提交于 2019-12-01 08:42:09
Rudolfs Bundulis

See this post - most likely when mixing C++ code with the C interface of FFMPEG you forgot the extern "C" keyword so linker is using C++ function name mangling and thus cannot find the references. You should wrap the FFMPEG includes with extern "C" like this:

extern "C" { 
#include <libavcodec/avcodec.h> 
#include <libavformat/avformat.h>
}

The link to FFmpeg site with transcoding example is broken now, but you can find it here: http://ffmpeg.org/doxygen/trunk/doc_2examples_2transcoding_8c-example.html

I think the problem is that the example uses a later version of FFmpeg. I'm using an Android port of FFmpeg 1.0 from https://github.com/appunite/AndroidFFmpeg and I'm also facing the same issues (ie undeclared avfilter_graph_parse_ptr). My FFmpeg source code does not have it but declares avfilter_graph_parse instead.

My source code desn't have transcoding example, I think doc/examples/decoding_encoding.c should be used instead.

I changed code to use old functions, for example av_frame_free -> avcodec_free_frame, av_buffersrc_write_frame_flags -> av_buffersrc_write_frame and so on, now it at least compiles...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!