Webcam capture

I’m trying to find a way to capture video from a webcam and just show it to the screen as a colorImage. I’m using a Sony SNC-RZ30N. I have searched OF and google all day and can’t seem to find any information that is solid, all the posts lead me in so many directions.
I can connect to the webcam through my browser and see the image so I know that part is working. I already have my program running using a USB camera but now I want to use the webcam for my input.
My question is straight.
How do I get my webcam image to show up in OF like my USB camera does?

Thank you so much in advance for any help,

If you have more than one camera plugged in, you might need to change the device that is used in videograbber.

You can use listDevices() to see what devices are recognised and then setDeviceID() to select the one you want to use for input

Thank you for the response but my problem is that the video device resides on a local network. I am assuming that I need to connect to the device through some sort of network library. Right now I go to a browser and connect to the camera with an ‘ip’ address. ofVideoGrabber doesn’t have the ability to capture over a network as far as I can see.


I haven’t worked with that model, but I have done some stuff with network cameras before. The ones I worked with just had a URL that would be an image, so it was a question of repeatedly making requests to that url and keeping each image as a frame.

You might be able to do something with ofURLFileLoader, or perhaps take a look at gstreamer, there is an of addon for it as well.

This thread might be useful as well


I am not sure but maybe also using ofQTKitPlayer could be a solution: it can open videos from URL.
I haven’t tried with camera on network so I am not sure but it could be worth looking into it (if I remember correctly the example for this already show how to open from an URL).


You are right about the camera sending images to a url “http:\camera\images”. (replace ‘camera’ with the ip address of the camera) I was able to see the video in a browser with no chrome. I tried to ‘save image as’ on the webpage but it would just run-on, I guess, because the images are streaming. At least I’m able to get the images so now I will try both of your ideas and see if I can get them to work. I’ll post to this message when I succeed.

Thank you both for your suggestions.