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:

#21 Post by jemimah »

Something like this perhaps.

Code: Select all

while true ; do
ffmpeg -y -r 1 -t 1 -f video4linux2 -s xga -i /dev/video0 /tmp/camshot%d.jpg
/usr/local/apps/Wallpaper/set_bg /tmp/camshot1.jpg
sleep 3
done
Geez I had to turn that off, that's creepy since my webcam points at me.

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

#22 Post by technosaurus »

Yeah, that looks like it should work - never thought about the background image - I guess you could even use imaging tools to combine images from multiple camera sources (though its not my area of expertise)... if you had a webserver with an autorefresh script built in you could even use it for remote viewing (over the web - not ESP)... the possibilities are limitless I guess. ... If my webcam was working I would test it out... maybe add simultaneous video recording but I'm not sure if you can you record video and take images from the same /dev/video0 simultaneously or would you get a "device already in use" (if so I guess opening the video in defaultmediaplayer after recording is started would work if you have the resources.... though I haven't been able to test that either)
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:

#23 Post by technosaurus »

thus far the best option I can find is conky WITH Imlib2 support (Puppy's does not currently, but I will compile Imlib2 and recompile conky to check the size... would allow wbar to be installed too)

the conkyrc file should look something like this:
imlib cache_size 0
$(image /path/to/camshot1.jpg -p 0,10)

for multiple webcams
imlib cache_size 0
$(image /path/to/cam1shot1.jpg -p 0,10)$(image /path/to/cam2shot1.jpg -p 0,110)$(image /path/to/cam3shot1.jpg -p 0,210)

You can run conky first and then run your ffmpeg loop (may need dummy images though)

and you would need 1 per camera in your while loop:
ffmpeg -y -r 1 -t 1 -f video4linux2 -s 100x100 -i /dev/video0 /tmp/cam1shot%d.jpg
ffmpeg -y -r 1 -t 1 -f video4linux2 -s 100x100 -i /dev/video1 /tmp/cam2shot%d.jpg
ffmpeg -y -r 1 -t 1 -f video4linux2 -s 100x100 -i /dev/video2 /tmp/cam3shot%d.jpg
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
Kirby
Posts: 52
Joined: Mon 28 Dec 2009, 07:33
Location: Oregon, US

Logitech Webcam Pro 9000

#24 Post by Kirby »

*kneels before Jemimah in gratitude and humility*
OMG! OMG! OMG! Thank You SOOOOOOOOO very Much for that pet! I had bought a Logitech Webcam Pro 9000 just for puppy and nothing would work until I installed these Pets! You have No Idea how Very Happy I am now! I was having to log out of Puppy and log into Win Xp *gags* just to use my web cam!

I only tried it for a few mins and made the mistake of clicking on full screen but could not figure out how to get out so had to reboot. But it looks great! :D

Now I just need some friendly video editing software for Puppy and I will never have to leave it again!

Thank You So very Much for posting these pets Jemimah :!:

Your humble servant for life.
Kirby
"When you come to your cross roads, step off the road and go down the path of your own making".
~Bohemian proverb~

*edit* "When you're lost in the woods from straying from the road, Always be sure to carry a Flashlight!"
~Improved Bohemian Proverb~

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

#25 Post by jemimah »

You're welcome!

Let me know how the video editing thing goes. I'm uncertain what the best way to convert the raw avi that Ucview outputs, or if it even has sound embedded or not.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#26 Post by abushcrafter »

Failed to get a image from my "Logitech Quick Cam Express" web-cam :(.

Code: Select all

# ucview 

** (ucview:13128): WARNING **: Failed to create '/root/.ucview/plugins'

search module path: /usr/lib/ucview/plugins

** (ucview:13128): WARNING **: Failed to start video capture

#
Oh I do wish Theora video worked by the way :(...

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

#27 Post by 01micko »

Hmmm....

techno & jemimah

I have produced 3 pwidgets slideshows which all should work with a webcam. The gtk-dialog one does, as demoed in the stardust 010 thread, I made the original xli slideshow and a slideshow for the pwidgets extras (with conky 1.7.1 and imlib2, see pwidgets thread around page 150??), I'm sure a webcam could work with both of those.

I use a debian imlib2, an older version but I threw out everything except the actual libs and conky 1.7x seems to work fine with it. It will be good to see how skinny you can get imlib2 techno.

Cheers

EDIT! Patriot already got conky-1.7.11 real small, like around 70MB, that's the one INCLUDED in the pwidgets extras (see MAIN pwidgets page). I got the slideshow/webcam to work, easy, no need to loop, conky takes care of that with "execi $NUMBER" . Made a separate pwidgets script just call ing the ffmpeg cam shot.

Code: Select all

TEXT
${execi 1 /usr/local/pwidgets/widgets/scripts/Webcam}
${image /tmp/cam/camshot1.jpg -s 140x105}
um that's the conky config for pwidgets

Code: Select all

#!/bin/sh
mkdir /tmp/cam
#while true ; do
ffmpeg -y -r 1 -t 1 -f video4linux2 -s qvga -i /dev/video0 /tmp/cam/camshot%d.jpg &

#sleep 1
#done
That's your script, loop disabled. I think you can run multiple instances, provided filenames don't clash.
Puppy Linux Blog - contact me for access

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

#28 Post by technosaurus »

sounds great - the only thing I might change is the -s qvga in the ffmpeg line to be -s 140x105 if that is the default widget size ... only 1 scaling instead of 2 - I think I compiled Imlib2 already- I'll have to look and recompile conky
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
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#29 Post by 01micko »

technosaurus wrote:sounds great - the only thing I might change is the -s qvga in the ffmpeg line to be -s 140x105 if that is the default widget size ... only 1 scaling instead of 2 - I think I compiled Imlib2 already- I'll have to look and recompile conky
anything 4:3 ratio is ok (up to about 160 wide for Pwidgets, maybe a little larger), so long as both are even numbers,... 140x105 doesn't work, but 140x106 does.

BTW, tried the gtk-dialog ver with bash mathematics and grepping screen size from /etc/X11/xorg.conf and the best I can get is 3fps... a bit too flickery with the gtk-dialog lag. I have a 5 yo system with plenty of ram and a decent graphics card.
Puppy Linux Blog - contact me for access

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#30 Post by edoc »

technosaurus wrote: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
Any news re. wo-ff?

Our daughter is looking for a way to convert AVI and other files to AMR for her new MP4 player.
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

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

#31 Post by jemimah »

Have you tried FFconvert from Shinobar?

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#32 Post by edoc »

Is there an option to convert AVI to AMR in FFconvert.

We couldn't find it.

CORRECTION:

My error, it wants AMV not AMR ... there is an option in wo-ff for AMR but not for AMV.

BTW: I did a conversion to AMR but it is identified in Puppy as a text file ... though that could be a mis-ID.
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

User avatar
edoc
Posts: 4729
Joined: Sun 07 Aug 2005, 20:16
Location: Southeast Georgia, USA
Contact:

#33 Post by edoc »

I found this page of AMV sample files but the MP4 player that will only play AMV files says that the file format is wrong.

http://samples.mplayerhq.hu/amv/

Can someone test them on a known-good MP4 player that handles AMV and tell me if they are OK?

I need to know if this is just another piece of cheap Chinese fake-MP4 junk hardware that needs to be returned or if something else is going on with more than one AMV file format out there.

Sigh.
[b]Thanks! David[/b]
[i]Home page: [/i][url]http://nevils-station.com[/url]
[i]Don't google[/i] [b]Search![/b] [url]http://duckduckgo.com[/url]
TahrPup64 & Lighthouse64-b602 & JL64-603

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

#34 Post by jemimah »

I rebuilt ucview with the newest libtheora and now theora encoding doesn't crash. Yay! Updates coming for Puppeee and Fluppy.

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#35 Post by abushcrafter »

Yay :D! Could you also build it for other puppy's please.
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

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

#36 Post by jemimah »

Which Puppies?

Surely there's a UCview package in the Ubuntu repo that would work with LuPu?

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#37 Post by abushcrafter »

I was think of a generic build that would work of 4.3.* or newer. How ever I can't test it until I get my non UVC logitech quick cam express webcam working. Then there's the though of that am am considering using Fluppy as a base for my system...
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#38 Post by MU »

nice, many thanks!

Example video, grabbed with 1 frame every 5 seconds, then encoded with 25 fps (resulting in 125* speed):
http://www.youtube.com/watch?v=n9VAk_EN_Yc


using a subfolder called "1" to store the jpg frames:


grab.sh

Code: Select all

#!/bin/bash


thedir=1

while [ 1 ];do


 ffmpeg  -y -f video4linux2 -s 960x720 -r 1 -t 1 -i /dev/video $thedir/`date +%s`.jpg

# ffmpeg  -y -f video4linux2 -s 1280x960 -r 1 -t 1 -i /dev/video $thedir/`date +%s`.jpg

 sleep 5

done
encode.sh

Code: Select all

#!/bin/bash

thedir=1



#-vf eq2=gamma:contrast:brightness:saturation
#where gamma 0.1 - 10 (default 1.0), contrast -2 − 2 (default 1.0), brightnes -1 - 1 (default 0.0),
#saturation 0 − 3 (default 1.0),

#res="w=640:h=480"
res="w=960:h=720"


mencoder-mt mf://$thedir/*.jpg -mf $res:fps=25:type=jpg -ovc lavc \
    -vf eq2=1.4:1.2:0.0:1.5 \
    -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output-$thedir.avi
To encode I used this mencoder:
http://dotpups.de/puppy4/dotpups/Multim ... ltiThread/

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

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

#39 Post by greengeek »

Does anyone have a copy of the ucview pet please?
Jemimah - please come home. There is much to do.
Attachments
ucview.jpg
(52 KiB) Downloaded 406 times

User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#40 Post by CatDude »

Hello greengeek
greengeek wrote:Does anyone have a copy of the ucview pet please?
Jemimah - please come home. There is much to do.
After a quick search, it appears that the missing package from page 1 is/was unicap-0.9.5-i486.pet
you can grab a copy from here: http://akita.scottjarvis.com/

Hope that helps.
CatDude
.
[img]http://www.smokey01.com/CatDude/.temp/sigs/acer-futile.gif[/img]

Post Reply