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.
IndexSuggestions & BugsSoftware Bugs › Video problems - bug
Page Index Toggle Pages: 1
Video problems - bug? (Read 1395 times)
Video problems - bug?
May 22nd, 2005, 3:41pm
 
I'm having problems with a webcam/videocam connected to Processing.

The following (stripped down and simple) code:

import processing.video.*;

Capture myCapture;

void setup() {
 size(320, 320);  
 myCapture = new Capture(this, width, height, 24);
}
void captureEvent(Capture myCapture) {
 myCapture.read();
}
void draw() {
 image(myCapture, 0, 0);
}

---

gives me the following error EVERY OTHER TIME when I run the code (as the QT library was not closed or initiated properly) and EVERY TIME when there is no webcam or video cam connected:


quicktime.std.StdQTException[QTJava:6.1.0g1],-9405=couldntGetRequiredComponent,QT.vers:6528000
quicktime.std.StdQTException[QTJava:6.1.0g1],-9405=couldntGetRequiredComponent,QT.vers:6528000

at quicktime.std.StdQTException.checkError(StdQTException.java:38)
java.lang.ArrayIndexOutOfBoundsException: -1
at processing.app.Runner.message(Runner.java:491)
at processing.app.MessageSiphon.run(MessageSiphon.java:60)
at java.lang.Thread.run(Thread.java:552)


---

any ideas? Is it me doing something wrong?
(should I need to have a try statement in the initialization of the video to see if there is a connected camera? - I would think this should be a task that Processing should perform under the hood).

And I am on OS X 10.3.8 - Processing BETA 90.
njetti
Re: Video problems - bug?
Reply #1 - May 22nd, 2005, 4:24pm
 
I don't see the device you've specified to access:
Code:

import processing.video.*;
void setup() {
size(200, 200);
print(Capture.list());
}

To get your list of attached devices.

To access the device in setup:
Code:

//eg:
String s = "TRUST 120 SPACEC@M-WDM";
myCapture = new Capture(this, s, captureWidth, captureHeight, 12);


Processing returns that exception whenever it can't find a device or you specify a non-existent device. If you use the Capture list code and it returns "null" at the bottom of the error then Processing definitely can't see any device. After that you need to check whether your device is OSX compatible on the manufacturer's web site (tip: all Trust web cam devices are not Mac compatible according to their website).

looking on the web I found a broad webcam driver for OSX. Though in truth, OSX is usually clever enough to see most devices. I haven't tested it yet.

http://webcam-osx.sourceforge.net/
Re: Video problems - bug?
Reply #2 - May 22nd, 2005, 6:23pm
 
thanks st33d.

I tried adding this to the code:

void mousePressed() {
 println(Capture.list());      
}

and it only gives me "null" as result.

I am using a Sony DV cam connected through the Firewire, by the way.
(and it works in 1 out of 2 times when I run the program).

I still can't see why I am getting this error when there is no camera connected.
Re: Video problems - bug?
Reply #3 - May 23rd, 2005, 11:54pm
 
when there is no camera connected, there aren't going to be any cameras listed. how would it know that there's a dv cam sitting on your desk? Smiley
Re: Video problems - bug?
Reply #4 - May 24th, 2005, 12:10am
 
: ) Well, that's quite funny. Yes yes.

But if you read my post above, I am asking why the error report appears and what it means. And I cannot run my program if a Webcam is not connected (which did not happen in 0087). Everything crashes. I think it should just run silently and just omit displaying the webcam image.

I am also asking why this error report appears in 1 out of 2 times WHEN the camera is actually connected.

I am also wondering if I should use a try statement to detect if there is a camera, but then I think that's something Processing should do under the hood, just as it appears to do in 0068.

(to be honest, I find the BETA quite problematic in my programs, I cannot use the webcam properly unless I use P3D, and the P3D renderer does not even draw rects properly, so I try OpenGL, but it cannot detect set and pixels. I have basically gone back to 0068. But I am looking forward to these things being fixed. Keep up the good work).

Edit : I accidentially wrote version 0078 where I meant 68. I changed it
Re: Video problems - bug?
Reply #5 - Jun 7th, 2005, 5:59am
 
k, added an error message to list() as well for 91.
Page Index Toggle Pages: 1