Ubuntu Install opencv320 Error: error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope

Modify /opt/opencv/opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp, add the following in the header:

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

Save and recompile.

Similar Posts: