Webcam Snapshot

Browsers, email, chat, etc.
Post Reply
Message
Author
User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

Webcam Snapshot

#1 Post by jemimah »

This is a tiny application that will probably allow you to take pictures with a UVC webcam such as those that are built into laptops and netbooks. The gui is a ripoff of the Screencap utility and works exactly the same way. It has no preview feature, so each picture is a surprise. The upside is that it has no extra dependencies and doesn't take up much space. I will probably add a time-lapse photography feature later and maybe a script that can phone home with pictures the thief if your laptop gets stolen.

Update: I've uploaded version .2. I changed the backend from uvccapture to fswebcam which should take better pictures and support a wider variety of hardware. It now requires libgd so I'm leaving version 1 up in case you prefer the smaller size.
Attachments
libgd2-2.0.36-i486.pet
(87.93 KiB) Downloaded 931 times
webcamsnapshot-.2.pet
(73.81 KiB) Downloaded 915 times
webcam-snapshot.jpg
(22.01 KiB) Downloaded 2900 times
webcamsnapshot-.1.pet
(8.72 KiB) Downloaded 750 times
Last edited by jemimah on Tue 27 Oct 2009, 04:58, edited 1 time in total.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#2 Post by Lobster »

I will probably add a time-lapse photography feature later and maybe a script that can phone home with pictures the thief if your laptop gets stolen
good plan :)
tried it on my logitech webcam - the light went on
and then a dialog saying it had failed
May try later with my netbook

Many thanks :)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#3 Post by 01micko »

jemimah

Thanks for this. Working fine on my 701SD.

Suggestion: Ability to choose the save dir. :)

Cheers
Puppy Linux Blog - contact me for access

User avatar
craftybear
Posts: 62
Joined: Tue 16 Jun 2009, 10:20
Location: East Coast Oz in God's Country

#4 Post by craftybear »

01micko wrote:snap
Ahhhh! It's an Alienjeff clone!!!! :twisted:
I CARE ... I just don't care about you!

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#5 Post by 01micko »

craftybear wrote:
01micko wrote:snap
Ahhhh! It's an Alienjeff clone!!!! :twisted:
...just prettier..
Puppy Linux Blog - contact me for access

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#6 Post by gposil »

For those using dpup, the webcam snapshot is available in Luvcview Webcam Viewer...

Cheers
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

for video:

Code: Select all

ffmpeg -y -f oss -i /dev/audio -f video4linux2 -s qvga -i /dev/video0 ~/a.avi
it will save to a.avi in your home directory (/root)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#8 Post by jemimah »

Lobster, you might be able to get it to work by messing with the uvccapture command on the command line. I made the arguments that worked on my EEE to be the defaults but other cameras may work better with different args.

01Micko, you're supposed to choose the save directory by choosing SaveAs from your image viewer once you get a photo you like. Just like the screencap command.

Technosaurus, that is really cool! I think I will add a button for that.

I'm working on porting UCview or at least Unicap with a light frontend. I tried Luvcview, but didn't like the UI, and I wasn't sure what to do with a pnm file on puppy. Guvcview was a lot better but the windows seemed a bit too large to be comfortable on a netbook. I guess I have to find out if SDL or Unicap is a bigger library, though SDL opens up the possibility of adding some cool games. I'll probably post packages for both UCview and Guvcview at some point if nobody has already.

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#9 Post by gposil »

A couple of points....uvc in any incarnation, Guvcview, Luvcview, Ucview...etc only work for v4l2 compliant devices, a lot of standalone web cams are v4l and will not work...Most if not all laptop built-in webcams are v4l2.

Luvcview, which dpup uses, creates snapshots in pnm format, which all modern flavours of linux(Puppy included) can convert to png, jpg, tiff or ps/pdf with the pnmto???? commands in /usr/bin. Luvcview also captures video/audio very nicely as well.
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#10 Post by jemimah »

Version .2 is out. Give it a try if version .1 didn't work well for you.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#11 Post by Lobster »

Technosaurus, that is really cool! I think I will add a button for that.
[Lobster faints] Worked for me too - not audio though :lol:
Even now I am amazed by Puppy included progs
that seem to be Tardis like included . . .

Will you add a ffmpeg button jemimah? Many thanks for suggests ;)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#12 Post by jemimah »

I need to do a little research on the ffmpeg options and then I'll probably make a separate webcam-capture UI. I haven't had the chance to see just how large Gucview and dependencies are; that may be a nicer option.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#13 Post by technosaurus »

if audio doesn't work first check that the mic volume is not turned down or muted and if that doesn't work you may try replacing 'oss' with 'alsa'
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#14 Post by greengeek »

I tried pet 1 but it gave me a dark image. Tried pet 2 and selected both long and short delays but I could not find any output file.

I researched fswebcam and came up with the following syntax:

Code: Select all

fswebcam -r 640x480 test.jpg -S 2
which does give me an output file but it is too dark.

In order to get a good image I had to increase the "frame skip" as follows:

Code: Select all

fswebcam -r 640x480 test.jpg -S 5


This thread offers another option (no dependencies on my Slacko 5.6 derivative) for taking a snapshot as follows:

Code: Select all

ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 -ss 0:0:2 -frames 1 ffmpegtest.jpg
Maybe there is a way to integrate this syntax into Jemimahs utility?

Post Reply