I would like to create a video from my application, since other ways of capturing it failed, I was trying to implement it inside.
Therefore I used 2 PBOs and I read the data and store it on disk in a simple TGA for every 1/fps seconds. (I can run a script after to turn the images into a movie)
But I am right now unable to increase the fps. It is capturing with only 10fps, with 15 fps I noticed too much lag.
I am considering that the following function is causing the slowdown, but since it is the process of writing to the disk, I do not know if there is any other way:
FILE *out = fopen(destFile, "w"); //glReadPixels(0, 0, W, H, GL_BGR, GL_UNSIGNED_BYTE, pixel_data); written_size= fwrite_unlocked(&TGAhead, sizeof(TGAhead), 1, out); written_size+= fwrite_unlocked(pixel_data, 3*W*H, 1, out); fclose(out); glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB); glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0); return true;
My question is: do you know any other way to speeding up and allow the capture of 30fps movies?
Am I forgetting something?
Do you think that putting the disk bounded code inside a thread would help?