Problems with java using jmcvideo library: constructor error

edited September 2015 in Library Questions

I am creating a sketch using the kinect with the simpleopenni library and jmcvideo library to do video scrubbing. I found a basic example and edited it to work with the kinect. Everything worked fine on my Mac, but now that I am trying to move everything over to a PC I can't get the libraries to work right. I finally got java to work on the PC using the library, but I am now getting an error that reads "The constructor JMCMovie(videojumpkinect, String, int) is undefined and it hightlights "return new JMCMovie(this, filename, RGB);" and I can not figure out why it doesn't like that part of the code because it worked fine on my Mac.

I tried using other libraries, such as the default video library and a sketch I found for that, which didn't work. And then the gsvideo library, which gave me no errors, but only showed a black screen (the background). I'd prefer to use this library, because I know it at least works on Macs. Any help would be greatly appreciated as my knowledge of code is very limited.

import SimpleOpenNI.*;
SimpleOpenNI kinect;

import jmcvideo.*;
import processing.opengl.*;
JMCMovie myMovie;
double movieDuration;
float ratio =0.0;
float old_mouse_pos = 0;

void setup() {
  kinect = new SimpleOpenNI(this);
  kinect.enableDepth();
  kinect.enableUser();

  size(640, 480, P2D);
  //size(640,480,P2D);
  //background(0);
  // stroke(255, 0, 0);
  //strokeWeight(5);
  //textSize(20);

  myMovie = movieFromDataPath("drop.mov");

  myMovie.pause();

  movieDuration = myMovie.getDuration();
}

JMCMovie movieFromDataPath(String filename)
{
  return new JMCMovie(this, filename, RGB);
}

void draw()
{
  kinect.update();

  PImage depthImage =kinect.depthImage();
 // image(depthImage, 640, 0);

  IntVector userList = new IntVector();
  kinect.getUsers(userList);

  if (userList.size()>0) {
    int userId = userList.get(0);

    if (kinect.isTrackingSkeleton(userId)) {
      PVector leftHand = new PVector();
      //  PVector rightHand = new PVector();

      kinect.getJointPositionSkeleton(userId, SimpleOpenNI.SKEL_LEFT_HAND, leftHand);

      //  kinect.getJointPositionSkeleton(userId, SimpleOpenNI.SKEL_RIGHT_HAND, rightHand);

      // println(leftHand.y, rightHand.y);

      image(myMovie, 0, 0, 640, 480);
      //  image(myMovie, 0, 0, myMovie.width, myMovie.height);
      if (old_mouse_pos !=leftHand.y) {
        ratio=(float)(height+leftHand.y)/(2*height);
        myMovie.setCurrentTime((1-ratio)*movieDuration);
      }
      old_mouse_pos=leftHand.y;
    }
  }
  if (userList.size()

Answers

  • I looked around a bit more, and it seems that this is a common problem for those using windows 7. Instead I think I'll just look for another library. I just wanted to share in case anyone else has a hard time finding this information. I thought I had tried the default video library from processing only to get a grey screen, but when I tried it again it actually scrubbed flawlessly on both Mac and PC (this is using Processing 2). So I will probably try to modify my sketch using that. Here is a link to the code I found that worked better than what I found when I glanced over processing's website. http://learningprocessing.dreamhosters.com/examples/chapter-16/example-16-5/ Shiffman seems to have a solution to all my problems, I don't know why I didn't find that sooner.

Sign In or Register to comment.