diff --git a/modules/highgui/src/cap_ffmpeg_impl.hpp b/modules/highgui/src/cap_ffmpeg_impl.hpp index 5a8dec9b46..1d8f153a62 100644 --- a/modules/highgui/src/cap_ffmpeg_impl.hpp +++ b/modules/highgui/src/cap_ffmpeg_impl.hpp @@ -1496,6 +1496,9 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc, #if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(52, 42, 0) st->avg_frame_rate = (AVRational){frame_rate, frame_rate_base}; #endif +#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(55, 20, 0) + st->time_base = c->time_base; +#endif return st; } diff --git a/modules/highgui/test/test_ffmpeg.cpp b/modules/highgui/test/test_ffmpeg.cpp index 31108f857c..4e14ba4e41 100644 --- a/modules/highgui/test/test_ffmpeg.cpp +++ b/modules/highgui/test/test_ffmpeg.cpp @@ -320,6 +320,7 @@ public: for (unsigned int i = 0; i < frameCount && next; ++i) { + SCOPED_TRACE(cv::format("frame=%d", (int)i)); Mat actual; (*capture) >> actual;