Video Export (with unique Filename)

// Many thanks to Daan van der Zwaag!

final String sketchname = getClass().getName();

int s = second();
int m = minute();

import com.hamoid.*;
VideoExport videoExport;

void rec() {
  if (frameCount == 1) {
    videoExport = new VideoExport(this, "./exports/"+sketchname+"_"+m+s+".mp4");
    videoExport.setFrameRate(30);  
    videoExport.startMovie();
  }
  videoExport.saveFrame();
}