From b361209d527171b8bc160d54f42989b92536bcdb Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sun, 25 Dec 2022 18:55:19 +0000 Subject: [PATCH 1/2] ffmpeg/4.x: update FFmpeg wrapper 2022.12 - FFmpeg 4.4.3 --- 3rdparty/ffmpeg/ffmpeg.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/3rdparty/ffmpeg/ffmpeg.cmake b/3rdparty/ffmpeg/ffmpeg.cmake index dabab5911f..f3ad63770a 100644 --- a/3rdparty/ffmpeg/ffmpeg.cmake +++ b/3rdparty/ffmpeg/ffmpeg.cmake @@ -1,8 +1,8 @@ -# Binaries branch name: ffmpeg/4.x_20220912 -# Binaries were created for OpenCV: 4154bd06677c30475e2545cbee05906dd9a367cb -ocv_update(FFMPEG_BINARIES_COMMIT "524023e38e27649d4f5ce97d57ceb8864c838fb6") -ocv_update(FFMPEG_FILE_HASH_BIN32 "88f87420899e07151b682a76e30d3e01") -ocv_update(FFMPEG_FILE_HASH_BIN64 "81b1e1e9fd2a10f4ec7b239c743240fe") +# Binaries branch name: ffmpeg/4.x_20221225 +# Binaries were created for OpenCV: 4abe6dc48d4ec6229f332cc6cf6c7e234ac8027e +ocv_update(FFMPEG_BINARIES_COMMIT "7dd0d4f1d6fe75f05f3d3b5e38cbc96c1a2d2809") +ocv_update(FFMPEG_FILE_HASH_BIN32 "e598ae2ece1ddf310bc49b58202fd87a") +ocv_update(FFMPEG_FILE_HASH_BIN64 "b2a40c142c20aef9fd663fc8f85c2971") ocv_update(FFMPEG_FILE_HASH_CMAKE "8862c87496e2e8c375965e1277dee1c7") function(download_win_ffmpeg script_var) From dbd4a0e5e685a415095cb899a6d1f10279c7fbc1 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 26 Dec 2022 02:32:11 +0000 Subject: [PATCH 2/2] videoio(ffmpeg): update tests with new Windows wrapper --- modules/videoio/test/test_ffmpeg.cpp | 31 -------------------------- modules/videoio/test/test_video_io.cpp | 4 ---- 2 files changed, 35 deletions(-) diff --git a/modules/videoio/test/test_ffmpeg.cpp b/modules/videoio/test/test_ffmpeg.cpp index dcd5b86517..906b215ab4 100644 --- a/modules/videoio/test/test_ffmpeg.cpp +++ b/modules/videoio/test/test_ffmpeg.cpp @@ -392,27 +392,6 @@ typedef std::vector cap_properties_t; typedef std::pair ffmpeg_cap_properties_param_t; typedef testing::TestWithParam ffmpeg_cap_properties; -#ifdef _WIN32 -namespace { -::testing::AssertionResult IsOneOf(double value, double expected1, double expected2) -{ - // internal floating point class is used to perform accurate floating point types comparison - typedef ::testing::internal::FloatingPoint FloatingPoint; - - FloatingPoint val(value); - if (val.AlmostEquals(FloatingPoint(expected1)) || val.AlmostEquals(FloatingPoint(expected2))) - { - return ::testing::AssertionSuccess(); - } - else - { - return ::testing::AssertionFailure() - << value << " is neither equal to " << expected1 << " nor " << expected2; - } -} -} -#endif - TEST_P(ffmpeg_cap_properties, can_read_property) { if (!videoio_registry::hasBackend(CAP_FFMPEG)) @@ -429,13 +408,8 @@ TEST_P(ffmpeg_cap_properties, can_read_property) { const cap_property_t& prop = properties[i]; const double actualValue = cap.get(static_cast(prop.first)); - #ifndef _WIN32 EXPECT_DOUBLE_EQ(actualValue, prop.second) << "Property " << static_cast(prop.first) << " has wrong value"; - #else - EXPECT_TRUE(IsOneOf(actualValue, prop.second, 0.0)) - << "Property " << static_cast(prop.first) << " has wrong value"; - #endif } } @@ -588,11 +562,6 @@ TEST_P(videoio_ffmpeg_16bit, basic) const double time_sec = 1; const int numFrames = static_cast(fps * time_sec); -#ifdef _WIN32 // TODO: FFmpeg wrapper update - if (isSupported) - throw SkipTestException("FFmpeg wrapper update is required"); -#endif - { VideoWriter writer; writer.open(filename, CAP_FFMPEG, fourcc, fps, sz, diff --git a/modules/videoio/test/test_video_io.cpp b/modules/videoio/test/test_video_io.cpp index 63f48fbf9b..595e1557ef 100644 --- a/modules/videoio/test/test_video_io.cpp +++ b/modules/videoio/test/test_video_io.cpp @@ -228,13 +228,9 @@ public: EXPECT_EQ(frame_count, 125); Mat img; -#ifdef _WIN32 // handle old FFmpeg wrapper on Windows till rebuild - frame_count = 10; -#else // HACK: FFmpeg reports picture_pts = AV_NOPTS_VALUE_ for the last frame for AVI container by some reason if ((ext == "avi") && (apiPref == CAP_FFMPEG)) frame_count--; -#endif for (int i = 0; i < frame_count; i++) {