RFID Video Daemon

googling: processing movie ArrayOutOfBoundsException: Coordinate out of bounds - Google Search!
the first link: http://processing.org/discourse/yabb2/YaBB.pl?board=Video;action=display;num=1232118515
the last post:

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

:smiley:

Lesto, that was a really good try but now its throwing another error that is worse, it is a PApplet$RendererChangeException

I have googled this and apprently there is a fix waiting for it?

+1 on this; it makes it difficult to use 0152 + OpenGL with JRuby. But, I understand we're in the midst of change. I can be patient.

Without the P2D it throws an out of bounds exception.

Seems like one thing after another, I'm so glad the number is printing correctly.

We're on the verge of a breakthrough I feel.

You have been very helpful and I hope we can get this to work.

THank you.

Researching the error exception:

public static class PApplet.RendererChangeException
extends java.lang.RuntimeException

Exception thrown when size() is called the first time.

This is used internally so that setup() is forced to run twice when the renderer is changed. This is the only way for us to handle invoking the new renderer while also in the midst of rendering.

Found on: http://processing.googlecode.com/svn/trunk/processing/build/javadoc/core/processing/core/PApplet.RendererChangeException.html

sorry, can't understand the solution you post, maybe because i'm drunk, maybe because i can't understand his context, maybe because I'm not good in English :smiley:

another work-around in the discussion i posted is using an external libraries that seems better(for performance and stability), jmcvideo http://www.mat.ucsb.edu/~a.forbes/PROCESSING/jmcvideo/jmcvideo.html

Hey,

The solution could worsen the problem, I follow instructions and still have a missing library, maybe because I use Windows, maybe it is not good, maybe I should have purchased a mac.

External libraries sounds good, I believe it could work, on the other hand problems are all I seem to be having.

Thank you for the idea!

Unfortunately the creator of jmcvideo left this comment over a year ago :

Hi all, sorry about the Windows bug that I haven't had a chance to fix. I just completed my Masters, so I will have time to work on it soon. I read that there are rumors that JMC will be officially included with Java 7 sometime next year, which would make it much easier to develop/troubleshoot. And also JavaFX 1.3 is due to ship sometime soon (a preview was shown at Devoxx apparently) so hopefully that includes some fixes for JMC. In the meantime it is still true that jmcvideo is broken on Windows Undecided I'll post here when the issue is resolved. Thanks, Angus

Can it be done without a Macintosh?

Hello,

Does anybody know if jmcvideo has been updated to work on windows???

I am trying to play a video from an RFID reader tag and I am recieving a PApplet.RendererChangeException Error.

If I can update jmcvideo to work on windows it should be able to solve this problem.

All code is available in previous post's or I can repost the code.

I really want to get this to work.

Any help is appreciated.

Thank you

maybe I've found a solution using the Movie class; simply it was necessary install quiktime

http://wiki.processing.org/w/Video_Issues

I use Quicktime for .3gp files from mobile phones, it is installed and isn't the thing throwing the error out of the program.

For some reason processing doesnt like to load video's on windows machines, I'm thinking that if i used a mac computer with the jmcvideo libraries folder updated and installed that there might shed some light on the matter, unfortunately I dont have the capabilities of reaching a mac computer.

I don't know what processing's problem is with playing video's on windows, but i'm not happy about it.

Mission is a failure, I think its safe to admit.

Abort.

the last hope: instead of using integrated player, just open the file using your default player:
open("C:\Users\Rich\Documents\Processing\sketch_apr05a\3600A9C9F8.mov");

http://processing.org/reference/open_.html

Lesto you are a genius. :grin:

I didn't know variable scope was inside the { } parameters........

Apparently don't run the myPort = new Serial code BEFORE the size( , ); thats a no-no.

I had a lot of things in the Draw method that were needed in the Setup method.

I thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Here is slightly edited code, P2D = fail, P3D = win!

it took 4 page, but at least it work!! :grin:

Youve been such a great help lesto.

The movie playing is only 1/4 of the size of the screen, I'm going to try and use the Movie.setSize() Method that you described earlier.

I'll try myMovie.setSize(400,400); and see what happens.

I'll also try and see if I can get different video's to display when different tags are used.

The only problem at the moment is it won't load twice but as long as it loads once thats decent.

Thank you once again for your help!

Okay, the video is loading the different tags video's fine. However when it comes to doing it simultanously, it throws a NullPointerException at line myMovie = new Movie(this, command+".mov");

This is because for some reason it can read the code perfectly once, but reading the second tags code doesnt work it will only read a percentage of the numbers and ignores the rest.

There is a problem with repeating this process I'm trying to work out why.

Thanks for any advice you can give.

The error from the nullpointerexception looks as follows:

The file "360073D.mov" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.

The data that should be being read is: 360073D274

I have tried putting the line String command = ""; in different places but it doesnt help the problem.

I would rather load the different video's without having to stop and start the file each time.

Does anybody know of a refresh code or reload code that will stop this from happening?

Thank you

And how to change the movie size would also be helpful but not as urgent as the previous post.

Thanks Again

why don't you load at the beginning all the video in different Video class and then show only the necessary one?

are you using jmcvideo?

Hey thats a good idea, use the command as a pointer to the video reference???

I installed jmcvideo, and then started getting errors but after a restart it seemed to work, not sure if its because i changed the code or because i restarted.

Its the command variable that isn't being read properly, I'm not sure if it would point correctly to each video because of this.

I think a call to the Setup method might work: setup();

Thanks again!

Sorry, the call to the setup(); function was wrong, I got the idea from searching "reset processing" and found this: http://processing.org/discourse/yabb2/YaBB.pl?board=Syntax;action=display;num=1196705625

It is a bad idea to call the setup function again, it is better to create a new function and use that, but this is only useful for resetting variables.

I'll have to try and debug or look for another function that restarts or resets the program.

I'm not sure why the code has a problem the second time round.

New page so i'll repost the code here.

import processing.serial.;
import processing.video.
;
import jmcvideo.*;

Serial myPort; // The serial port
Movie myMovie;

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

void setup() {
size(400,400,P3D);
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[1], 2400);

background(0);

}

void draw() {
while (myPort.available() >= 10) {
//Video Code:
String command = "";
for (int i=0;i<10;i++){
command += myPort.readChar();
}
println(command);
myMovie = new Movie(this, command+".mov");
//myMovie.setSize();
myMovie.play();
}

if (myMovie != null){
image(myMovie, 0, 0);
}

}

Thank you for any suggestions or solutions posted.

i think because you are reading the frame here:

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

but when you change Moviethis desinc with the call

  if (myMovie != null){
      image(myMovie, 0, 0);
  }

the solution can be removing the movieEvent and instead

if (myMovie != null){
  if(myMovie.available()) {
    myMovie.read();
  }
  image(myMovie, 0, 0);
}