@@ -280,15 +280,11 @@ CUDA_TEST_P(DisplayResolution, Reader)
280280CUDA_TEST_P (Video, Reader)
281281{
282282 cv::cuda::setDevice (GET_PARAM (0 ).deviceID ());
283+ const std::string relativeFilePath = GET_PARAM (1 );
283284
284285 // CUDA demuxer has to fall back to ffmpeg to process "cv/video/768x576.avi"
285- if (GET_PARAM (1 ) == " cv/video/768x576.avi" && !videoio_registry::hasBackend (CAP_FFMPEG))
286- throw SkipTestException (" FFmpeg backend not found" );
287-
288- #ifdef _WIN32 // handle old FFmpeg backend
289- if (GET_PARAM (1 ) == " /cv/tracking/faceocc2/data/faceocc2.webm" )
290- throw SkipTestException (" Feature not yet supported by Windows FFmpeg shared library!" );
291- #endif
286+ if (relativeFilePath == " cv/video/768x576.avi" && !videoio_registry::hasBackend (CAP_FFMPEG))
287+ throw SkipTestException (" FFmpeg backend not found - SKIP" );
292288
293289 const std::vector<std::pair< cudacodec::ColorFormat, int >> formatsToChannels = {
294290 {cudacodec::ColorFormat::GRAY,1 },
@@ -297,8 +293,15 @@ CUDA_TEST_P(Video, Reader)
297293 {cudacodec::ColorFormat::NV_NV12,1 }
298294 };
299295
300- std::string inputFile = std::string (cvtest::TS::ptr ()->get_data_path ()) + " ../" + GET_PARAM (1 );
301- cv::Ptr<cv::cudacodec::VideoReader> reader = cv::cudacodec::createVideoReader (inputFile);
296+ std::string inputFile = std::string (cvtest::TS::ptr ()->get_data_path ()) + " ../" + relativeFilePath;
297+ cv::Ptr<cv::cudacodec::VideoReader> reader;
298+ try {
299+ reader = cv::cudacodec::createVideoReader (inputFile);
300+ }
301+ catch (const Exception& e) {
302+ ASSERT_TRUE (relativeFilePath == " highgui/video/sample_322x242_15frames.yuv420p.libaom-av1.mp4" );
303+ throw SkipTestException (" AV1 decoding not supported in this version of FFmpeg - SKIP" );
304+ }
302305 ASSERT_FALSE (reader->set (cudacodec::ColorFormat::RGB));
303306 cv::cudacodec::FormatInfo fmt = reader->format ();
304307 cv::cuda::GpuMat frame;
@@ -837,13 +840,18 @@ INSTANTIATE_TEST_CASE_P(CUDA_Codec, Scaling, testing::Combine(
837840
838841INSTANTIATE_TEST_CASE_P (CUDA_Codec, DisplayResolution, ALL_DEVICES);
839842
840- #define VIDEO_SRC_R " highgui/video/big_buck_bunny.mp4" , " cv/video/768x576.avi" , " cv/video/1920x1080.avi" , " highgui/video/big_buck_bunny.avi" , \
843+ #ifdef _WIN32 // handle old FFmpeg backend - remove when windows shared library is updated
844+ #define VIDEO_SRC_R testing::Values (" highgui/video/big_buck_bunny.mp4" , " cv/video/768x576.avi" , " cv/video/1920x1080.avi" , " highgui/video/big_buck_bunny.avi" , \
841845 " highgui/video/big_buck_bunny.h264" , " highgui/video/big_buck_bunny.h265" , " highgui/video/big_buck_bunny.mpg" , \
842846 " highgui/video/sample_322x242_15frames.yuv420p.libvpx-vp9.mp4" , " highgui/video/sample_322x242_15frames.yuv420p.libaom-av1.mp4" , \
843- " cv/tracking/faceocc2/data/faceocc2.webm"
844- INSTANTIATE_TEST_CASE_P (CUDA_Codec, Video, testing::Combine(
845- ALL_DEVICES,
846- testing::Values (VIDEO_SRC_R)));
847+ " cv/tracking/faceocc2/data/faceocc2.webm" )
848+ #else
849+ #define VIDEO_SRC_R testing::Values (" highgui/video/big_buck_bunny.mp4" , " cv/video/768x576.avi" , " cv/video/1920x1080.avi" , " highgui/video/big_buck_bunny.avi" , \
850+ " highgui/video/big_buck_bunny.h264" , " highgui/video/big_buck_bunny.h265" , " highgui/video/big_buck_bunny.mpg" , \
851+ " highgui/video/sample_322x242_15frames.yuv420p.libvpx-vp9.mp4" , " highgui/video/sample_322x242_15frames.yuv420p.libaom-av1.mp4" , \
852+ " cv/tracking/faceocc2/data/faceocc2.webm" , " highgui/video/sample_322x242_15frames.yuv420p.mpeg2video.mp4" , " highgui/video/sample_322x242_15frames.yuv420p.mjpeg.mp4" )
853+ #endif
854+ INSTANTIATE_TEST_CASE_P (CUDA_Codec, Video, testing::Combine(ALL_DEVICES,VIDEO_SRC_R));
847855
848856const color_conversion_params_t color_conversion_params[] =
849857{
@@ -878,9 +886,11 @@ INSTANTIATE_TEST_CASE_P(CUDA_Codec, CheckExtraData, testing::Combine(
878886 ALL_DEVICES,
879887 testing::ValuesIn (check_extra_data_params)));
880888
889+ #define VIDEO_SRC_KEY " highgui/video/big_buck_bunny.mp4" , " cv/video/768x576.avi" , " cv/video/1920x1080.avi" , " highgui/video/big_buck_bunny.avi" , \
890+ " highgui/video/big_buck_bunny.h264" , " highgui/video/big_buck_bunny.h265" , " highgui/video/big_buck_bunny.mpg"
881891INSTANTIATE_TEST_CASE_P (CUDA_Codec, CheckKeyFrame, testing::Combine(
882892 ALL_DEVICES,
883- testing::Values (VIDEO_SRC_R )));
893+ testing::Values (VIDEO_SRC_KEY )));
884894
885895INSTANTIATE_TEST_CASE_P (CUDA_Codec, CheckParams, ALL_DEVICES);
886896
0 commit comments