Ucview Webcam Capture

Paint programs, vector editors, 3d modelers, animation editors, etc.
Message
Author
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.

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/

Post Reply