error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope; did you mean ‘AV_CODEC_FLAG_GLOBAL

1-树莓派编译opencv3.2.0报错
error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope; did you mean ‘AV_CODEC_FLAG_GLOBAL_第1张图片
2-错误原因:缺少几个关键的宏定义
3-解决方法
在相应头文件中添加宏定义即可,如图可以看到是cap_ffmpeg_impl.hpp

opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp

中添加

#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
#define AVFMT_RAWPICTURE 0x0020

你可能感兴趣的:(BUG,opencv)