Hi,
I’m tryin to record a video in form of .bmp images but encounter two problems:
When looking at the image timing i see that i cannot get 50fps to work properly.
Although I create a cam with:
cam[i] = new CLEyeCameraCapture(windowName, guid, CLEYE_COLOR_RAW,
CLEYE_VGA , 50);
i get the frames captured with about 80ms difference.
Also, i have strange swaps of images, which seem like an image is somehow buffered and saved later. Or it took some more time to save the image or whatever. Meaning that images that appear earlier or later in the image timeline description do not fit to the flow of the other images within this time window.
My code to record the images is the following:
while(_running)
{
CLEyeCameraGetFrame(_cam, pCapBuffer);
// Resize Image to fit screen size
cvResize(pCapImage,resizedpCapImage,CV_INTER_NN);
cvShowImage(_windowName, resizedpCapImage);
//save Image to disk with date and time
GetSystemTime(&st;);
GetLocalTime(<);
//format image string -- TODO insert fast formatting here: http://fastformat.sourceforge.net/
//clear string
sstm.str(std::string());
//complete filname
//sstm << prefix << _participant << i << "-" << "h" << st.wHour << "m" << st.wMinute << "s" << st.wSecond << "ms" << st.wMilliseconds << suffix;
sstm << prefix << _participant << i << "-" << st.wHour << st.wMinute << st.wSecond << st.wMilliseconds << suffix;
image_name = sstm.str();
const char *c = image_name.c_str();
//try to save image
try {
cvSaveImage(c, pCapImage); //bmp = speed!
}
catch (runtime_error& ex) {
fprintf(stderr, "Exception converting image to PNG format: %s\n", ex.what());
}
i++;
}
which is based on the multicam example.
I would appreciate any help.