File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -192,13 +192,18 @@ void cv::cudacodec::detail::FFmpegVideoSource::updateFormat(const FormatInfo& vi
192
192
193
193
bool cv::cudacodec::detail::FFmpegVideoSource::get (const int propertyId, double & propertyVal) const
194
194
{
195
+ propertyVal = cap.get (propertyId);
196
+ if (propertyVal != 0 .)
197
+ return true ;
198
+
195
199
CV_Assert (videoCaptureParams.size () % 2 == 0 );
196
200
for (std::size_t i = 0 ; i < videoCaptureParams.size (); i += 2 ) {
197
201
if (videoCaptureParams.at (i) == propertyId) {
198
202
propertyVal = videoCaptureParams.at (i + 1 );
199
203
return true ;
200
204
}
201
205
}
206
+
202
207
return false ;
203
208
}
204
209
Original file line number Diff line number Diff line change @@ -430,6 +430,19 @@ CUDA_TEST_P(CheckParams, Reader)
430
430
}
431
431
}
432
432
433
+ CUDA_TEST_P (CheckParams, CaptureProps)
434
+ {
435
+ std::string inputFile = std::string (cvtest::TS::ptr ()->get_data_path ()) + " ../highgui/video/big_buck_bunny.mp4" ;
436
+ cv::Ptr<cv::cudacodec::VideoReader> reader = cv::cudacodec::createVideoReader (inputFile);
437
+ double width, height, fps;
438
+ ASSERT_TRUE (reader->get (cv::VideoCaptureProperties::CAP_PROP_FRAME_WIDTH, width));
439
+ ASSERT_EQ (672 , width);
440
+ ASSERT_TRUE (reader->get (cv::VideoCaptureProperties::CAP_PROP_FRAME_HEIGHT, height));
441
+ ASSERT_EQ (384 , height);
442
+ ASSERT_TRUE (reader->get (cv::VideoCaptureProperties::CAP_PROP_FPS, fps));
443
+ ASSERT_EQ (24 , fps);
444
+ }
445
+
433
446
CUDA_TEST_P (CheckDecodeSurfaces, Reader)
434
447
{
435
448
cv::cuda::setDevice (GET_PARAM (0 ).deviceID ());
@@ -554,6 +567,7 @@ CUDA_TEST_P(TransCode, H264ToH265)
554
567
}
555
568
556
569
INSTANTIATE_TEST_CASE_P (CUDA_Codec, TransCode, ALL_DEVICES);
570
+
557
571
#endif
558
572
559
573
#if defined(HAVE_NVCUVENC)
You can’t perform that action at this time.
0 commit comments