Why crash video loop application after time?
in
Core Library Questions
•
2 years ago
Hey i hope its not the 100 post to this topic and someone can help me. I have a video loop depended on an key input. The video is 93MB ans has the codec mov h.264 . All run fine but 2 times a day the app crashed(exhibition 24h a day). For me it looks like java running out of memory. Had someone a solution?
int schalter=0;
import processing.video.*;
PImage notiz;
boolean aktiv=false;
boolean test1=false;
boolean test2=false;
boolean test3=false;
boolean test4=false;
Movie video1;
void setup() {
size(1280, 1024,P2D);
int schalter=0;
aktiv=false;
test1=false;
test2=false;
test3=false;
test4=false;
notiz = loadImage("notiz.png");
// Load and play the video in a loop
video1 = new Movie(this, "video1.mov");
video1.loop();
}
void movieEvent(Movie myMovie) {
myMovie.read();
}
void draw() {
try { } catch (OutOfMemoryError e) { setup(); }
video1.play();
image(video1,0,0,width,height);
if(aktiv==false && schalter==0){
image(notiz,344,342);
}
if (video1.time()>9.99 && aktiv==false && schalter==0) { //AA LOOP
video1.jump(0);
}
if (video1.time()>12 && schalter==0) {
schalter=1;
}
if (video1.time()>23.99 && aktiv==false && schalter==1) { //BB jump wenn kurbel aufhört
video1.jump(42);
schalter=3;
}
if (video1.time()>25 & schalter==1) {
schalter=2;
}
if (video1.time()>37.99 && aktiv==true && schalter==2) { //CC loop
video1.jump(28);
}
if (video1.time()>39 & schalter==2) {
schalter=3;
}
if (video1.time()>41.99 && aktiv==true && schalter==3) { //BBAbwärts kurbel wieder aktiv
video1.jump(14);
}
if (video1.time()>55.99 ) { //Schalter reset am Ende
schalter=0;
video1.stop();
}
}
void keyPressed() {
if (key=='1') {
aktiv=true;
}
if(key=='0') {
aktiv=false;
}
}
1