LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-21-2010, 03:42 AM   #1
terry.lai
LQ Newbie
 
Registered: Jan 2010
Posts: 1

Rep: Reputation: 0
Wink 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
 
Old 01-21-2010, 03:56 AM   #2
kateriyan
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
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.
 
Old 01-21-2010, 05:28 AM   #3
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Take a look to the V4L2 interface API, maybe it handles webcam, and if so I think it's the way to go
 
Old 01-25-2010, 01:15 PM   #4
no2498
Member
 
Registered: Jan 2010
Posts: 120

Rep: Reputation: 23
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Aim program w/ webcam speel Linux - Software 2 08-29-2006 10:25 PM
A program for recording a webcam? stormrider_may Linux - Software 3 02-19-2006 06:27 PM
Where to find a webcam program Jeppesl Linux - Software 1 01-27-2005 01:45 PM
C program to webcam jestin Linux - General 1 03-02-2004 02:26 PM
C program to webcam jestin Linux - Software 0 03-02-2004 03:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration