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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
04-05-2009, 05:25 AM
|
#1
|
Member
Registered: Jun 2008
Posts: 41
Rep:
|
Bash script to capture pictures using webcam
Hi friends,
I have a laptop with integrated web cam. I am using "cheese" to capture photos and taking video.
Now I want to write a script with following features:
>>> It should start at the time of login
>>> Automatically it will capture one photo (to identify who is there in front of system), saves that photo in a specified folder and it will be closed automatically....
If there is a tool like this then I will be happy. Otherwise let me know how to write a script....
Thanks in advance...
|
|
|
04-05-2009, 06:04 AM
|
#2
|
Member
Registered: Nov 2008
Location: Lower Saxony, Germany
Distribution: CentOS, RHEL, Solaris 10, AIX, HP-UX
Posts: 731
Rep: 
|
Hi,
take a look for streamer, which is part from xawtv package. This can capture pictures from your webcam
Code:
streamer -c /dev/video0 -b 16 -o outfile.jpeg
creates a jpeg picture from device video0.
You can use this tool to script your required action.
Also a good source is Webcam-Howto
|
|
|
04-05-2009, 06:10 AM
|
#3
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
|
|
|
04-05-2009, 09:34 AM
|
#4
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
Hi mesiol and H_TeXMeX_H,
Very thanks for your quick response.... I am using FC9. streamer is not there in my system... But stream is there. Are both same??? I tried to install using yum as follows
But no package named with this name....
|
|
|
04-05-2009, 09:56 AM
|
#5
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
I used this command
Quote:
$ streamer -c /dev/video0 -b 16 -o out.jpeg
|
out put is
Quote:
WARNING: no plugins found [/usr/local/lib/xawtv]
files / video: JPEG (JFIF) / audio: none
no grabber device available
|
What is the problem
|
|
|
04-05-2009, 09:59 AM
|
#6
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
For
out put is:
Quote:
This is xawtv-3.95, running on Linux/i686 (2.6.27.19-78.2.30.fc9.i686)
looking for available devices
port 280-311
type : Xvideo, image scaler
name : NV17 Video Texture
/dev/video0: OK [ -device /dev/video0 ]
type : v4l2
name : Laptop Integrated Webcam
flags: capture
|
I think xawtv is working fine
|
|
|
04-05-2009, 10:14 AM
|
#7
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
Now I copied /usr/lib/xawtv/ into /usr/local/lib/
Then also it showing following error
Quote:
files / video: JPEG (JFIF) / audio: none
no way to get: 320x240 JPEG (JFIF)
movie writer initialisation failed
|
What to do...
|
|
|
04-05-2009, 11:09 AM
|
#8
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
My Laptop configuration:
Dell inspiron 1420
with nvidia graphics card Ge Force 8-series and Integrated web cam.
I hope it can help....
|
|
|
04-05-2009, 11:12 AM
|
#9
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
I think you need to mess with the settings, it looks like it can't get 320x240 resolution. Also, avoid copying stuff around in the system directories, I doubt it will help, but you could really mess up your system.
|
|
|
04-05-2009, 12:54 PM
|
#10
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
ok... But how to change settings... can anybody suggest me or is there any link.
|
|
|
04-05-2009, 01:41 PM
|
#11
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
On the main site it lists all the options and what they do:
http://xawdecode.sourceforge.net/htm.../indexUS.shtml
See the record options, I think that's what need adjusting.
|
|
|
04-06-2009, 09:17 AM
|
#12
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
I have tried in google search but I am not able to find proper solution....
GUI is not opening for "xawtv"... So, how can change settings through command line????
Please help me....
|
|
|
04-06-2009, 09:35 AM
|
#13
|
LQ Guru
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
|
Try running 'xdtv' and post what the error is.
|
|
|
04-06-2009, 09:46 AM
|
#14
|
LQ Newbie
Registered: Apr 2009
Posts: 10
Rep:
|
Are you kidding? How a webcam can identify a person??
Perhaps it has a function that can capture pictures by the webcam and save them to a specified folder?
I have no idea how a webcam can identify a person!! any idea.. tell me pls!
|
|
|
04-06-2009, 10:17 AM
|
#15
|
Member
Registered: Jun 2008
Posts: 41
Original Poster
Rep:
|
first thing I want save photo at every login.... Can make a software to identify a person using matlab or something else....
If it is possible tell me how to solve above error....
Last edited by Mogli; 04-06-2009 at 11:15 AM.
|
|
|
All times are GMT -5. The time now is 11:18 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|