how to make a video: play + jump + play + jump …

edited October 2015 in Library Questions


I am also new to processing and would be very thankful if someone could help me with the following issue.

With the help of the video library I am trying to play a video that randomly jumps forwards, plays a limited and random amount of time and jumps randomly forward and plays again randomly until it reaches its end and repeats/loops.

Jumping is random inbetween the parameters of 15 and 30 seconds. Playing between 5 and 13 seconds. I only got him jumping but not playing inbetween the jumps … althought the code I can give is without jumping so far:

int clip_duration_max = 13;
int clip_duration_min = 5;
int clip_jump_max = 30;
int clip_jump_min = 15;

Movie sequence;

void setup() {
  //size(displayWidth, displayHeight);
  size(640, 480);
  sequence = new Movie(this, "sequence.mp4");

void draw() {
  image(sequence, 0, 0);; 
  int sequence_duration = int(sequence.duration()); // get sequence duration
  int sequence_time = int(sequence.time());
  int jumper = int(random(clip_jump_min, clip_jump_max));  
  int sequence_length = int(random(clip_duration_min, clip_duration_max));
  int next_jumping_point = sequence_time + jumper + sequence_length;

Can anybody help me guiding to the next steps?

Thank you!

Sign In or Register to comment.