Commit b6393531 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #3912 from kalistratovag:mjpeg_dec

parents c094c58b 740ae358
......@@ -552,6 +552,20 @@ static Ptr<IVideoCapture> IVideoCapture_create(int index)
}
static Ptr<IVideoCapture> IVideoCapture_create(const String& filename)
{
Ptr<IVideoCapture> capture;
capture = createMotionJpegCapture(filename);
if (capture && capture->isOpened())
{
return capture;
}
// failed open a camera
return Ptr<IVideoCapture>();
}
static Ptr<IVideoWriter> IVideoWriter_create(const String& filename, int _fourcc, double fps, Size frameSize, bool isColor)
{
Ptr<IVideoWriter> iwriter;
......@@ -582,6 +596,10 @@ VideoCapture::~VideoCapture()
bool VideoCapture::open(const String& filename)
{
if (isOpened()) release();
icap = IVideoCapture_create(filename);
if (!icap.empty())
return true;
cap.reset(cvCreateFileCapture(filename.c_str()));
return isOpened();
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment