Processing Video library inconsistent behavior with jumping

Hello everyone! I am experiencing some inconsistent behavior from the Processing video library.

What I’m trying to do:

  • I’m making a video sampler with a midi keyboard. When I play a key, the video jumps to a timestamp and plays.

What I’m getting:

  • When jumping to certain time stamps, there is almost no delay/latency, but jumping to others, the delay/latency is huge.

My code:

import processing.video.*;
import themidibus.*;
// load video clip in setup
void draw(){
    image(vid,0,0);
}
void noteOn(Note note){
    switch(note.pitch()){
        case 48:
            video.jump(107.3);
            break;
        case 49:
            video.jump(100.5);
            break;
        default:
            break; 
    }
}

Notes:

  • The video is 10 MB in size, 2 minutes long and has a resolution of 768x432 and mp4 format
  • I’m using the latest official version of Processing
  • I’m using a 2008 Black MacBook with
    • Intel core2 duo
    • 3gb RAM

Does anyone know why this might be? My current hypotheses are

  1. If the timestamps are simple (divisible by 2 and 5, eg. 100.0), the delay is small. Similarly, if the timestamps are not easily divisible (eg. 107.34), the delay is big.
  2. My computer is just too weak…