'M', 'R', 'L', 'E' codec recording 0 bytes

asked 2016-09-08 10:20:08 -0600

Mikl gravatar image

updated 2016-09-08 10:37:31 -0600

Hello, I am recording video like this

unsigned char* frame;//rgb raw data
int width = 800;
int height= 400;

Size frameSize(width, height);
VideoWriter recorder(name.toStdString(), CV_FOURCC('M', 'R', 'L', 'E'), 20, frameSize, true);
Mat _frame(frameSize, CV_8UC3);

_frame.data = frame;
_recorder.write(_frame);

_recorder.release();

But no frames is recorded. File size is 0. Can you help me to find out what i am doing wrong, please.

UPDATE

I am using binaries, compiled myself in VS2015 from opencv-3.1.0 source. Maybe i need to configure "cmake" or VS project in special way?

edit retag flag offensive close merge delete

Comments

My first guess, the MRLE codec is not on your system, which is pretty weird in Windows ... Could you try reversing the width and height parameter? Sometimes my videos are blank also because I always forget that rows comes first and cols second in several parts of the OpenCV functionality.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-09-09 06:06:51 -0600 )edit

@StevenPuttemans Blank, but not empty.:)

Mikl gravatar imageMikl ( 2016-09-09 09:06:36 -0600 )edit

Hmm, so the data gets filled, but not the correct data. Did you try a imshow right before the write operation. Does that show anything?

StevenPuttemans gravatar imageStevenPuttemans ( 2016-09-12 04:07:02 -0600 )edit

@StevenPuttemans Not inside this class. It is a library and have no interface window to display anything. But the copy if the same data is visualized and looks fine (except of colors are wrong, but i know the reason and it is for later). So, i am SURE, what data is correct.

Mikl gravatar imageMikl ( 2016-09-12 05:11:08 -0600 )edit