Ucview Webcam Capture

Paint programs, vector editors, 3d modelers, animation editors, etc.
Message
Author
User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

Ucview Webcam Capture

#1 Post by jemimah »

This is a small and nice program for capturing images and video from a webcam. The UI is scalable and well designed - perfect for netbooks.

It has brightness and contrast controls, supports multiple images formats, time lapse capture, and also raw AVI video. Originally it had Ogg Theora encoding support, but the encoder crashed on anything larger than postage stamp size video, so I removed it.

Gxine won't play raw avi, so I've included a really basic ffmpeg front end so you can convert your video into something that will play. To make this work, you need to select UYVY in the ColorFormat Preferences - otherwise Ffmpeg won't know what to do the the raw video either.

Ffmpeg experts, please post any tips you know to convert the video into a usable format. I haven't yet figured out how to specify the frame-rate or how to get the sound to play.

The unicap pet has Ucview with the required unicap libraries. This program depends on gconf. I have included the gconf-dbus pet, packaged by Disciple, here. Ucview should work if you install all attached pets. I've only tested on 4.3.1, so I'm not sure how well it'll work on other versions.
Attachments
ffmpeg.jpg
converting from avi to avi will work just fine
(59.62 KiB) Downloaded 9663 times
ucview.jpg
(52 KiB) Downloaded 10516 times
libxcb-1.0.pet
(84.72 KiB) Downloaded 2352 times
GConf-dbus-2.16.0-i486.pet
(159.02 KiB) Downloaded 2321 times

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#2 Post by pri »

:mrgreen: sory.. i passed here and see your post....

i am not expert on ffmpeg, but i have a ffmpeg conventer MMC (Mobile Media Converter) it has a small script to change multimedia.

http://www.miksoft.net/mobileMediaConverter.htm
Learning by Doing

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

#3 Post by jemimah »

That's a nicer ffmpeg frontend than mine for sure. They sure don't make it easy to get the source though. Sadly, it fails to recognize the format in question.

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#4 Post by pri »

working like charming........

:mrgreen: :mrgreen:

do you see the expalined in the box ? it need libc6 on glibc-2.7

8) owhh its a cool program
Learning by Doing

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

#5 Post by jemimah »

If I can figure out how to get and compile the source code, I will make a pet of it.

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#6 Post by pri »

yes... i will be waiting.....

i have pet from debian, but there was a strange thing.... it will be hang if converted media if runnig from menu, but work fine if command directly from command line or folder.

fuhh...... :oops: compile not my skill.... i just have fun to play puzzle with puppy
Learning by Doing

User avatar
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#7 Post by pri »

Image
Learning by Doing

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#8 Post by amigo »

The sources for mmediac are in a bazaar repo, so you'll need bazaar to dowmload them. Still, this appears to be a ruby script thingy, so you could manually download the files from here, maybe:
http://bazaar.launchpad.net/~netcyrax/m ... .5.0/files

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

#9 Post by jemimah »

I must admit, I have no idea how to compile ruby. They managed to turn it into a binary somehow, but I don't see a build script in the repo.

I think I can make something at least as nice in gtkdialog. I'm really surprised it hasn't been done already. If nothing suitable can be found, perhaps I'll add it to my ever growing todo list.

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

#10 Post by technosaurus »

You could use woo-ff (gtkdialog ffmpeg converter) as a template for the conversions and these:
Here is a cheap way to do webcam shots

Code: Select all

rxvt +sb -bg orange -geometry 80x2 -e ffmpeg -y -f video4linux2 -s qvga -i /dev/video0 ~/stream%d.jpeg
qvga can be vga ...
~/ can be any dir
jpeg can be whatever image format

careful though it will make a LOT of images unless you specify a lower frame rate (not sure the flag for that at the moment)

edit:
to take one image per second
-r 1
to take images for 3 seconds
-t 3

so this will give you 3 jpegs in your root directory at vga resolution

Code: Select all

ffmpeg -y -r 1 -t 3 -f video4linux2 -s vga -i /dev/video0 ~/camshot%d.jpeg
similarly here is a cheap way to capture webcam video
rxvt +sb -bg orange -geometry 80x2 -e ffmpeg -y -f oss -i /dev/audio -f video4linux2 -s qvga -i /dev/video0 ~/a.avi

I think oss can be alsa?
qvga can be vga
recommend using avi as above and converting with woof to prevent lag due to trying to compress

And finally desktop capture (requires ffmpeg compiled with x11grab)

Code: Select all

rxvt +sb -bg orange -geometry 80x2 -e ffmpeg -f oss -i /dev/audio -f x11grab -s 1200x800 -r 5 -i :0.0 x11-session.avi
I forget exactly how to find resolution - maybe grep xorg.conf for PreferredMode
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:

#11 Post by jemimah »

Woo-ff was exactly what I was looking for - Thank you!

For these other ffmpeg tricks, I don't suppose there's any way to get a live preview? It's nice to be able to see what you're recording...

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

#12 Post by technosaurus »

I guess you could open defaultmediaplayer to play the file as it is being recorded

Edit:
the script will stop on ffmpeg unless you use the "&"
ffmpeg .... &
defaultmediaplayer $DIR/$FILE

I was making some changes to woo-ff to fix up some hacks, but haven't tested the changes yet... here it is though if you want it for reference
Attachments
woo-ff.gz
(4.12 KiB) Downloaded 1319 times
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
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#13 Post by technosaurus »

pri wrote:yes... i will be waiting.....

i have pet from debian, but there was a strange thing.... it will be hang if converted media if runnig from menu, but work fine if command directly from command line or folder.

fuhh...... :oops: compile not my skill.... i just have fun to play puzzle with puppy
when this happens open the .desktop file in /usr/share/applications and delete any % parameters after the executable (jwm does not handle them well)
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
pri
Posts: 342
Joined: Fri 09 Oct 2009, 18:31
Location: Bandung Indonesia
Contact:

#14 Post by pri »

technosaurus :

http://www.4shared.com/file/219581609/671b4da/MMC.html
[Desktop Entry]
Type=Application
Name=Mobile Media Converter
Comment=ffmpeg GUI for converting between desktop and mobile phone formats.
Exec=MobileMediaConverter
Icon=mmc.png
Categories=AudioVideo;Audio;Video;AudioVideoEditing;
MimeType=audio/vorbis;audio/x-mp3;audio/x-ms-wma;audio/x-vorbis;audio/x-wav;video/x-ms-asf;audio/ogg;audio/3gpp;audio/AMR;audio/AMR-WB;video/3gpp;video/flv;video/mpeg;video/msvideo;video/x-mpeg;video/x-ms-asf;video/x-ms-wmv;video/quicktime;audio/x-realaudio;audio/x-pn-realaudio;video/vnd.rn-realvideo;audio/mp4a-latm;video/x-m4v;video/mp4
i doesnt seem strange thing..
Learning by Doing

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#15 Post by JustGreg »

Thanks Jemimah, the Ucview works well on my Acer Aspire One net boot with an Acer Crystal Eye Web Cam. It does work well. Ucview will replace lucview. Your interface is much easier to use and understand. Thank for your efforts!

Yes, technosaurus, oss is the alsa audio stream. I did something similar with the EeePC for audio with ffmpeg. One problem that casue much fustration for me, was the need to turn on the microphone boast in alsamixer. The other headache is those system with an internal microphone have two microphones. Sometimes they are call front and back or internal and external. Getting the correct microphone is a problem.

I did try to record both audio and video and was successful on my Aspire one Here is the code that I used:

Code: Select all

#!/bin/sh
ffmpeg -y -f oss -i /dev/audio -f video4linux2 -s vga -i /dev/video0 /root/test.mpg
I also found the microphone boast in alsamixer need to be increased (to the 50 mark) for good audio. I did use an external microphone also, so, the external microphone had to be selected in alsamixer. I hope this helps.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

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

#16 Post by technosaurus »

@jemimah - based on your work with gtrayicon in pwireless2 do you think you could throw together a little tray applet that displays rotating images from a webcam - there is a pwidget that it may work with too

Code: Select all

<<begin loop>>
ffmpeg -y -r 1 -t 2 -f video4linux2 -s 24x24 -i /dev/video0 ~/.pcamtray/camshot%d.png &
<update trayicon> ~/.pcamtray/camshot1.png
<update trayicon> ~/.pcamtray/camshot2.png
<<end loop>>
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:

#17 Post by jemimah »

Gtrayicon is probably much too limited for what you want. I don't think it will reload the icon after starting.

However, I've been playing with Vattery, which is a battery monitor applet written in Vala - and it's not hard to make it monitor other stuff besides batteries.

Although, I'm a bit confused. Wouldn't a webcam image in the systray be too small to see? What's the overall goal of this exercise?

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

#18 Post by technosaurus »

I guess that depends on the size of your tray - ecomoney was asking in another thread about being able to monitor several webcams for activity (basically outdoor security cameras) after thinking about it, it may be better as a pwidget than a tray monitor... however I thought that gtrayicon could have two different images and that they reloaded the image each time the status changed (basically compare timestamp on image1 and image2 with an appropriate sleep in between) The location and name of the icons (sets of 2 streamed images) would be static but the actual image would change as it is updated by ffmpeg, so gtrayicon would "think" it was only toggling between 2 images. The tray itself is not limited to being attached to the taskbar even in jwm.. and many strictly window managers will use stalone tray which can account for this too. I agree though that for most individual users with only 1 webcam, a widget (probably an adapted slideshow pwidget) would be better suited. Alas NECESSITY is the mother of invention - not just geekiness for geekiness sake - I personally have no need for it at all now because my Acer builtin webcam finally stopped working altogether (I had only been getting 1/4 of the screen recently) I hope our business (and/or paranoid) users find a solution that is better than the bloated, mysql-dependent solution that ecomoney was talking about using.
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:

#19 Post by jemimah »

I figured gtrayicon loaded the images into memory, but I just tested - and what you propose could work.

I do think Pwidgets would make more sense though. Isn't 01micko working on a slideshow widget?

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

#20 Post by jemimah »

Or you could just write a script to update your Rox wallpaper every few seconds.

Post Reply