I've got a sketch using GSVideo which runs perfectly when started from within the PDE, but raises an AccessControlException when running as an embedded applet:
Exception in thread "Animation Thread" java.security.AccessControlException: access denied
(java.io.FilePermission /usr/lib read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.File.list(File.java:971)
at codeanticode.gsvideo.GSVideo.libgstreamerPresent(GSVideo.java:179)
at codeanticode.gsvideo.GSVideo.lookForGlobalGStreamer(GSVideo.java:162)
at codeanticode.gsvideo.GSVideo.setLinuxPath(GSVideo.java:114)
at codeanticode.gsvideo.GSVideo.init(GSVideo.java:70)
at codeanticode.gsvideo.GSMovie.<init>(GSMovie.java:90)
at SlitScanVideo$WholeMovieLoader.load(SlitScanVideo.java:106)
at SlitScanVideo.setup(SlitScanVideo.java:198)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Signing the applet doesn't help (besides, I'm looking for a way to avoid signing altogether). As far as I can tell, the exception occurs when the GSVideo library is looking for a locally installed gstreamer library.
So, is it possible to use GSVideo within an applet, and if so, how? If not, are there any alternatives? I'd like to avoid the movie library shipped with processing, since I'm on Linux and have no access to any QuickTime tools.
I'm trying to import a whole video (that is, the pixels of all the frames) at once. I'm not interested in actually playing the movie, but it seems that all the available video libraries (core, gsvideo, ...) are very much focused on playback. What I'd like to have is a method for reading the video data which is independent of any framerate, i.e. a synchronous access. Some pseudo-code:
Movie movie = new Movie(this, "somefile");
for (int i = 0; i < movie.frameCount(); i++) {
movie.loadFrame(i);
movie.loadPixels();
println("First pixel of frame " + i + " has color " + movie.pixels[0]);
}
I haven't found a way of doing this using the available libraries. What am I missing?