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

Video library: speed() in conjunction with mouseX is delivering jittery playback, and I can't use -1

$
0
0

I have two questions with the below code:

import processing.video.*;
Movie myMovie;

void setup() {
  size(600, 400);
  frameRate(30);
  myMovie = new Movie(this, "1.mp4");
  myMovie.loop();
}

void draw() {
  if (myMovie.available()) {
    myMovie.read();
    float  x1 = map(mouseX, 0, width, 0, 3);
    myMovie.speed(x1);
  }
  image(myMovie, 0, 0);
}

1) How can I make the video play backwards? If I write the following code, I get this error message: (Processing core video:14294): GStreamer-CRITICAL **: get_segment_set_seek: assertion 'start <= stop' failed

    float  x1 = map(mouseX, 0, width, -1, 3)

2) Is there a way to make the playback a little more smooth? There is a lengthy delay between when the mouse is moved and when the video changes playback speeds.


Viewing all articles
Browse latest Browse all 2896

Trending Articles