void CV_HighGuiTest::SpecificVideoFileTest(const string& dir, const char codecchars[4])
{
- const string ext[] = {"avi", "mov", "mp4"/*, "mpg", "wmv"*/};
+ const string ext[] = {"avi", "mov", "mp4", "mpg", "wmv"};
const size_t n = sizeof(ext)/sizeof(ext[0]);
- for (size_t j = 0; j < n; ++j) if ((ext[j]!="mp4")||(string(&codecchars[0], 4)!="IYUV"))
+ for (size_t j = 0; j < n; ++j)
+ if ((ext[j]!="mp4")||(string(&codecchars[0], 4)!="IYUV"))
+ #if defined WIN32 || defined _WIN32
+ if (((ext[j]!="mov")||(string(&codecchars[0], 4)=="XVID"))&&(ext[j]!="mp4"))
+ #endif
{
const string video_file = dir + "video_" + string(&codecchars[0], 4) + "." + ext[j];
if (psnr > thresDbell)
{
ts->printf(ts->LOG, "\nReading frame from the file video_%s.%s...\n", string(&codecchars[0], 4).c_str(), ext[j].c_str());
+ ts->printf(ts->LOG, "Frame index: %d\n", i+1);
ts->printf(ts->LOG, "Difference between saved and original images: %g\n", psnr);
ts->printf(ts->LOG, "Maximum allowed difference: %g", thresDbell);
ts->printf(ts->LOG, "Error: too big difference between saved and original images.\n");
void CV_HighGuiTest::SpecificVideoCameraTest(const string& dir, const char codecchars[4])
{
- const string ext[] = {"avi", "mov", "mp4"/*, "mpg", "wmv"*/};
+ const string ext[] = {"avi", "mov", "mp4", "mpg", "wmv"};
const size_t n = sizeof(ext)/sizeof(ext[0]);
return;
}
- for (size_t i = 0; i < n; ++i) if ((ext[i]!="mp4")||(string(&codecchars[0], 4)!="IYUV"))
+ for (size_t i = 0; i < n; ++i)
+ if ((ext[i]!="mp4")||(string(&codecchars[0], 4)!="IYUV"))
+ #if defined WIN32 || defined _WIN32
+ if (((ext[i]!="mov")||(string(&codecchars[0], 4)=="XVID"))&&(ext[i]!="mp4"))
+ #endif
{
Mat frame; int framecount = 0;
cv::VideoWriter writer;
if (psnr > thresDbell)
{
ts->printf(ts->LOG, "\nReading frame from the file video_%s.%s...\n", string(&codecchars[0], 4).c_str(), ext[i].c_str());
+ ts->printf(ts->LOG, "Frame index: %d\n", framecount);
ts->printf(ts->LOG, "Difference between saved and original images: %g\n", psnr);
ts->printf(ts->LOG, "Maximum allowed difference: %g", thresDbell);
ts->printf(ts->LOG, "Error: too big difference between saved and original images.\n");