diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp index 0317831d3ac3fa97aef336798c80e5813aa82680..af262189419f5980aab3f8bc3329607d56bc888d 100644 --- a/modules/videoio/src/cap_ffmpeg_impl.hpp +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp @@ -1587,6 +1587,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/videoio/test/test_ffmpeg.cpp b/modules/videoio/test/test_ffmpeg.cpp index 07bb0b739129c0715b663545e99df472bce0eca9..c5e326a86ade9cd16838a1e37546af3ad5306942 100644 --- a/modules/videoio/test/test_ffmpeg.cpp +++ b/modules/videoio/test/test_ffmpeg.cpp @@ -357,6 +357,8 @@ public: for (unsigned int i = 0; i < frameCount && next; ++i) { + SCOPED_TRACE(cv::format("frame=%d", (int)frameCount)); + Mat actual; (*capture) >> actual;