Loading...
Logo
Processing Forum
Hey Guys,

Ive been banging my head for the past couple of days...

cant seem to get processing to connect to the inbuilt camera on my macbook pro (2011) running OSX lion, running processing 1.5.1

Ive just simply cut and paste the code provided on the processing website for "capture()" just to get the video from the camer to be displayed in a window..

code I used below : straight from the processing website as is...



import processing.video.*;
Capture myCapture;

void setup() 
{
  size(200, 200);

  // The name of the capture device is dependent on
  // the cameras that are currently attached to your 
  // computer. To get a list of the 
  // choices, uncomment the following line 
  println(Capture.list());
  
  // To select the camera, replace "Camera Name" 
  // in the next line with one from Capture.list()
  // myCapture = new Capture(this, width, height, "Camera Name", 30);
  
  // This code will try to use the camera used
  myCapture = new Capture(this, width, height, 30);
}

void captureEvent(Capture myCapture) {
  myCapture.read();
}

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


the error i get : print screen shows the error..

error inside Capture.run()



the error i get in the console :

[0] "DV Video"
[1] "IIDC FireWire Video"
[2] "USB Video Class Video"
quicktime.std.StdQTException[QTJava:7.7.1g],-1=kUnspecifiedErr,QT.vers:7718000
at quicktime.std.StdQTException.checkError(StdQTException.java:40)
at quicktime.std.sg.SequenceGrabber.idle(SequenceGrabber.java:273)
at processing.video.Capture.run(Capture.java:357)
at java.lang.Thread.run(Thread.java:680)
Exception in thread "Thread-3" java.lang.RuntimeException: Error inside Capture.run()
at processing.core.PApplet.die(PApplet.java:2571)
at processing.core.PApplet.die(PApplet.java:2580)
at processing.video.Capture.errorMessage(Capture.java:431)
at processing.video.Capture.run(Capture.java:374)
at java.lang.Thread.run(Thread.java:680)
DVFreeThread - CFMachPortCreateWithPort hack = 0x1566b40, fPowerNotifyPort= 0x1565f60
DVFreeThread - CFMachPortCreateWithPort hack = 0x18b790, fPowerNotifyPort= 0x18bd60
DVFreeThread - CFMachPortCreateWithPort hack = 0x1569a90, fPowerNotifyPort= 0x1565a40



any suggestions on how to resolve this??

Cheers guys..

p.s. i dont have any apps the use the camer running in the background...





Replies(6)

Ive just realised that this is could be a graphics switching issue with macbook pro... as iam able to access the camera with excatly the same code with unity3d running in the background.. how wierd is that?!..

so i supposed anyone know a workaround to this? i can turn graphics switching off maually but... atleast its out there now... pewh


HI,

I know nothing about cameras.

I assume that you already have a cam at usb-ports on your mac.

Capture can take optionally an index
 index int : the index of the camera to be used

You have 30 there??

Maybe just leave the index out?

That could do the trick.

See:


http://ubaa.net/shared/processing/opencv/opencv_capture.html

LG, Chrisir


I have the exact same problem (funny i discovered it the same day as you).  I'm thinking the problem is coming from Quicktime for Java which is maybe not installed??

I don't know and i'm also looking to resolve this problem, so if i find the solution i will tell you and i would be so glad if you do that too for me :-)


I also have a 2011 macbook pro running on Lion

cheers
hey guys...

found a temporary solution... i came upon it by chance actually..

if you disable / uncheck the "automatic graphics switching" in the systems preferences menu the camera now works in processing!!!.. whoohoo..

i suspect it has to do something with the integrated and stand alone graphics cards in the new 2011 Macbook pro's...

just un-check it once your done.. else it will significantly reduce battery life..

if you come across a different solution let me know :)



p.s. chrisir : Im trying to use the integrated facetime camera on my macbook pro which came up with this error... haven't tried with a USB camera yet..  
It works,

thanks a lot
I am having same problem, and some people suggest me this video activex software  http://www.videocapx.com and its fix my problems...did you try?