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 › ArrayIndexOutOfBoundsException error using video
Page Index Toggle Pages: 1
ArrayIndexOutOfBoundsException error using video (Read 5413 times)
ArrayIndexOutOfBoundsException error using video
Jan 16th, 2009, 4:08pm
 
I have a problem playing back quicktime files using the standard processing video library. The .mov's I use are quite large 1171 x 715. Sometimes the movie will run fine if adjust the size() or tinker with movieEvent code (replacing the manCirkel movie variable with the manVierkant movie variable or vica versa). But when I try it again it will give me the following error: "ArrayIndexOutOfBoundsException: Coordinate out of bound!". It is very inconsistent, sometimes it will work several times in row, and some times not for a couple of times. If it works and and I replace one movie with another in draw() it almost always breaks with that error. Also it will sometimes give me the following error "Invalid memory access of location ffffffff eip=9493bb2d" after running a while.

I am learning processing, and want to work towards building a vj program (with video filters and crossfade capabilities). But reading up on the problems and limitations with video in processing, I wonder if I am wasting my time with this program. Or maybe I should try another video library, if so which is suitable?

I am using version 1.0.1 of processing with java version 1.5.0_16 on an intel 8-core 2.8 GHz mac pro with 2 GB of memory, not sure which other info is relevant but I am happy to provide additional intel.

I am using the following (slight) adaptation of example code. I know it doesn't make any sense to add two movies if I am only playing one, but I want to build in buttons to play  different movies later on (like a video library).

What's wrong, did I make a noob mistake or...?

-----------------------------------------------------------
import processing.video.*;
Movie manCirkel, manVierkant;

void setup() {
 size(1171, 715);
 manCirkel = new Movie(this, "man met cirkel.mov");
 manVierkant = new Movie(this, "man met vierkant.mov");
 manCirkel.loop();
 manVierkant.loop();
}

void draw() {
 image(manVierkant, 0, 0);// sometimes substituted for manCirkel for
}                          // testing purposes

void movieEvent(Movie m) {
 if(m == manVierkant) {
   manVierkant.read();
 } else if(m == manCirkel) {
   manCirkel.read();
 }
}
----------------------------------------------------------

This is the java code for the "ArrayIndexOutOfBoundsException" error.

----------------------------------------------------------
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!

at sun.awt.image.IntegerInterleavedRaster.setDataElements(IntegerInterleavedRaster.
java:416)

at processing.core.PGraphicsJava2D$ImageCache.update(PGraphicsJava2D.java:929)

at processing.core.PGraphicsJava2D.imageImpl(PGraphicsJava2D.java:807)

at processing.core.PGraphics.image(PGraphics.java:2150)

at processing.core.PApplet.image(PApplet.java:7100)

at load_movie_try2.draw(load_movie_try2.java:31)

at processing.core.PApplet.handleDraw(PApplet.java:1406)

at processing.core.PApplet.run(PApplet.java:1311)

at java.lang.Thread.run(Thread.java:613)

-----------------------------------------------------------

Re: ArrayIndexOutOfBoundsException error using vid
Reply #1 - Jan 17th, 2009, 3:06pm
 
I am having the exact problem, but only when I use Present as opposed to Run. Is this the case for you as well?

* I got into this thread and made some progress. However, I still have the menu bar when running the sketch itself:

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

Re: ArrayIndexOutOfBoundsException error using vid
Reply #2 - Jan 17th, 2009, 6:27pm
 
Haven't used present with my project before, but when I try it I get exactly the same error as when I try run (so for me it's in both cases). I've read somewhere that the standard video library is not good at playing large movies, but couldn't trace this error. I'll try running it with smaller videos and post the result. But as it is, I'm looking for another library to handle video anyway, since the more I read about the video library the less I think I could build a vj app with it.  

Fietspomp
Re: ArrayIndexOutOfBoundsException error using vid
Reply #3 - Jan 17th, 2009, 6:49pm
 
Okay have tried it now with 300 x 200 one frame movies (code is identical except now the movie variables point to these movies, instead of the old ones). It works more often now, but still I have to fiddle with size() to get it to work, the values seem arbitrary, sometimes it works with 300,200 sometimes not. And still when I change one movie out for the next it never works, until I fiddle with size(). This seems to me like really weird inconsistent behaviour. Still wondering whether this is a bug, or if I botched the code somehow.

Fietspomp

EDIT: and after running it for some time, I caught another Invalid memory access of location 00000000 eip=9493e2f2 error
Re: ArrayIndexOutOfBoundsException error using vid
Reply #4 - Feb 6th, 2009, 8:51pm
 
I'm seeing the same thing (OSX 10.5.6, QT 7.6.0) using a file generated by QT on this Mac.  Making the size() larger than the movie makes it go from "never works" to "works more often than not".

QT, however, plays the file without a complaint, as does VLC and MPlayer.  (I can attach/email the QT file is need be.)

my backtrace looks like this:

Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at sun.awt.image.IntegerInterleavedRaster.setDataElements(IntegerInterleavedRaster.
java:416)
at processing.core.PGraphicsJava2D$ImageCache.update(PGraphicsJava2D.java:920)
at processing.core.PGraphicsJava2D.imageImpl(PGraphicsJava2D.java:807)
at processing.core.PGraphics.image(PGraphics.java:2150)
at processing.core.PApplet.image(PApplet.java:7100)
at test_movies.draw(test_movies.java:60)
at processing.core.PApplet.handleDraw(PApplet.java:1406)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Thread.java:613)
Re: ArrayIndexOutOfBoundsException error using vid
Reply #5 - Feb 7th, 2009, 7:52pm
 
Same Issue, MacBook Pro, 4GB Ram, OSX 10.5.6,  2.53MGHZ

Messing around with the frame rate got P5 to show me the video, but chopped up the play back so it's not fluid now. (frameRate at 1 and 2 fps). The P3D trick seems to be doing it, will make further tests. it would be nice of the P5 team to give us mac users some feedback...video+processing is one reason I got such a great machine, so this issue, with a deadline on the horizon, is more of an inconvenience when we haven't really heard anything concrete from the team.

also...what does having to use P3D entail?
Re: ArrayIndexOutOfBoundsException error using vid
Reply #6 - Feb 10th, 2009, 3:50am
 
I'm getting the same exception:

Code:
Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!

at sun.awt.image.IntegerInterleavedRaster.setDataElements(Unknown Source)

at processing.core.PGraphicsJava2D$ImageCache.update(PGraphicsJava2D.java:929)

at processing.core.PGraphicsJava2D.imageImpl(PGraphicsJava2D.java:807)

at processing.core.PGraphics.image(PGraphics.java:2150)

at processing.core.PApplet.image(PApplet.java:7100)

at TestSketch01.draw(TestSketch01.java:34)

at processing.core.PApplet.handleDraw(PApplet.java:1406)

at processing.core.PApplet.run(PApplet.java:1311)

at java.lang.Thread.run(Unknown Source)


I'm using Processing 1.0.1 under Vista. I've tried multiple Quicktime movies, with the same crash every time.
Re: ArrayIndexOutOfBoundsException error using vid
Reply #7 - Feb 22nd, 2009, 4:10am
 
I'm yet another user getting the same error, and also wondering what other libraries or apps are out there. I'm on a new MacBook, 2.4GHz Intel Core 2 Duo with 4Gb of RAM.

Thanks, everyone for making this project possible!
Re: ArrayIndexOutOfBoundsException error using vid
Reply #8 - Mar 2nd, 2009, 12:58am
 
Note that I've started using the cross-platform JMCMovie library. It's much faster and seems more stable than the native Movie libs:

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

Re: ArrayIndexOutOfBoundsException error using vid
Reply #9 - Mar 2nd, 2009, 1:30am
 
Hi enguyen,

If you have any interesting short demos using the jmcvideo library, feel free to send them to me so I can add them to the demos section of the jmcvideo webpage (http://www.mat.ucsb.edu/~a.forbes/PROCESSING/jmcvideo/jmcvideo.html).

-Angus
angus.forbes@mat.ucsb.edu
Re: ArrayIndexOutOfBoundsException error using vid
Reply #10 - Mar 8th, 2009, 4:04am
 
Hi, Angus. The sketch I threw together is here:

http://mindtangle.net/2009/02/23/moviepainter/

It's a little demo of using the frames of a movie to "paint" into the frame. I'm also having problems with a memory leak, but I'll find a more appropriate forum to post that.
Re: ArrayIndexOutOfBoundsException error using vid
Reply #11 - Mar 19th, 2009, 10:58pm
 
Hi all,

I've been getting the "ArrayIndexOutOfBoundsException: Coordinate out of bounds!" error in the same inconsistent manner most of you describe.

At one point, Perian crashed while I was testing a sketch...so I uninstalled it (System Prefs > Perian > Etc.) and restarted Processing.

Magically, I haven't gotten the exception in the last hour or so and my playback is even more fluid...

Bizarre...
Re: ArrayIndexOutOfBoundsException error using video
Reply #12 - Jul 28th, 2009, 5:07pm
 
This is several months later, but I'm still having this problem.  The fix for me came in defining the size--I had to specify P2D.

so use this: size(600,400,P2D); instead of size(600,400);

Hope that helps someone
Page Index Toggle Pages: 1