Higher the size() is, the faster the movieMaker export is?
in
Contributed Library Questions
•
1 year ago
Hi all,
I'm basically recording footage while displaying other video. Everything works apart from one thing. The frame-rate of the recorded .mov file is way too fast. The recording time is 6 seconds, however the exported .mov file is 3 secs.
W
hat it seems to be is the higher the size() is, the faster it'll play back.
It'll work normally at 200x200 pixels, but the exported video gets faster and faster the higher the resolution is.
Any ideas why?
- import jmcvideo.*;
- import processing.video.*;
- import processing.serial.*;
- Capture myCapture;
- Serial arduino;
- MovieMaker mm;
- boolean video = false;
- JMCMovie myMovie;
- int counter = 1;
- int vidCounter = 0;
- void setup() {
- size(1440, 900, P2D);
- frameRate(25);
- // size(320, 240, P2D);
- mm = new MovieMaker(this, width, height, "drawing" + counter + ".mov",
- 25, MovieMaker.JPEG, MovieMaker.BEST);
- myCapture = new Capture(this, width, height, 25);
- myCapture.settings();
- myMovie = movieFromDataPath("drawing0.mov");
- myMovie.loop();
- arduino = new Serial(this, Serial.list()[0], 9600);
- background(0);
- }
- void draw() {
- {
- byte[] inBuffer = new byte[7];
- while (arduino.available () > 0) {
- inBuffer = arduino.readBytes();
- arduino.readBytes(inBuffer);
- if (inBuffer != null) {
- String myString = new String(inBuffer);
- println(myString);
- delay(200);
- // if (keyPressed) {
- // if (key == ' ') {
- if (myString.equals("A")) {
- video = true;
- arduino.clear();
- }
- else if (myString.equals("?")) {
- video = false;
- delay(200);
- println("finished :)");
- mm.finish();
- background(0);
- arduino.clear();
- delay(200);
- counter++;
- delay(500);
- mm = new MovieMaker(this, width, height, "drawing" + counter + ".mov",
- 25, MovieMaker.JPEG, MovieMaker.BEST);
- }
- }
- }
- }
- if (video) {
- image(myMovie, 0, 0);
- myCapture.loadPixels();
- mm.addFrame(myCapture.pixels, myCapture.width, myCapture.height);
- }
- }
- void captureEvent(Capture myCapture) {
- myCapture.read();
- }
- JMCMovie movieFromDataPath(String filename)
- {
- return new JMCMovie(this, filename, RGB);
- }
1