mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.5 KiB
41 lines
1.5 KiB
13 years ago
|
#include "perf_precomp.hpp"
|
||
|
|
||
12 years ago
|
#if BUILD_WITH_VIDEO_OUTPUT_SUPPORT
|
||
|
|
||
13 years ago
|
using namespace std;
|
||
|
using namespace cv;
|
||
|
using namespace perf;
|
||
|
using std::tr1::make_tuple;
|
||
|
using std::tr1::get;
|
||
|
|
||
12 years ago
|
typedef std::tr1::tuple<std::string, bool> VideoWriter_Writing_t;
|
||
13 years ago
|
typedef perf::TestBaseWithParam<VideoWriter_Writing_t> VideoWriter_Writing;
|
||
|
|
||
|
PERF_TEST_P(VideoWriter_Writing, WriteFrame,
|
||
|
testing::Combine( testing::Values( "python/images/QCIF_00.bmp",
|
||
|
"python/images/QCIF_01.bmp",
|
||
|
"python/images/QCIF_02.bmp",
|
||
|
"python/images/QCIF_03.bmp",
|
||
|
"python/images/QCIF_04.bmp",
|
||
|
"python/images/QCIF_05.bmp" ),
|
||
|
testing::Bool()))
|
||
|
{
|
||
|
string filename = getDataPath(get<0>(GetParam()));
|
||
|
bool isColor = get<1>(GetParam());
|
||
12 years ago
|
Mat image = imread(filename, 1);
|
||
|
#if defined(HAVE_MSMF) && !defined(HAVE_VFW) && !defined(HAVE_FFMPEG) // VFW has greater priority
|
||
12 years ago
|
VideoWriter writer(cv::tempfile(".wmv"), VideoWriter::fourcc('W', 'M', 'V', '3'),
|
||
12 years ago
|
25, cv::Size(image.cols, image.rows), isColor);
|
||
|
#else
|
||
12 years ago
|
VideoWriter writer(cv::tempfile(".avi"), VideoWriter::fourcc('X', 'V', 'I', 'D'),
|
||
12 years ago
|
25, cv::Size(image.cols, image.rows), isColor);
|
||
|
#endif
|
||
13 years ago
|
|
||
12 years ago
|
TEST_CYCLE() { image = imread(filename, 1); writer << image; }
|
||
13 years ago
|
|
||
12 years ago
|
bool dummy = writer.isOpened();
|
||
|
SANITY_CHECK(dummy);
|
||
13 years ago
|
}
|
||
12 years ago
|
|
||
12 years ago
|
#endif // BUILD_WITH_VIDEO_OUTPUT_SUPPORT
|