Hello!
I have a problem with my code involving gstreamer apparently. The exact same code was working fine for weeks and until a week ago, today re-opening it I had an error stating “a library used by this sketch is not installed properly”.
I don’t get why it is suddenly not properly imported, I tried uninstalling to re install processing video library, and change the folder location hoping it would change something. Did this issue happen to anyone else? Does someone know how to fix it? Did the library change or processing has an update?
Thanks in advance for any help you could give me!
import processing.video.*;
Movie img;
int matrixsize;
float t = 1;
float s = 0;
void setup() {
size(1280, 720);
colorMode(HSB, 360, 100, 100);
img = new Movie(this, "michel.mp4");
img.loop();
strokeCap(PROJECT);
stroke(0);
rectMode(CENTER);
image(img, 1280, 720, 1280, 720);
}
void mousePressed() {
saveFrame("output4/bear_####.png");
}
void movieEvent(Movie m) {
m.read();
}
void draw() {
image(img, 1280, 720, 1280, 720);
background(0,0,100);
println(img);
int t = int(map(mouseY, 0, height, 1, 120));
matrixsize = width/t;
for (int x = 0; x < img.width; x += matrixsize) {
for (int y = 0; y < img.height; y += matrixsize) {
color c = img.pixels[x + y*img.width];
float s = map(mouseX, 0, width, 0, 20);
strokeWeight(s);
if (saturation(c) <= 20 && brightness(c) >= 85) {
line(((width-img.width)/2.5)+x+(matrixsize/2)-(matrixsize/(4*t)), ((width-img.width)/2)+y,((width-img.width)/2.5)+x+(matrixsize/2)-(matrixsize/(4*t)), ((width-img.width)/2)+y+matrixsize/3);
}
if (brightness(c) <= 10) {
line(((width-img.width)/2.5)+x+(matrixsize/3), ((width-img.width)/2)+y+(matrixsize/2)-(matrixsize/4*t)-(matrixsize/3), ((width-img.width)/2.5)+x+(matrixsize/3)+matrixsize/3, ((width-img.width)/2)+y+(matrixsize/2)-(matrixsize/(4*t))-(matrixsize/3));
}
if ((hue(c) < 20 && saturation(c) > 20 && brightness(c) > 10)
|| (hue(c) > 270 && saturation(c) > 20 && brightness(c) > 10)
|| (hue(c) > 70 && hue(c) < 150 && saturation(c) > 20 && brightness(c) > 10)
|| (saturation(c) <= 20 && brightness(c) > 10 && brightness(c) < 85)){
line(((width-img.width)/2.5)+x+(matrixsize/3), ((width-img.width)/2)+y+matrixsize/4, ((width-img.width)/2.5)+x+(matrixsize/3) + matrixsize/4, ((width-img.width)/2)+y);
}
if (hue(c) >= 150 && hue(c) <= 270 && saturation(c) > 20 && brightness(c) > 10) {
line(((width-img.width)/2.5)+x+(matrixsize/3), ((width-img.width)/2)+y+matrixsize/4, ((width-img.width)/2.5)+x+(matrixsize/3) + matrixsize/4, ((width-img.width)/2)+y+matrixsize/6);
}
if (hue(c) >= 20 && hue(c) <= 70 && saturation(c) > 20 && brightness(c) > 10) {
line(((width-img.width)/2.5)+x+(matrixsize/2.5), ((width-img.width)/2)+y+matrixsize/3, ((width-img.width)/2.5)+x+(matrixsize/3) + matrixsize/3 - matrixsize/7, ((width-img.width/2)+y));
}
}
}
}