I have a program that searches for all the frames in a 864.000 frame video to spot the different ones and save them for me. But for some reason, the program stops running at around 10% of the progress. The video is the following(I downloaded it): https://www.youtube.com/watch?v=7ly6hgzwsLU&t=30606s
My code is the following:
import processing.video.*;
Movie video;
void setup() {
video = new Movie(this, "24h.mp4");
System.out.println("Video loaded!");
System.out.println("Analysing frames...");
video.play();
for (int i = 0; i < 864000; i++) {
video.jump(i);
if (video.available()) {
video.read();
PImage p = createImage(16, 9, RGB);
p.copy(video, 0,0, video.width,video.height, 0,0, video.width,video.height);
if (!check(p)) p.save("frame" + i + ".jpg");
if (i != 0 && i%864 == 0) System.out.println((float)i/8640 + "% complete...");
}
}
System.out.println("Done!");
}
void draw() {}
boolean check(PImage a) {
a.loadPixels();
for (int i = 0; i < a.pixels.length; i++) {
if (brightness(a.pixels[i]) > 2) return false;
}
return true;
}
Why does it stop running?