Loading...
Logo
Processing Forum
ithinkiam's Profile
8 Posts
14 Responses
0 Followers

Activity Trend

Last 30 days
Show:
Private Message
    Hi,

    I'm running a sketch which loads lots of movies one after another, but I'm noticing that each new movie adds additional threads.

    Over time this really slows things down as the cpu gets overloaded.

    How do I destroy a Movie object before creating a new one?
    Hi all,
    In the past I've been able to get Processing 1 to work from within Eclipse. However, now when I try to do the same with Processing 2.0 I can't get it working.

    The issue is with trying to play videos. Whatever I try it fails with loads of errors:
    1. Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: com/sun/jna/Platform
    2.     at processing.video.LibraryPath.get(LibraryPath.java:43)
    3.     at processing.video.Video.buildMacOSXPaths(Video.java:169)
    4.     at processing.video.Video.initImpl(Video.java:108)
    5.     at processing.video.Video.init(Video.java:69)
    6.     at processing.video.Movie.initGStreamer(Movie.java:554)
    7.     at processing.video.Movie.<init>(Movie.java:98)
    8.     at eclipsetest.EclipseTest.setup(EclipseTest.java:15)
    9.     at processing.core.PApplet.handleDraw(PApplet.java:2241)
    10.     at processing.opengl.PGL$PGLListener.display(PGL.java:3240)
    11.     at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:573)
    12.     at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:558)
    13.     at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:286)
    14.     at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1021)
    15.     at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:896)
    16.     at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:545)
    17.     at processing.opengl.PGL.requestDraw(PGL.java:1197)
    18.     at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1550)
    19.     at processing.core.PApplet.run(PApplet.java:2140)
    20.     at java.lang.Thread.run(Thread.java:680)
    21. Caused by: java.lang.ClassNotFoundException: com.sun.jna.Platform
    22.     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    23.     at java.security.AccessController.doPrivileged(Native Method)
    24.     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    25.     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    26.     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    27.     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    28.     ... 19 more
    My sketch is a simple one:

    1. package eclipsetest;
    2. import processing.core.PApplet;
    3. import processing.video.*;
    4. public class EclipseTest extends PApplet {
    5.     Movie movie;
    6.     public void setup() {
    7.           size(1500,1000,P2D);
    8.           background(0);
    9.           // Load and play the video in a loop
    10.           movie = new Movie(this, "1rjb.mp4");
    11.           movie.loop();
    12.     }
    13.     public void draw() {
    14.           image(movie, 100, 100, 1160, 700);
    15.     }
    16.     public void movieEvent(Movie m) {
    17.           m.read();
    18.     }
    19.     public static void main(String _args[]) {
    20.         PApplet.main(new String[] { eclipsetest.EclipseTest.class.getName() });
    21.     }
    22. }

    Anyone got any pointers?
    Cheers,

    Chris

    Hi all,

    I have an existing project that I want to resurrect. I currently have it working in 1.5.1, but I need to do some significant additional development.

    I'm tempted to move to v2.0 given the new OpenGL features and the fact that this will be the only way forward in the future.

    So, how risky would an immediate move to 2.0 be? The project makes extensive use of OpenGL rendering for playing movie files and better rendering of fonts etc.

    Any comments gratefully received.
    Cheers,

    Chris
    Is there any plan to get Processing on the Raspberry Pi?

    I've tried downloading the linux version, but as it's build for i386 it doesn't work. I have a project that I'd like to port over to the Pi and I'd love to be able to do it with Processing.

    For some reason the below code won't export as a movie. I get a blank Java window which just sits there doing nothing until a stop the Processing script. The code runs fine without attempting to save to a movie.

    Can anyone spot where I'm going wrong?
    TIA

    BTW this is on a Mac (10.5.8)

    1. import javax.media.opengl.*;
    2. import processing.opengl.*;
    3. import processing.video.*;
       
    4. float a;
    5. boolean bExportVideo = true;
    6. MovieMaker mm;
    7. int MAX_FRAME_NB = 2400;

    8. void setup() {
    9.   size(800, 600, OPENGL);
    10.   frameRate(24);
    11.   if (bExportVideo) {
    12.     mm = new MovieMaker(this, width, height, "movie.mov", 24,
    13.       MovieMaker.JPEG, MovieMaker.HIGH);
    14.   }
    15. }
       
    16. void draw() {
    17.   if (frameCount > MAX_FRAME_NB) {
    18.     if (bExportVideo) {
    19.     mm.finish();
    20.     delay(1000);
    21.     }
    22.     exit();
    23.   }
    24.   background(255);
    25.  
    26.   PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;  // g may change
    27.   GL gl = pgl.beginGL();  // always use the GL object returned by beginGL
    28.  
    29.   // Do some things with gl.xxx functions here.
    30.   // For example, the program above is translated into:
    31.   gl.glColor4f(0.7, 0.7, 0.7, 0.8);
    32.   gl.glTranslatef(width/2, height/2, 0);
    33.   gl.glRotatef(a, 1, 0, 0);
    34.   gl.glRotatef(a*2, 0, 1, 0);
    35.   gl.glRectf(-200, -200, 200, 200);
    36.   gl.glRotatef(90, 1, 0, 0);
    37.   gl.glRectf(-200, -200, 200, 200);
    38.  
    39.   pgl.endGL();
    40.  
    41.   a += 0.5;
    42.   if (bExportVideo) {
    43.     mm.addFrame();
    44.   }

    45. }
    I've got a .mov I wish to play with GSVideo rendered in OpenGL, however I get very slow performance. I've seen this thread:
    http://forum.processing.org/topic/gsvideo-poor-performance-with-opengl which helped a bit, but there aren't many details to go on.

    ANyone know how I can speed up the playing of a movie?

    This example code is very slow for example (OSX Leopard, Processing v1.2.1, GLGraphics 0.9.4, GSVideo 0.7):

    import processing.opengl.*;
    import codeanticode.glgraphics.*;
    import codeanticode.gsvideo.*;

    GSMovie myMovie;
    GLTexture tex;

    void setup() {
      size(640, 480, GLConstants.GLGRAPHICS);
      background(0);
      // Load and play the video in a loop
      myMovie = new GSMovie(this, "mymovie.mov");
      myMovie.loop();
     
      tex = new GLTexture(this);
    }


    void movieEvent(GSMovie myMovie) {
      myMovie.read();
    }


    void draw() {
      //tint(255, 20);
     
      tex.putPixelsIntoTexture(myMovie);
      image(tex, mouseX-myMovie.width/2, mouseY-myMovie.height/2,50,50);
    }

    Edit:
    I should say that the movie is big at 1920x1080. The same code with station.mov works ok.
    I have a series of files images categorised by subdirectory in the data directory of the sketch. Is it possible to load the images using a path *relative* to the main data directory rather than an absolute path.

    The sketch I'm working on will be running on different machines so the absolute paths will change and I want avoid hardcoding anything.

    Edit:
    Somehow this has been put in the wrong section. This should be Programming Questions. Is it possible to move it?