webcam on desktop

Booting, installing, newbie
Post Reply
Message
Author
outsider.gonzo
Posts: 4
Joined: Sat 19 Mar 2011, 08:03
Location: Salzgitter/Germany

webcam on desktop

#1 Post by outsider.gonzo »

hi,
i would receive a private webacam and that image should be on the desktop right side on the top.

i have seen a topic on a ubuntu website, but i have no idea where can i use it and how.

have anybody here an idea?

here is the link where i have found it(it's in German)

http://forum.ubuntuusers.de/topic/bild- ... st-1394767


ty for your help

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#2 Post by DPUP5520 »

If I translated that right I believe they are saying to create a script with that code which will automatically pull an image from wherever you choose every five minutes, which is in their case such as yours a home webcam.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#3 Post by zigbert »

this command shows my webcam output.

Code: Select all

mplayer -fps 30 -cache 128 -tv driver=v4l2:width=640:height=480:device=/dev/video0 tv://

DPUP5520
Posts: 800
Joined: Wed 16 Feb 2011, 05:38

#4 Post by DPUP5520 »

@ zigbert

I believe he's talking about a IP cam
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69651][b][i]PupRescue 2.5[/i][/b][/url]
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=72178][b][i]Puppy Crypt 528[/i][/b][/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#5 Post by zigbert »

Sorry.
Pwidgets-extra pack has a slideshow widget which uses xli to show images

Code: Select all

xli -geometry +100+100 -gamma 2.2 /path/file.jpg
I guess the german script could be used for downloading the image.


Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#6 Post by zigbert »

Here is an example. It's too simple since it
- has window decoration
- should be set to a layer below other windows
- views downloaded image in actual size



Code: Select all

#!/bin/bash
DIR=$HOME/.pwebcam
IMAGE=http://www.hemnes.kommune.no/webcam/korgen.jpg

while [ "$N" != "1" ]; do
	wget -N --directory-prefix=$DIR --no-check-certificate $IMAGE
	xli -geometry +100+100 -gamma 2.2 -delay 5 $DIR/korgen.jpg &
	sleep 4
done

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#7 Post by zigbert »

This one doesn't make a new window each download, but updates the running window.

Code: Select all

#!/bin/bash
DIR=$HOME/.pwebcam
IMAGE=http://www.hemnes.kommune.no/webcam/korgen.jpg
echo -n $DIR/korgen.jpg

xli -geometry +100+100 -gamma 2.2 -delay 5 -goto $DIR/korgen.jpg $DIR/*.jpg &

while [ "$N" != "1" ]; do
	wget -N --directory-prefix=$DIR --no-check-certificate $IMAGE
	sleep 5
done

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

#8 Post by technosaurus »

has anyone been able to do this in such a way that it can be recorded and watched at the same time? tee + pipes maybe, or using x11grab on the stream window?
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
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#9 Post by zigbert »

Code: Select all

#!/bin/bash

URL=http://www.hemnes.kommune.no/webcam/korgen.jpg

DIR=$HOME/.pwebcam
IMAGE_DIR=`dirname $URL`
IMAGE_BASE=`basename $URL`
echo -n $DIR/$IMAGE_BASE

xli -geometry +100+100 -gamma 2.2 -delay 1 -goto $DIR/$IMAGE_BASE $DIR/*.jpg &

while [ "$N" != "1" ]; do
	wget -N --directory-prefix=$DIR --no-check-certificate $URL
	ffmpeg -f image2 -i $DIR/$IMAGE_BASE -y $DIR/pwebcam.mpg
	cat $DIR/pwebcam.mpg >> $HOME/pwebcam.mpg
	sleep 1
done

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#10 Post by zigbert »

Here is a simple webcam viewer / recorder. You can control it from gui or commandline. The pet includes 'xli' as the viewer and 'resizepng' for scaling the downloaded image. These are not in Puppy by default. For recording it uses ffmpeg and that is already in you Puppy.

Image
Image
Attachments
pwebcam-0.2.pet
(101.66 KiB) Downloaded 607 times
Last edited by zigbert on Wed 30 Mar 2011, 08:49, edited 1 time in total.

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#11 Post by seaside »

zigbert,

Very cool (I mean cold) webcam viewer :)

You might move this code to just above the "while loop"

Code: Select all

[ -f "$TARGETDIR/$IMAGE_NAME.mpg" ] && gxmessage "$TARGETDIR/$IMAGE_NAME.mpg already exist. Rename or move before continuing."
When record is true, the gxmessage keeps looping.

Can spring be far away there?

Cheers,
s

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#12 Post by zigbert »

seaside
You might move this code to just above the "while loop"
Done.... I have made an actual use of it, and did some general fixing. Version 0.2 is uploaded 2 posts up.
Can spring be far away there?
Hopefully not. Even I (who is a snow-lover) feels this winter has been a bit long. We've had snow since October, and there is still 1 meter left in the garden. Today it is snowing heavily.....


Sigmund

Post Reply