Screen capturing / Movie stills
in
Core Library Questions
•
2 years ago
I'm trying to make a thing that captures movie stills every minute with processing but because i'm new to processing i'm not advanced and keep getting the same note.
It says "Cannot convert movie to capture"
Can someone help me out with this?
Here's the code:
- import processing.video.*;
- Capture myMovie;
- int intervalTime = 1*60;
- int secondsSinceStart = 0;
- String startTime = getTimestamp();
- int counter = 0;
- boolean doSave = true;
- void setup() {
- myMovie = new Movie(this, "movie.avi");
- size(myMovie.height, myMovie.width);
- println(Capture.list());
- myMovie = new Capture(this, width, height, 30);
- noStroke();
- }
- void draw() {
- if (interval == 0 && doSave == true) {
- String saveFileName = startTime+"-"+nf(counter,5);
- saveFrame(saveFileName+".png");
- doSave = false;
- counter++;
- }
- else if (interval != 0) {
- doSave = true;
- }
- fill(random(0,255),random(0,255),random(0,255));
- rect(map(interval, 0,intervalTime, 0,width),0, 5,5);
- }
- String getTimestamp() {
- Calendar now = Calendar.getInstance();
- return String.format("%1$ty%1$tm%1$td_%1$tH%1$tM%1$tS", now);
- }
1