Save frames from SceneViewport->ReadPixel()

Hi all,

I have an implementation of OpenCV in my current project that let’s me export TArrays to a video file. So the flow goes like that: gets the frame from a custom ViewportClientClass->ReadPixels(), then written to a video file before reading the following frame.

Now, the issue with that set up is that performance aren’t the best. So I tried storing the frames to an array and writing them to the file when the recording is finished. but now, the frames that are being written to the file are the ones that are being drawn at that time. In other words, instead of writing the stored frames, it writes the ones currently being drawn.

I’m sorry the explanation is vague but I can’t make sense of it, the frames as stored as reference not pointers, and no frames are added to the array when the file is being written.

Question :
Does anyone know how to properly store frames from the ReadPixel() function for later processing?