why did video play so lag?

I have several videos , want to play them one by one but the result is so lag,including movie and sound If it lag because the video is high resolution? or other problem?

plz help me,thanks

import processing.video.*;
    Movie[] myMovies=new Movie[4] ;
    int v=0;
    boolean isPlaying=false;


    void setup() {
      size(displayWidth, displayHeight);
      frameRate(30);
      background(0);

       for (int i = 0; i < myMovies.length; i ++ ) {
        myMovies[i] = new Movie(this, i+1 + ".mov");
        }
    }

    void draw() {

        myMovies[v].read();
        myMovies[v].play();
        image(myMovies[v],0,displayHeight/2-300, 1400 , 600);
        if(myMovies[v].duration() == myMovies[v].time())
        v++;


      }


    boolean sketchFullScreen() {
      return true;
    }
Tagged:

Answers

  • it's probably the size, yes.

    I'd move the duration to a variable rather than calling it in the condition every loop

    you'll also get an error when v reaches 4

Sign In or Register to comment.