We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Reverse_speed no work (Read 612 times)
Reverse_speed no work
Nov 29th, 2007, 3:10pm
 
Hi,

I have the following code that doesn't work with speed(-1) but
when i put (1) it works.Does anyone know something about this?

import processing.video.*;
Movie myMovie;

void setup() {
 size(200, 200);
 frameRate(30);
 myMovie = new Movie(this, "xxx.mov");
 myMovie.speed(-1.0);
 myMovie.loop();
}

void draw() {
 if(myMovie.available()) {
   myMovie.read();
 }
 image(myMovie, 0, 0);
}
Re: Reverse_speed no work
Reply #1 - Dec 2nd, 2007, 2:46pm
 
Hi,

I assume the same problem ! NEGATIVE VALUES DO NOT WORK AT ALL !

Founding in the Video library source file and see that it just uses the Java Quicktime API ... directly.

Line 31 of the Movie.java from the Movie library we can see :

Code:
import quicktime.*; 



saying that it use all the quicktime Java API

Again, we can see at line 60 the following declaration :

Code:
public quicktime.std.movies.Movie movie; 



that declare a quicktime movie object called "movie"

then on line 548, the Movie library team implements the speed method that tries to set the rate via the setRate() method of the quicktime.std.movies.Movie object.
Code:

public void speed(float rate) {
//rate = irate;
try {
movie.setRate(rate);

} catch (StdQTException e) {
errorMessage("speed", e);
}
}


Finally, we can see at the Apple Java documentation http://developer.apple.com/documentation/Java/Reference/1.3.1/Java131API_QTJ/qui... that the method is an alias of the QuickTime::SetMovieRate


This example, below, show that it's the QuickTime component which is broken, cause of it's correct response about the rate :
Code:

import processing.core.*;
import quicktime.*;

void setup() {
size(640, 480);
noStroke();
background(0);
myMovie = new Movie(this, "station.mov");
myMovie.loop();
myMovie.speed(-1);
try{
println("Rate : " + myMovie.movie.getRate());
}
catch (QTException e){
println("No rate available ! F**k !");
}
numPixels = width / blockSize;
myMovieColors = new color[numPixels * numPixels];
}


This prints :
Code:
Rate : -1 




I suppose that the error is provided by the Java VirtualMachine or the Quicktime connector within the Java implement.



What is your test plateform ?

Mine is : PowerPc Mac OS X.4.11, Quicktime 7.3, Java VM 1.5.0_07-164
Re: Reverse_speed no work
Reply #2 - Dec 6th, 2007, 4:59pm
 
I have tried with:windowsXP quicktime 6.5.2 jre1.5.0_08 with winvdig 1.0.1 and with MacBookPro Tiger latest quicktime and Java VM 1.5.0_07-164.I continue the search and if i'll find something i will post it.
Re: Reverse_speed no work
Reply #3 - Dec 9th, 2007, 6:23pm
 
you CAN use -1 for speed.
no problem.

BUT you'll have to start your movie at the end (lastframe),
scince the loop () doesn't work reverse.

otherwise, nothing happens

maybe this helps  you
Re: Reverse_speed no work
Reply #4 - Jan 12th, 2009, 3:32pm
 
hi dermarc!

sorry for a n00b question, but could you show me how to start a movie at the last frame?
I've been trying to figure this out but I'm pretty new to processing, and can't find it in the reference or in the forum ... hope I'm not too much of a hazzle.
Page Index Toggle Pages: 1