ofxVideoRecorder and ofFbo


hello, I have been spending some hours looking through posts on the forum, but do not exactly find an answer. My quest is to use ofxvideoRecorder to export stuff which is drawn into an ofFbo. I have no problem running the ofxVideorecorder example, so that is ok.
To get my ofFbo written to video I have tried 2 things: both do export a video, but the pixels are completely wrong on the screen. I have tried this in the draw function :
img.grabScreen(0, 0, ofGetHeight(), ofGetWidth()); // ofImage img
bool success = vidRecorder.addFrame(img.getPixels());

or this

bool success = vidRecorder.addFrame(img.getPixels());

but yes… it does not make this right picture … Does someone have a suggestion? - or a much better way to export video?. Thank you in advance


Can you provide some screenshots of the output please?


yes thanks, , the first is more or less how it should look


I think there is an issue where you allocate your fbo and something wrong in your second option. You need to use readToPixels to ofPixels, like:

ofPixels recordPixels;
bool success = vidRecorder.addFrame(recordPixels);	// add pixels from FBO buffer

Check this answer below:


Yes that worked, thanks very much, no idea why I did not find that post before, What I changed was in the fbo allocation adding GL_RGB, and then using ofPixels in stead of ofImage.


How did you get ofxVideorecorder example running? I can get audio to record (into a .mov file) but no video. The ofVideoGrabber’s x/y are 0,0 no matter what i set them to. It’s possible ofxVideoRecorder is not finding ffmpeg but I don’t know how to verify that