Skip to content

Commit 75e88d6

Browse files
committed
Merge pull request opencv#18185 from VadimLevin:dev/vlevin/ffmpeg-versions-guard-fix
2 parents f5ba3f5 + f7e524c commit 75e88d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/videoio/src/cap_ffmpeg_impl.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,10 @@ bool CvCapture_FFMPEG::open( const char* _filename )
993993
enc->skip_frame = AVDISCARD_DEFAULT;
994994
else if (strcmp(avdiscard_entry->value, "none") == 0)
995995
enc->skip_frame = AVDISCARD_NONE;
996-
#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54, 59, 100)
996+
// NONINTRA flag was introduced with version bump at revision:
997+
// https://github.com/FFmpeg/FFmpeg/commit/b152152df3b778d0a86dcda5d4f5d065b4175a7b
998+
// This key is supported only for FFMPEG version
999+
#if LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(55, 67, 100)
9971000
else if (strcmp(avdiscard_entry->value, "nonintra") == 0)
9981001
enc->skip_frame = AVDISCARD_NONINTRA;
9991002
#endif
@@ -1949,7 +1952,9 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
19491952
// some formats want stream headers to be separate
19501953
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
19511954
{
1952-
#if LIBAVCODEC_BUILD > CALC_FFMPEG_VERSION(56, 35, 0)
1955+
// flags were renamed: https://github.com/libav/libav/commit/7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615
1956+
#if LIBAVCODEC_BUILD >= (LIBAVCODEC_VERSION_MICRO >= 100 \
1957+
? CALC_FFMPEG_VERSION(56, 60, 100) : CALC_FFMPEG_VERSION(56, 35, 0))
19531958
c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
19541959
#else
19551960
c->flags |= CODEC_FLAG_GLOBAL_HEADER;

0 commit comments

Comments
 (0)