See summary. Reproducible: Always
Created attachment 530058 [details] build log Relevant part of compiler output
Created attachment 532102 [details, diff] opencv-3.3.0-ffmpeg-4.0-compatibility.patch Here is a patch fixing the build with >=media-video/ffmpeg-4.0. It *should* also work with <media-video/ffmpeg-4.0, but I didn't check.
The first hunk of the patch is both wrong and unneeded: The defines are not part of libavformat but libavcodec, AV_CODEC_FLAG_GLOBAL_HEADER was added in FFmpeg 2.8, AV_PKT_FLAG_KEY in FFmpeg 0.9.
ping
(In reply to Andreas Sturmlechner from comment #4) > ping Should be fine in 3.4.1?
(In reply to Amy Liffey from comment #5) > Should be fine in 3.4.1? Correct! Built fine with 3.4.1-r4.