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.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › cannot cope with basic Video Library example
Page Index Toggle Pages: 1
cannot cope with basic Video Library example (Read 3333 times)
cannot cope with basic Video Library example
Nov 10th, 2008, 11:44pm
 
Hi all,
I'm a newbie with Video Library so I'm trying to start with the basic 'play' example:  

import processing.video.*;

Movie myMovie;

void setup() {
 size(1024,768);
 background(0);
 myMovie = new Movie(this, "../video/restarting.mov");
 myMovie.play();
}

void draw() {
 image(myMovie, 0, 0);
}

void movieEvent(Movie myMovie) {
 myMovie.read();
}

When I run this example I hear a perfect audio but no video is displayed at all and I get the following error:
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
even though the movie size is 848x480 and the canvas is far more bigger.

The movie is a QT movie and I run it with no problem with any player. Processing 0155 on a MacBookPro with Leopard 10.5.5.
Any help is appreciated

Best

Marco
Re: cannot cope with basic Video Library example
Reply #1 - Nov 12th, 2008, 7:47pm
 
I'm also getting this error. I also have the same setup – a new Macbook Pro with Leopard 10.5.5 and Quicktime Pro.

Here is the code I used:

import processing.video.*;
Movie myMovie;

void setup() {
 size(767,475);
// frameRate(30);
 myMovie = new Movie(this,"killians.mov");
 // Prints the duration of the movie
 println(myMovie.duration());
 myMovie.play();
}


void draw(){
 if(myMovie.available()){
   tint(255,20);
   image(myMovie,0,0);
 }
}

//Called everytime a new frame is available to read
void movieEvent(Movie m){
 if(m.available()){
    m.read();  
 }
}
Re: cannot cope with basic Video Library example
Reply #2 - Nov 12th, 2008, 9:08pm
 
Hi, every one...I´m newbie too, and I have the same operative system...
a very good friend of mine help me...because I had the same problem as you guys...here the solution try a small video...and check bug 40 in video library
enjoy! Smiley


import processing.video.*;

Movie myMovie;

void setup() {
 size(320, 240, P3D);
 background(0);
 // Load and play the video in a loop
 myMovie = new Movie(this, "prueba.mov");
 myMovie.loop();
}

void movieEvent(Movie myMovie) {
 myMovie.read();
}

void draw() {
 
 image(myMovie,0,0);
 //delay (240);
}
Re: cannot cope with basic Video Library example
Reply #3 - Nov 15th, 2008, 9:12am
 
Hi all,

no way. I tried with a smaller video (320x240) and the 'P3D' switch. The result is that the video is played in jumps, one or several frames every 3,4 secs, and after 20s (sometimes even 10) the app crashes giving "Invalid memory access of location 00001733 eip=93dd5e0c" error.

May I use Windows or do you know of some way to control a  player from Processing? I'm happy with Processing for many requirements of my application, but controlling video is mandatory...

Thanks for your replies

Marco
Re: cannot cope with basic Video Library example
Reply #4 - Dec 2nd, 2008, 12:51am
 
marco.giordano wrote on Nov 10th, 2008, 11:44pm:
Hi all,
I'm a newbie with Video Library so I'm trying to start with the basic 'play' example:  


Hi Marco, Hi everyone.

Guess it's not just me then Wink I'm also a Mac Processing person and I've just upgraded from the beta of Processing to find my code no longer works.

I get the same error. Clearly some change in the jump to release code has broken the example for us Mac users. I've filed a bug report with the Processing team, so let's hope it's something simple.

Mike.
Re: cannot cope with basic Video Library example
Reply #5 - Dec 5th, 2008, 1:00pm
 
Hi all,

for the time being, I found a workaround using Faster Movie class.
See the two following topics for further reference:

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Video;action=display;num=1180961743

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=os_core_pde;action=display;num=1175633922

Bye
Re: cannot cope with basic Video Library example
Reply #6 - Dec 5th, 2008, 6:00pm
 
Hey, i don't know if this is what you are looking for, but:

import processing.video.*;
Movie myMovie;

void setup() {
 size(384, 288);
 myMovie = new Movie(this, "001.mov"); *//this movie is in the folder with the sketch and then Data//*
 myMovie.play();
}

void draw() {
 image(myMovie, 0, 0);
 if (myMovie.time()==myMovie.duration()){
   background(0);
   noLoop();
 }
 println(frameCount);
}

// Called every time a new frame is available to read
void movieEvent(Movie m) {
 m.read();
}
Re: cannot cope with basic Video Library example
Reply #7 - Feb 4th, 2009, 10:10am
 
For me adding P3D to the size() command solved the problem

size(500,500,P3D);
Re: cannot cope with basic Video Library example
Reply #8 - Mar 22nd, 2009, 10:17am
 
I am bumping this becuase it helps a lot. P3D fixes hours of issues I was trying to correct.
Thanks
Page Index Toggle Pages: 1