I have Processing 2.08b and QuickTime 7.7.3 (most recent) on Windows 7-64. Tried to run Movie Maker in Processing but keep getting the error message "Creating the QuickTime Movie failed. closed." and also:
java.io.IOException: closed
at javax.imageio.stream.ImageInputStreamImpl.checkClosed(ImageInputStreamImpl.java:96)
at javax.imageio.stream.ImageInputStreamImpl.close(ImageInputStreamImpl.java:843)
at javax.imageio.stream.FileImageOutputStream.close(FileImageOutputStream.java:143)
at ch.randelshofer.media.quicktime.QuickTimeWriter.close(QuickTimeWriter.java:3046)
at processing.app.tools.MovieMaker.writeVideoOnlyVFR(MovieMaker.java:679)
at processing.app.tools.MovieMaker.access$10(MovieMaker.java:609)
at processing.app.tools.MovieMaker$4.doInBackground(MovieMaker.java:572)
at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at javax.swing.SwingWorker.run(SwingWorker.java:316)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I read some posts here and one of the solution is to use old moviemaker.jar from the 2.07 version. I tried and the MovieMaker tool could even get opened (nothing happens if click Tools-MovieMaker).
I just found I don't have the opengl library in my processing 2.0b8. I read other discussions regarding this topic. Some said it is in \modes\java\libraries, but I don't see it in my folder (what I have are: dxf, javascript, lwjgl, minim, net, pdf, serial, and video). I tried to re-download processing but it is the same. I also tried to download 2.0b8 for windows-32 (I am using 64), 2.0b7 for both windows-32 and -64, but no luck. I search "opengl' in the processing folder and it returns nothing. Does anyone know what is the reason, and where I can get an opengl library?
I have a large scale data (~2,000,000) lines in a text file. Each line reads like this:
id hr mt t x y
where id is a number from 1 to ~10,000 representing a particular vehicle in the fleet, hr and mt represent the time (hour and minute), t =hr*60+mt, x and y are the location of the vehicle at this time. For example:
1 0 0 0 x1 y1
1 0 10 10 x2 y2
showing vehicle #1 is at [x1,y1] when time is 00:00 and is at [x2,y2] when time is 00:10.
The text file is sorted according to vehicle id then time (fourth column), such as:
/////////////////////////////////////////////////////////////
1 15 36 936 116.5117 39.9212
1 15 46 946 116.5114 39.9388
....
2 13 33 813 116.3642 39.8878
...
9611 23 48 1428 116.4150 40.0216
/////////////////////////////////////////////////////////
I worked with Processing to visualize the trajectories of these vehicles. Essentially I created a class "car". Each object of the car class stores the portion of data from the large text file (e.g., all lines starting with same id). Then the object will determine if it is running according to the time (global variable, from 00:00 to 24:00). If it runs, then calculate the position of next move and draw a line between the current position and the next position.
When I let the program runs, it doesn't show any lines on the screen, until the time reaches 24:00, then all lines are shown on the screen at once. First I thought it was because the data were too large. But using a small portion of it (100, 1,000 lines instead of 2,000,000 lines), it still does not show any visualizations until the end. I couldn't figure out what was the reason. Was it because I used class? I post the code here and hope you guys can help me take a look. Thanks a lot.
// raw data: X3 (id from 1, hr, mt, time from 1, width, height) sorted by id and then time
int control=0; //0->stop; 1->pause; 2->start
int time=1; //from 1 to largest time
int time_limit=30;
int time_max=630;
car[] taxi;
void loadingData(){
String[] raw=loadStrings("Sa3.txt");
String[] col=splitTokens(raw[raw.length-1]);
float nn=float(col[0]);
int n=int(nn);
taxi= new car[n];
int j=0;
int test=1;
int end=0;
for (int i=0; i<n; i++){
int start=j;
while (((i+1)==test)&&(j<raw.length-1)){
j++;
col=splitTokens(raw[j]);
float temp=float(col[0]);
test=int(temp);
}
if (j!=raw.length-1){
end=j-1;
}
else{
end=j;
}
class car{
float[][] data;//data: (hr, mt, continouse time, width, height)
int idx=1; //time is between data[idx-1][2] and data[idx][2]
boolean run=false;
PVector source=new PVector(0,0);
PVector target=new PVector(0,0);
car(float[][] t_data){
data=t_data;
}
void update_run(){
if ((idx>=data.length)||(time<=data[0][2])){
run=false;
}
else{
if ((data[idx][2]-data[idx-1][2])>time_limit){
run=false;
}
else{
run=true;
}
}
}
void MouseControl(){
//control: 0->stop; 1->pause; 2->start
int x=width-80;
int y=5; //top-left point of the three-botton block
if ((mouseX>x)&&(mouseX<(x+20))&&(mouseY>y)&&(mouseY<(y+20))){
control=2;
}
if ((mouseX>(x+20))&&(mouseX<(x+40))&&(mouseY>y)&&(mouseY<(y+20))){
control=1;
}
if ((mouseX>(x+40))&&(mouseX<(x+60))&&(mouseY>y)&&(mouseY<(y+20))){
control=0;
}
}
Hi, I am new to Processing. Does anyone know any good examples animating a moving object or objects with trace? Something like this:
http://vimeo.com/21351764
The next step is to make it more visually appealing, integrate with the map of the city, and figure out how to draw trajectories of multiple taxis in the same week (I have data for ~10,000 taxis). Feedback and suggestions are much welcome.