dear D.,
thanks again for your technical explaination: i am happy to understand exactly what does the mysterious method movieEvent. And Available();
As for calling play();jump(0); pause() in setup() i have done that because of my various problems (and found this in some code from Andres colubri, it seems to me, i am not sure); but in this case also you are very clear:------[you must ask for putting your schema about jum and so on in the processing video doc!], so i have suppressed this in my code, which now is (of course it s not the complete code for my app!):::::
import processing.video.*;
Movie mov;
String[] videoList = {"video1.mov", "video2.dv","video3.dv"};
int index= 0;
boolean starter = false;
void setup() {
size(1024,768,P2D);
background(0);
}
void movieEvent(Movie m) {
m.read();
}
void draw() {
frameRate(25);
println(starter);
if (starter ) {
if (mov.time() < mov.duration()) {
image(mov, width/2-(mov.width/2), height/2-(mov.height/2));
}
else if (mov.time() == mov.duration()) {
starter = false;
mov.stop();
mov.dispose();
index= index+1;
background(0);
}
}
}
void keyReleased() {
if (key == 'v' && index<videoList.length) {
mov = new Movie(this, videoList[index]);
// mov.play();
// mov.jump(0);
// mov.pause();
mov.play();
starter = true;
mov.read(); //is it useful???
}
}
When i use it with little videos (mp4, 10 megabytes , like "station.mov" or "totoro", not any problem neither with 1.5.1 nor with 2.03. BUT when i use my real videos (.DV or .Mov, more or less 500 megas):
--- with 2.03 the video appears only after 10 or 15 seconds and then what i see is a kind of diaporama, very very slow...
-- with 1.5.1 it 's normal, but not allways...; sometime i have the ArrayOutOfBounds exception, as i had before changing the code;
sometime it crashes completely ::: and in the processing console i have
Invalid memory access of location 0xffffffff eip=0x5e2e8d8
and in the Apple report if you think it is interesting for you, only the beginning because "it exceeds the message limits" (!)
Process: java [1226]
Path: /usr/bin/java
Identifier: com.apple.javajdk16.cmd
Version: 1.0 (1.0)
Code Type: X86 (Native)
Parent Process: JavaApplicationStub [986]
Date/Time: 2013-09-18 10:30:36.934 +0200
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
Interval Since Last Report: 14505566 sec
Crashes Since Last Report: 178
Per-App Interval Since Last Report: 3583242 sec
Per-App Crashes Since Last Report: 86
Anonymous UUID: 4D18C230-54C6-4F9B-AFCF-688909ABB9D4
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000ffffffff
Crashed Thread: 28 Java: Thread-3
Application Specific Information:
Java information:
Exception type: Bus Error (0xa) at pc=0000000005e2e8d8
Java VM: Java HotSpot(TM) Client VM (20.1-b02-384 mixed mode macosx-x86)
Current thread (0000000003001c00): JavaThread "Thread-3" [_thread_in_native, id=-1314103296, stack(00000000b19c6000,00000000b1ac6000)]
Stack: [00000000b19c6000,00000000b1ac6000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j quicktime.qd.Pict.GetMoviePict(II)I+0
j quicktime.qd.Pict.fromMovie(Lquicktime/std/movies/Movie;I)Lquicktime/qd/Pict;+5
j quicktime.std.movies.Movie.getPict(I)Lquicktime/qd/Pict;+2
j processing.video.Movie.read()V+73
j CodeVideoForum.movieEvent(Lprocessing/video/Movie;)V+1
j sun.reflect.GeneratedMethodAccessor3.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+40
J sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
J java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
j processing.video.Movie.run()V+61
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
Java Threads: ( => current thread )
=>0000000003001c00 JavaThread "Thread-3" [_thread_in_native, id=-1314103296, stack(00000000b19c6000,00000000b1ac6000)]
0000000008067400 JavaThread "DestroyJavaVM" [_thread_blocked, id=-1341124608, stack(00000000b0001000,00000000b0101000)]
000000000804b000 JavaThread "Animation Thread" [_thread_blocked, id=-1318354944, stack(00000000b15b8000,00000000b16b8000)]
0000000008066000 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=-1320468480, stack(00000000b13b4000,00000000b14b4000)]
000000000805a000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=-1321525248, stack(00000000b12b2000,00000000b13b2000)]
0000000003141c00 JavaThread "AWT-Shutdown" [_thread_blocked, id=-1323151360, stack(00000000b1125000,00000000b1225000)]
0000000003141400 JavaThread "AWT-AppKit" daemon [_thread_in_native, id=8189248, stack(00000000bf800000,00000000c0000000)]
0000000008022c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=-1325264896, stack(00000000b0f21000,00000000b1021000)]
0000000008021c00 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=-1326321664, stack(00000000b0e1f000,00000000b0f1f000)]
0000000008020c00 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=-1327378432, stack(00000000b0d1d000,00000000b0e1d000)]
00000000030a3800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=-1328435200, stack(00000000b0c1b000,00000000b0d1b000)]
000000000801fc00 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=-1329491968, stack(00000000b0b19000,00000000b0c19000)]
000000000801d000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=-1330548736, stack(00000000b0a17000,00000000b0b17000)]
000000000801c000 JavaThread "Surrogate Locker Thread (Concurrent GC)" daemon [_thread_blocked, id=-1331605504, stack(00000000b0915000,00000000b0a15000)]
00000000030a0800 JavaThread "Finalizer" daemon [_thread_blocked, id=-1333727232, stack(00000000b070f000,00000000b080f000)]
000000000309f800 JavaThread "Reference Handler" daemon [_thread_blocked, id=-1334784000, stack(00000000b060d000,00000000b070d000)]
Other Threads:
0000000008012800 VMThread [stack: 00000000b050b000,00000000b060b000] [id=-1335840768]
000000000801f400 WatcherThread [stack: 00000000b1023000,00000000b1123000] [id=-1324208128]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
par new generation total 14784K, used 11201K [00000000200c0000, 00000000210c0000, 00000000220c0000)
eden space 13184K, 75% used [00000000200c0000, 0000000020a7d300, 0000000020da0000)
from space 1600K, 76% used [0000000020f30000, 00000000210632b8, 00000000210c0000)
to space 1600K, 0% used [0000000020da0000, 0000000020da0000, 0000000020f30000)
concurrent mark-sweep generation total 49152K, used 6146K [00000000220c0000, 00000000250c0000, 000000007dcc0000)
concurrent-mark-sweep perm gen total 12288K, used 8400K [000000007dcc0000, 000000007e8c0000, 0000000081cc0000)
Code Cache [0000000008801000, 00000000088ea000, 000000000a801000)
total_blobs=530 nmethods=294 adapters=180 free_code_cache=32608128 largest_free_block=0
Virtual Machine Arguments:
JVM Args: -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8314,suspend=y -Xms64m -Xmx1500m -Djava.library.path=:/Applications/Processing 2.app/Contents/Resources/Java/modes/java/libraries/video/library:/Applications/Processing 2.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java -ea
Java Command: processing.core.PApplet --location=463,59 --external --display=0 --sketch-path=/Users/nimac/Documents/applisPERF_F/perfBPIproces/CodeVideoForum CodeVideoForum
Launcher Type: SUN_STANDARD
Physical Memory: Page Size = 4k, Total = 3840M, Free = 1083M
thanks again for your technical explaination: i am happy to understand exactly what does the mysterious method movieEvent. And Available();
As for calling play();jump(0); pause() in setup() i have done that because of my various problems (and found this in some code from Andres colubri, it seems to me, i am not sure); but in this case also you are very clear:------[you must ask for putting your schema about jum and so on in the processing video doc!], so i have suppressed this in my code, which now is (of course it s not the complete code for my app!):::::
import processing.video.*;
Movie mov;
String[] videoList = {"video1.mov", "video2.dv","video3.dv"};
int index= 0;
boolean starter = false;
void setup() {
size(1024,768,P2D);
background(0);
}
void movieEvent(Movie m) {
m.read();
}
void draw() {
frameRate(25);
println(starter);
if (starter ) {
if (mov.time() < mov.duration()) {
image(mov, width/2-(mov.width/2), height/2-(mov.height/2));
}
else if (mov.time() == mov.duration()) {
starter = false;
mov.stop();
mov.dispose();
index= index+1;
background(0);
}
}
}
void keyReleased() {
if (key == 'v' && index<videoList.length) {
mov = new Movie(this, videoList[index]);
// mov.play();
// mov.jump(0);
// mov.pause();
mov.play();
starter = true;
mov.read(); //is it useful???
}
}
When i use it with little videos (mp4, 10 megabytes , like "station.mov" or "totoro", not any problem neither with 1.5.1 nor with 2.03. BUT when i use my real videos (.DV or .Mov, more or less 500 megas):
--- with 2.03 the video appears only after 10 or 15 seconds and then what i see is a kind of diaporama, very very slow...
-- with 1.5.1 it 's normal, but not allways...; sometime i have the ArrayOutOfBounds exception, as i had before changing the code;
sometime it crashes completely ::: and in the processing console i have
Invalid memory access of location 0xffffffff eip=0x5e2e8d8
and in the Apple report if you think it is interesting for you, only the beginning because "it exceeds the message limits" (!)
Process: java [1226]
Path: /usr/bin/java
Identifier: com.apple.javajdk16.cmd
Version: 1.0 (1.0)
Code Type: X86 (Native)
Parent Process: JavaApplicationStub [986]
Date/Time: 2013-09-18 10:30:36.934 +0200
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
Interval Since Last Report: 14505566 sec
Crashes Since Last Report: 178
Per-App Interval Since Last Report: 3583242 sec
Per-App Crashes Since Last Report: 86
Anonymous UUID: 4D18C230-54C6-4F9B-AFCF-688909ABB9D4
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000ffffffff
Crashed Thread: 28 Java: Thread-3
Application Specific Information:
Java information:
Exception type: Bus Error (0xa) at pc=0000000005e2e8d8
Java VM: Java HotSpot(TM) Client VM (20.1-b02-384 mixed mode macosx-x86)
Current thread (0000000003001c00): JavaThread "Thread-3" [_thread_in_native, id=-1314103296, stack(00000000b19c6000,00000000b1ac6000)]
Stack: [00000000b19c6000,00000000b1ac6000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j quicktime.qd.Pict.GetMoviePict(II)I+0
j quicktime.qd.Pict.fromMovie(Lquicktime/std/movies/Movie;I)Lquicktime/qd/Pict;+5
j quicktime.std.movies.Movie.getPict(I)Lquicktime/qd/Pict;+2
j processing.video.Movie.read()V+73
j CodeVideoForum.movieEvent(Lprocessing/video/Movie;)V+1
j sun.reflect.GeneratedMethodAccessor3.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+40
J sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
J java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
j processing.video.Movie.run()V+61
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
Java Threads: ( => current thread )
=>0000000003001c00 JavaThread "Thread-3" [_thread_in_native, id=-1314103296, stack(00000000b19c6000,00000000b1ac6000)]
0000000008067400 JavaThread "DestroyJavaVM" [_thread_blocked, id=-1341124608, stack(00000000b0001000,00000000b0101000)]
000000000804b000 JavaThread "Animation Thread" [_thread_blocked, id=-1318354944, stack(00000000b15b8000,00000000b16b8000)]
0000000008066000 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=-1320468480, stack(00000000b13b4000,00000000b14b4000)]
000000000805a000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=-1321525248, stack(00000000b12b2000,00000000b13b2000)]
0000000003141c00 JavaThread "AWT-Shutdown" [_thread_blocked, id=-1323151360, stack(00000000b1125000,00000000b1225000)]
0000000003141400 JavaThread "AWT-AppKit" daemon [_thread_in_native, id=8189248, stack(00000000bf800000,00000000c0000000)]
0000000008022c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=-1325264896, stack(00000000b0f21000,00000000b1021000)]
0000000008021c00 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=-1326321664, stack(00000000b0e1f000,00000000b0f1f000)]
0000000008020c00 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=-1327378432, stack(00000000b0d1d000,00000000b0e1d000)]
00000000030a3800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=-1328435200, stack(00000000b0c1b000,00000000b0d1b000)]
000000000801fc00 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=-1329491968, stack(00000000b0b19000,00000000b0c19000)]
000000000801d000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=-1330548736, stack(00000000b0a17000,00000000b0b17000)]
000000000801c000 JavaThread "Surrogate Locker Thread (Concurrent GC)" daemon [_thread_blocked, id=-1331605504, stack(00000000b0915000,00000000b0a15000)]
00000000030a0800 JavaThread "Finalizer" daemon [_thread_blocked, id=-1333727232, stack(00000000b070f000,00000000b080f000)]
000000000309f800 JavaThread "Reference Handler" daemon [_thread_blocked, id=-1334784000, stack(00000000b060d000,00000000b070d000)]
Other Threads:
0000000008012800 VMThread [stack: 00000000b050b000,00000000b060b000] [id=-1335840768]
000000000801f400 WatcherThread [stack: 00000000b1023000,00000000b1123000] [id=-1324208128]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
par new generation total 14784K, used 11201K [00000000200c0000, 00000000210c0000, 00000000220c0000)
eden space 13184K, 75% used [00000000200c0000, 0000000020a7d300, 0000000020da0000)
from space 1600K, 76% used [0000000020f30000, 00000000210632b8, 00000000210c0000)
to space 1600K, 0% used [0000000020da0000, 0000000020da0000, 0000000020f30000)
concurrent mark-sweep generation total 49152K, used 6146K [00000000220c0000, 00000000250c0000, 000000007dcc0000)
concurrent-mark-sweep perm gen total 12288K, used 8400K [000000007dcc0000, 000000007e8c0000, 0000000081cc0000)
Code Cache [0000000008801000, 00000000088ea000, 000000000a801000)
total_blobs=530 nmethods=294 adapters=180 free_code_cache=32608128 largest_free_block=0
Virtual Machine Arguments:
JVM Args: -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8314,suspend=y -Xms64m -Xmx1500m -Djava.library.path=:/Applications/Processing 2.app/Contents/Resources/Java/modes/java/libraries/video/library:/Applications/Processing 2.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java -ea
Java Command: processing.core.PApplet --location=463,59 --external --display=0 --sketch-path=/Users/nimac/Documents/applisPERF_F/perfBPIproces/CodeVideoForum CodeVideoForum
Launcher Type: SUN_STANDARD
Physical Memory: Page Size = 4k, Total = 3840M, Free = 1083M