1 #include "perf_precomp.hpp"
3 #if BUILD_WITH_VIDEO_OUTPUT_SUPPORT
8 using std::tr1::make_tuple;
11 typedef std::tr1::tuple<String, bool> VideoWriter_Writing_t;
12 typedef perf::TestBaseWithParam<VideoWriter_Writing_t> VideoWriter_Writing;
14 PERF_TEST_P(VideoWriter_Writing, WriteFrame,
15 testing::Combine( testing::Values( "python/images/QCIF_00.bmp",
16 "python/images/QCIF_01.bmp",
17 "python/images/QCIF_02.bmp",
18 "python/images/QCIF_03.bmp",
19 "python/images/QCIF_04.bmp",
20 "python/images/QCIF_05.bmp" ),
23 string filename = getDataPath(get<0>(GetParam()));
24 bool isColor = get<1>(GetParam());
25 Mat image = imread(filename, 1);
26 #if defined(HAVE_MSMF) && !defined(HAVE_VFW) && !defined(HAVE_FFMPEG) // VFW has greater priority
27 VideoWriter writer(cv::tempfile(".wmv"), CV_FOURCC('W', 'M', 'V', '3'),
28 25, cv::Size(image.cols, image.rows), isColor);
30 VideoWriter writer(cv::tempfile(".avi"), CV_FOURCC('X', 'V', 'I', 'D'),
31 25, cv::Size(image.cols, image.rows), isColor);
34 TEST_CYCLE() { image = imread(filename, 1); writer << image; }
36 bool dummy = writer.isOpened();
40 #endif // BUILD_WITH_VIDEO_OUTPUT_SUPPORT