We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Multiple videos with JMC?? (Read 765 times)
Multiple videos with JMC??
Apr 3rd, 2009, 10:39am
 
Hey I am trying to load up to two live video streams and upto 12/14 .mov/avi files into animated bubbles. The problem is that with 2 live streams and just images loaded in the stystem almost comes to a standstill. Have tried on a Mac and PC  with different video formats etc. What is the maximum nuber of videos that JMC can handle at the one time? For testing I have substituted the live stream with video and video array with images but its still running like a lame duck.

Code:
 
   import jmcvideo.*;
   import processing.opengl.*;
   import javax.media.opengl.*;
 
   int INSET = 20;
   String VIDEO_FILE = "milesdavis.flv";
   PImage brushMask;
   PImage bubble;
   //PImage head;
   JMCMovie vid ,vid2;
 
   int maxImages = 4;
   int imageIndex = 0;
   PImage[] images = new PImage[maxImages];
 
  Bubble mybubble1;
  Bubble mybubble2;
 
//   PImage bubble, bubble2;
 
  int numBalls = 4;
  float spring = 0.05;
  float gravity = -0.0015;
  float friction = 0;
  Ball[] balls = new Ball[numBalls];

 
 
  void setup() {
    mybubble1 = new Bubble(5, 7, 1);
    mybubble1.setKeycodes('w','s','a','d');
    mybubble2 = new Bubble(10, 50, 2);
    mybubble2.setKeycodes('i','k','j','l');
    size (600, 600);
    frameRate (20);
   
    for (int i = 0; i < numBalls; i++) {
    balls[i] = new Ball(random(0,width), random(-height,height), int(random(50, 200)), i, balls);
 }
    for (int j = 0; j < images.length-1; j++ ) {
    images[j] = loadImage( "video\\animal" + j + ".jpg");
}
  }
   
  void draw (){
    background(0);
    mybubble1.move();
    mybubble1.display ();
    mybubble2.move();
    mybubble2.display();
   
   for (int i = 0; i < numBalls; i++) {
     balls[i].move();
     balls[i].display(images[i]);  
    }
  }


Any help would be much apprciated.

Re: Multiple videos with JMC??
Reply #1 - Apr 3rd, 2009, 11:19am
 
Hi ekinsy,

Try using JMCMovieGL instead of JMCMovie from the current jmcvideo release. Also, you might want to try small videos and/or increasing the available memory to Processing. One of my examples loads 4 videos simultaneously and seems to be okay. But I can imagine that much more than that might be start causing problems. Are you really playing all 14 videos at the same time? If not, you could have a one or just a few JMCMovie instances and switch to new videos as necessary, and capturing still images as placeholders while the "bubbles" are not active. In the code you posted I don't see where you are actually using JMCMovie. Feel free to email me your code if you want me to test it. HTH, Angus


Re: Multiple videos with JMC??
Reply #2 - Apr 22nd, 2009, 7:32am
 
Hey angus i've emailed a couple of the sketches, its still running slow - might just use two video streams and still shots from web cam instead.
Page Index Toggle Pages: 1