LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to program webcam? (https://www.linuxquestions.org/questions/linux-software-2/how-to-program-webcam-783690/)

terry.lai 01-21-2010 03:42 AM

How to program webcam?
 
Hello Sir,

How to get image from webcam by linux c or c++ program?

I have a netbook which comes with a webcam, however, how to identify it to be which device file in /dev?

Is there any bash command to detect this?

BR,
Terry

kateriyan 01-21-2010 03:56 AM

Hi there,
First find out if the web cam streams video or not? Typically they would stream the video to a particular port. You can then open a Socket in C++ on that port and get the video data. Most webcams should be able to do this.

The main thing here is you need to understand what video format does the webcam use and how to process it. Silverlight or DirectX will help as they can directly listen at the particular port, but you have not mentioned which OS you are using.

In case the web cam does not stream it should at least have the feature to save video to a file. In this case also find out the video format and that should help you decide which API to use.

jf.argentino 01-21-2010 05:28 AM

Take a look to the V4L2 interface API, maybe it handles webcam, and if so I think it's the way to go

no2498 01-25-2010 01:15 PM

open a terminal type ( gstreamer-properties ) click enter
click video tryv4l1 or v4l2
this is to see what it use for a driver
get a program like ( cheese or wxcam )
to make movies or take a picture
vlc player can do stream too


All times are GMT -5. The time now is 09:25 PM.