We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have been making a piece of software to drive my long term installation.
I have used Quartz Composer and now Processing to playback 1 of 3 videos, depending on the time of day, and send this out via Syphon to MadMapper.
Somehow, it usually freezes or crashes after a week. I can't understand why this is. I even exported the app from Processing and it still happens. Essentially depending on the hour it should either play one video or the other. It is as simple as I could possibly make it.
Can someone help me understand why this happens, how to avoid it, and how to spot it in the future?
Thank you,
import codeanticode.syphon.*;
import processing.video.*;
PGraphics canvas;
SyphonServer server;
Movie vidMorn;
Movie vidAfter;
Movie vidNight;
//Create Variables for Time
int h;
void setup() {
size(1280, 720, P3D);
canvas = createGraphics(1280, 720, P3D);
//Create server to send frames out
server = new SyphonServer(this, "BelltownTimeSyphon");
//Create space for video
vidMorn = new Movie(this, "Morning.mov");
vidMorn.loop();
vidAfter = new Movie(this, "Afternoon.mov");
vidAfter.loop();
vidNight = new Movie(this, "Night.mov");
vidNight.loop();
}
void draw() {
//Used for testing current hour
h = hour();
// h = int(map(mouseX, 0, width, 0, 23));
println(h);
//Check to make sure video file is present
if (vidMorn.available() == true) {
vidMorn.read();
}
if (vidAfter.available() == true) {
vidAfter.read();
}
if (vidNight.available() == true) {
vidNight.read();
}
canvas.beginDraw();
canvas.background(0);
// Play in the Early Morning
if ((h >= 0) && (h < 9)) {
canvas.image(vidNight, 0, 0, width, height);
}
// Play in the Late Monring/Afternoon
else if ((h >= 9) && (h < 17)) {
canvas.image(vidMorn, 0, 0, width, height);
}
// Play in the Afternoon/Evening
else if ((h >= 17) && (h < 21)) {
canvas.image(vidAfter, 0, 0, width, height);
}
// Play in the Deep Night
else if (h >= 21) {
canvas.image(vidNight, 0, 0, width, height);
}
// canvas.ellipse(mouseX, mouseY, 50, 50);
canvas.endDraw();
//This actually draws the scene to the screen.
//Without, there would not be anything in Processing.
image(canvas, 0, 0);
server.sendImage(canvas);
}
Here is the link to download: https://drive.google.com/open?id=0B3A6RyPSTbffY05lLW1tTG1mU1k&authuser=0
Answers
it's hard to debug when it crashes after a week, uh? ;-)
you could get rid of 79 (although you explain it), 36
but why do you read each movie but playing only one?
when it crashes do you receive a error message/ line number?
I will consult the team and try to get the error list from whoever just checked it....
Let's see. I loaded three movies because I was not able to find out how to use a variable for the file path. I am assuming you can load any given file path into the movie so that the path becomes a variable and you need only actually call each movie - but I was not able to work that out.
I think the problem has something to do with the Syphon plugin. I previously created literally the exact same program in Quartz Composer, using Syphon as an output, and it would crash almost every week. The problem described in that crash report was that it was on behalf of the Syphon plugin.
Fast forward to this round, Processing, an exported Sketch, used on a similar build MacBook: it crashed at about the same frequency as well.
I thought that exporting might iron out the anomalies, but it persists.
I am using MadMapper as the final output but it stays running each time. And I don't think there could be some sort of weekly system call that could interrupt such a thing.
Some of the Syphon team members said it could be a memory leak. Any thoughts on checking that?
Each video is about 30 mins long, ca. 254mb, and is in the H.264 codec
Any tips are appreciated,
Here is the crash report I got from my assistant. Sorry it is in pictures. I'll try and get the text version of it next time a crash occurs.
https://drive.google.com/file/d/0B3A6RyPSTbffQTJUUkVtTGFlX0U/view?usp=sharing
Placing your Movie instances in 1 array would simplify the code and make it less prone to errors perhaps: :-??
http://forum.processing.org/two/discussion/7852/problem-with-toggling-between-multiple-videos-on-processing-2-2-1
I had a great discussion with Vade from v002 about this. He found it was a memory leak that accumulated over time. I would point to the forum discussion here:
http://v002.info/forums/topic/crash-using-syphon-in-processing-long-term-installation/