Hi,
I'm getting some inconsistent behaviour with PImage.width, PImage.height, and PImage.resize() when working with Movie files. Width and height will almost always return 0, though will occasionally return the correct dimensions. PImage.resize() will sometimes throw an error: "Width(0) and Height(0) cannot be <= 0" - even when the dimensions are hardcoded in. I'm posting this here because I'm not sure whether this is a bug or I'm just doing something silly with the code:
macOS 10.12.5; Quicktime 10.4; P3.3.5
import processing.video.*;
Movie m;
PImage mS;
int vScale = 4;
int mW;
int mH;
void setup() {
size(480, 270);
m = new Movie(this, "test.mov"); // original dim: 1920 1080
m.loop();
mW = m.width;
mH = m.height;
// Almost always returns 0 for both values, but occasionally returns the correct dimensions.
println("width: " + mW +" " + "Height: " + mH);
}
void draw() {
mS = m.get();
//This almost never works
//mS.resize(mW/vScale, mH/vScale);
//This works most of the time, but not always!
//mS.resize(1920/vScale, 1080/vScale);
//Again works most of the time, but not always...
mS.resize(480, 270);
image(mS, 0, 0);
}
void movieEvent(Movie m) {
m.read();
}