We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm not sure if this is the right forum for this quesiton. I couldn't find a category dealing with P2 to P3 issues.
I have code that works in Processing 2 but does not work in Processing 3. Here is the code, and below is a photo of the error that I get:
/**
* Playback Speed
*
* Move the cursor across the screen to
* change the speed of the video playback.
* moving the cursor farther to the left plays the movie
* faster forward, moving it farther to the right plays it back
* faster backwards. Placing the cursor in the middle of the screen
* pauses the movie.
*/
import jmcvideo.*;
import processing.opengl.*;
JMCMovie myMovie;
void setup()
{
size(320, 240, P2D);
background(0);
// Load and play the video in a loop
myMovie = movieFromDataPath("lincoln_01.mov");
//myMovie.play();
myMovie.loop();
//myMovie.bounce();
}
JMCMovie movieFromDataPath(String filename)
{
return new JMCMovie(this, filename, RGB);
}
void draw()
{
image(myMovie, 0, 0, myMovie.width, myMovie.height);
myMovie.setRate (((width/2.0-mouseX)/(width/2.0))*3.0);
}
Answers
I think it's an issue with the "jmcvideo" library. It hasn't been updated since 2009: https://github.com/angusforbes/jmcvideo
I recommend modifying the code to work with the Video library.
The code above is a start. The
speed()
method allows you to set the playback speed with the Video library.Thanks REAS. This is very helpful! I'll implement the Video library instead.