Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Can I pauze a movie frame by frame?

$
0
0

I am new to this forum but I really hope you can help me out on this one.

I'm trying to blend multiple movies into one. For blending multiple images I already got my code to work quite nicely I think (example below). Now I want to do the same for every frame in multiple movies. I experimented with this somewhat and I can get the movie frames to blend on click. Now I want to blend every frame. So my code is this:

import processing.video.*;

Movie movie1;
Movie movie2;

void setup (){
  size(1280,720);

  movie1 = new Movie(this, "MVI_8256.MOV");
  movie2 = new Movie(this, "MVI_8257.MOV");

  movie1.play();
  movie2.play();
}

void movieEvent (Movie m){
  m.pause();
  if (movie1.available() && movie2.available()){
    movie1.read();
    movie2.read();
    blend();
    movie1.play();
    movie2.play();
  }
}

void blend(){
  //code to blend
}

void draw (){
  image(movie1, 0, 0, 640, 360);
  image(movie2, 0, 640, 640, 360);
}

To me it looks as though the logic should work but i get a JNA: could not detach thread error. It seems that I can't pause a movie inside the movieEvent().

Hopefully one of you can help me out with some good advice!

result3


Viewing all articles
Browse latest Browse all 2896

Trending Articles