VideoWriter won't open for MJPG stream
I am trying to follow this tutorial (https://ariandy1.wordpress.com/2013/0...) but with OpenCV 3.0. I have this code:
int codec = VideoWriter::fourcc('M','J','P','G');
cout << "Frame size: " << frame.cols << " " << frame.rows << endl;
cout << "Opening output stream..." << codec << " " << outStream.open("out.mjpg", codec, 2, Size(frame.cols,frame.rows), true) << endl;
frame
is a Mat
that is captured from a webcam. Here is the output:
Frame size: 352 288
Opening output stream...1196444237 0
As you can see VideoWriter::open() returns false (cout
ed as zero). Am I doing something wrong?