解决方法:
vi /etc/ld.so.conf
//加入ffmpeg的 库路径
加入一行:/usr/local/ffmpeg/lib
然后执行 ldconfig
2、eclipse 中加入运行库、和头文件 。
//头文件
/usr/local/ffmpeg/include
//库路径
/usr/local/ffmpeg/lib
//以下是库名称
avcodec avformat swscale avdevice avfilter avutil swresample
3、宏添加 C++ 应用的时候
///// 在这个 头文件中添加宏#include <libavutil/common.h>
/*
#ifndef UINT64_C(val)
#define UINT64_C(val) val ##ULL
#endif
*/
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
4、更改代码添加(AVCodecID)
codec = avcodec_find_encoder((AVCodecID)codec_id);
5、C运行方式 添加头文件
extern "C"{
#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 <math.h>
}