MM + GLGraphics

Help
2009-08-29
2012-12-26
  • Diego Alberti

    Diego Alberti - 2009-08-29

    Hi: why this doesn't works?

        public void draw(){       
            background(255);   
            texture.putPixelsIntoTexture(myMovie);   // video from GSMovie.... texture is a GLGraphics texture.
            mm.addFrame(texture.pixels);                 //movieMaker from GSMovie       
        }

    I'm getting an almost empty file.
    Pixel array size is equal to mm size. (maybe an exception should be add to mm.addFrame() if not
    recording && pixels.length == width * height)

    thanks.
    diex

     
    • Andres Colubri

      Andres Colubri - 2009-08-30

      This happens because texture.putPixelsIntoTexture(myMovie) copies the video frame in myMovie to the openGL texture pointed inside the texture object, but not to the texture.pixels array. Since texture copies from GPU to CPU are expensive, they are not done by default and need to be specified explicitly. To do so, you use texture.updateTexture() (I chose this name to make it analogous to PImage.updatePixels() which copies the content of the pixels array down to the canvas). Hence, the following should work:

      public void draw(){ 
      background(255); 
      texture.putPixelsIntoTexture(myMovie);
      texture.updateTexture();
      mm.addFrame(texture.pixels); //movieMaker from GSMovie 
      }

       
    • Diego Alberti

      Diego Alberti - 2009-09-03

      great ! thanks !

      Next question:

      I'm getting "half" the frames recorded on file.
      for instance:

      (setup)
      mm = new GSMovieMaker(this, 320, 240, "drawing.ogg", GSMovieMaker.THEORA, GSMovieMaker.MEDIUM, 30);
      .
      (draw)

      if(frameCount >= 0 && frameCount < 120)
              mm.addFrame(pixels);

      I get a 60 frames movie but @ 30fps. (it plays doubled speed.)
      In short: I'm not getting a video frame per draw() cycle. It's like frames were dropped during recording. Where should I look?

      thx.

       
    • Diego Alberti

      Diego Alberti - 2009-09-03

      great ! thanks !

      Next question:

      I'm getting "half" the frames recorded on file.
      for instance:

      (setup)
      mm = new GSMovieMaker(this, 320, 240, "drawing.ogg", GSMovieMaker.THEORA, GSMovieMaker.MEDIUM, 30);
      .
      (draw)

      if(frameCount >= 0 && frameCount < 120)
              mm.addFrame(pixels);

      I get a 60 frames movie but @ 30fps. (it plays doubled speed.)
      In short: I'm not getting a video frame per draw() cycle. It's like frames were dropped during recording. Where should I look?

      thx.

       
  • Anonymous - 2009-10-22

    I'va also bumped into this issue with exactly the same GSMovie parameters. :/ I'm playing the output video with VLC 1.0.0 and working with Processing 1.0.7 and JDK 1.6.0_14

     
  • Andres Colubri

    Andres Colubri - 2009-10-22

    I need to go back to the implementation of RGBDataFileSink.java in gstreamer-java. I'll try to do as soon as possible, and will let you know of any advances.

     
  • Anonymous - 2009-11-01

    Thank you. I'll check this forum from time to time.

    Best regards

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks