I have a script I’m using to capture frames(I made it simpler for understandability’s sake here, so I can’t change it, sorry ). I’ve used the processing moviemaker tool in the past, but is there any way to use it as a library rather than a tool to collate the images in a directory to a quicktime format? Is there a better method that would save mp4(that’s what I’m looking for)?
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.Rectangle;
scap video;
Robot robot;
int cw=800, ch=600;
void setup() {
size(800,600);
try {
robot = new Robot();
}
catch (AWTException err) {
println(err);
}
video = new scap();
}
void draw() {
PImage vi= video.get();
image(vi, 0, 0, width, height);
}
class scap {
PImage screenshot;
PImage get() {
screenshot = new PImage(robot.createScreenCapture(new Rectangle(0, 0, cw, ch)));
return screenshot;
}
}
EDIT: Forgot to add, the images save to the same dir as the pde file, I neglected to actually put saveframe in here because it was part of another function (oh well…)