Video Export (record when key is pressed)
final String sketchname = getClass().getName();
import com.hamoid.*;
VideoExport videoExport;
boolean record = false;
void rec() {
if (frameCount == 1) {
videoExport = new VideoExport(this, "../"+sketchname+".mp4");
videoExport.setFrameRate(30);
videoExport.startMovie();
}
if (keyPressed && key == 'r') {
videoExport.saveFrame();
}
}