ofxVideoRecorger can not record from FBO

ofxVideoRecorger can not record FBO and What should I do!?
What is the problem?I record the video from fbo, and results in the above

Hi!

It’s always better if you share a bit of your code, just enough to reproduce the error. But usually, this type of error occurs when you have a format that only supports RGB and you are using RGBA or ARGB.

ofxVideoRecorder currently only supports RGB 8Bits/channel.

What should I do ? @hubris

Hi!
Try this pseudo code.

declare:
ofFbo recordFbo;
ofPixels recordPixels;

setup
recordFbo.allocate(widthParam, heightParam, GL_RGB);
recordFbo.begin();
ofClear(0, 0, 0, 255);
recordFbo.end();

update
if(vidGrabber.isFrameNew() && bRecording){
recordFbo.readToPixels(recordPixels);
bool success = vidRecorder.addFrame(recordPixels); // add pixels from FBO buffer

}

draw
recordFbo.begin();
ofClear(0, 0, 0, 255);

draw what you want…

recordFbo.end();

1 Like

Thank you very much @SebastianSobotka