Skip to content

Instantly share code, notes, and snippets.

@kitschpatrol
Created February 14, 2012 04:45
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitschpatrol/1823610 to your computer and use it in GitHub Desktop.
Save kitschpatrol/1823610 to your computer and use it in GitHub Desktop.
Recording Video from OpenFrameworks
#include "ofxQtVideoSaver.h"
...
// in your class definition
ofImage recordingImage;
ofxQtVideoSaver saver;
...
// in setup function, start recording
saver.setCodecType(0); // Animation Codec
saver.setCodecQualityLevel(OF_QT_SAVER_CODEC_QUALITY_NORMAL);
saver.setup(ofGetWidth(), ofGetHeight(), "recording-" + ofToString(ofGetUnixTime()) + ".mov");
...
// in draw loop, save frames
recordingImage.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
saver.addFrame(recordingImage.getPixels());
...
// before you quit, finish up
saver.finishMovie();
@clhenrick
Copy link

Hi kitschpatrol, I'm getting use of undeclared identifier 'OF_QT_SAVER_CODEC_QUALITY_NORMAL' when attempting to use this code. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment