PDA

View Full Version : Capturing VIDEO from USB Camera



Rajeshsan
9th March 2010, 08:20
HI to all.......
I need to interface USB Camera in Qt Code to Display captured video from USB Camera on Q MainWindow.How to get video from USB camera and Display on Window.

high_flyer
9th March 2010, 08:28
.How to get video from USB camera and Display on Window.
This information is supplied with the camera driver and DLL, and differs from camera to camera, there is no universal way, unless the camera is using the windows general purpose usb driver (I forgot the acronym), in that case MSDN can help you.
Talking to the camera has nothing to do with Qt.

EDIT:
here is the link for the PTP driver documentationI mentioned:
http://msdn.microsoft.com/en-us/library/ms792271.aspx

aamer4yu
9th March 2010, 09:29
You can also try using OpenCV

high_flyer
9th March 2010, 09:41
@aamer4yu:

can openCV do low level device access??
As far as I know it can only do image manipulation, but getting the image is one level lower.

Rajeshsan
9th March 2010, 12:14
Thanks For replying.. Im using LINUX SUSE platform. I downloaded Qt 4.6.1 which is having phonon support. So i need to get data from webcam mounted on USB Driveof my ARM i.MX31 BOARD. By using Qt programming i need to scan data from USB and display that on my ARM board LCD. This is the required thing. In the kernel of Board some cameras which are supported we mounted on USB tried to get the video of camera to QMainwindow but it didnt suceed.

high_flyer
9th March 2010, 13:28
For some reason I understood you were on windows.
The answer stays the same though:
getting the data from the camera is done through the camera driver, and a user level lib if one is supplied (and usually, there is one, or you can use a general purpose libs for that matter under linux, you will have to google for that) - this part has nothing to do with Qt.
You can use Qt to display and manipulate the image.
Phnon, AFAIK, at the moment, does not support media streaming from a device, but I might be wrong - the Phonon docs should confirm/refute this.
I think it will be easier to paint the image buffer directly (not using phonon), preferably using a QGLWidget and a texture (for performance)
If performance is not an issue, than usual painting is no problem.

Rajeshsan
10th March 2010, 10:23
Thanks for reply, I will try it on my Board and get you back with results........:)