Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > General Help
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

General Help
All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu.

 
Thread Tools Display Modes
Old August 4th, 2008   #1
The Warlock
Way Too Much Ubuntu
 
Join Date: May 2005
Beans: 151
odd request: Webcam as desktop background?

Hey, I've got a shiny new EeePC with a 1.3 MP camera built in. Drivers worked fine after downloading and compiling the newest uvcvideo modules; that's not the problem.

I would like to set it up so that the camera feed is the desktop "wallpaper". Is there any way to do this? Right now I'm using Gnome, but I would readily switch desktop environments if it let me do this.
__________________
double free or corruption (fasttop)
The Warlock is offline   Reply With Quote
Old August 5th, 2008   #2
swarm
Spilled the Beans
 
Join Date: Aug 2006
Beans: 13
Re: odd request: Webcam as desktop background?

Quote:
Originally Posted by The Warlock View Post
Hey, I've got a shiny new EeePC with a 1.3 MP camera built in. Drivers worked fine after downloading and compiling the newest uvcvideo modules; that's not the problem.

I would like to set it up so that the camera feed is the desktop "wallpaper". Is there any way to do this? Right now I'm using Gnome, but I would readily switch desktop environments if it let me do this.
Since nobody decided to give this a shot, I'll throw out a suggestion..

To get started, lets try some things. This is NOT tested.

Download and install VLC

Set the webcam to store a video clip to your hard drive.

Set VLC to stream the video to your background.

Did this work? Is this what you wanted? The video filesize will get pretty large, sadly, and an EEEpc doesn't have a ton of storage space. Maybe someone can chime in on how to cut off the front of the video every once in a while, or a better solution overall?

Also, have you considered how resource intensive this may be?
swarm is offline   Reply With Quote
Old August 6th, 2008   #3
The Warlock
Way Too Much Ubuntu
 
Join Date: May 2005
Beans: 151
Re: odd request: Webcam as desktop background?

Hey, found something else that works. Good ol' mplayer.

Sidenote: I kind of miss old-school Linux programs like mplayer. Belligerently user-unfriendly but capable of anything given the proper command line input.

Which, in this case, is:

mplayer -rootwin -fs -fps 15 tv:// -x 1024 -y 600 -sws 0 -vf crop=640:375

-rootwin sets it as the root window
-fs stretches it to fullscreen
-fps 15 keeps it at fifteen frames per second (to decrease processing time spent on it)
tv:// goes to the default video source (the webcam)
-x 1024 -y 600 stretches it to the exact resolution of my 1024x600 screen
-sws 0 sets the software scaling mode to the least processor-intensive option
-vf crop=640:375 crops the 640x480 camera output to the proper widescreen before stretching it, so the aspect doesn't get screwed up.

This works almost perfectly and takes almost no CPU power.
Some problems:

1) desktop icons won't show up, because I need to turn Nautlius's "show-desktop" option off.

2) other programs can't use the cam at the same time, unfortunately.

3) the biggie: suspend-to-RAM doesn't work when the camera is in use, or it does work but the camera stops working until a reboot.

unfortunately, #3 there is a dealbreaker. I've filed a bug report; that happens with any program using the camera.

Anyway, maybe anyone on a desktop where you don't need suspend might find this helpful.
__________________
double free or corruption (fasttop)
The Warlock is offline   Reply With Quote
Old August 6th, 2008   #4
easybake
Way Too Much Ubuntu
 
easybake's Avatar
 
Join Date: Apr 2008
Beans: 331
Send a message via AIM to easybake
Re: odd request: Webcam as desktop background?

You can do it using xwinwrap. EDIT: New

It boxes my conkys when i click on them. You can keep your icons and docks too.
Code:
xwinwrap -ni -o 0.20 -fs -s -sp -st -b -nf -- mplayer -wid WID -quiet -fps 15 tv://
For those who don't know how to install xwinwrap.
in terminal
Code:
sudo apt-get install build-essential libx11-dev x11proto-xext-dev libxrender-dev libxext-dev cvs
Code:
cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xapps co xwinwrap
Code:
cd xwinwrap
Code:
make
Optional
Code:
sudo cp xwinwrap /usr/bin

Last edited by easybake; August 8th, 2008 at 06:58 AM..
easybake is offline   Reply With Quote
Old August 7th, 2008   #5
The Warlock
Way Too Much Ubuntu
 
Join Date: May 2005
Beans: 151
Re: odd request: Webcam as desktop background?

That's an excellent solution to problem 1 up there; now just to figure out 2 and 3.
__________________
double free or corruption (fasttop)
The Warlock is offline   Reply With Quote
Old August 7th, 2008   #6
easybake
Way Too Much Ubuntu
 
easybake's Avatar
 
Join Date: Apr 2008
Beans: 331
Send a message via AIM to easybake
Re: odd request: Webcam as desktop background?

Quote:
Originally Posted by The Warlock View Post
That's an excellent solution to problem 1 up there; now just to figure out 2 and 3.
Would a toggle script solve those problems? That way you could just create a custom launcher that turns it off/on when you want.
In terminal
Code:
gedit blahblah
Paste this in text editor
Code:
#!/bin/sh

# click to start, click to stop
if pidof xwinwrap ; then
 killall xwinwrap
 else
 exec xwinwrap -ni -o 0.20 -fs -s -sp -st -b -nf -- mplayer -wid  WID -quiet -fps 15 tv://
fi
Save and close.
In terminal
Code:
sudo chmod a+x blahblah
Create a launcher with any name with the Command
Code:
./blahblah
easybake is offline   Reply With Quote
Old August 7th, 2008   #7
The Warlock
Way Too Much Ubuntu
 
Join Date: May 2005
Beans: 151
Re: odd request: Webcam as desktop background?

Hey, how did you get transparency to work right with mplayer? If I use the xv output driver, there are big black borders wherever something should be transparent. (And if I use the x11 driver, it takes like a third of my CPU power so that's right out.)
__________________
double free or corruption (fasttop)
The Warlock is offline   Reply With Quote
Old August 7th, 2008   #8
easybake
Way Too Much Ubuntu
 
easybake's Avatar
 
Join Date: Apr 2008
Beans: 331
Send a message via AIM to easybake
Re: odd request: Webcam as desktop background?

Quote:
Originally Posted by The Warlock View Post
Hey, how did you get transparency to work right with mplayer? If I use the xv output driver, there are big black borders wherever something should be transparent. (And if I use the x11 driver, it takes like a third of my CPU power so that's right out.)
My bad, it might only work if you're running compiz as your window manager. If you try to use metacity or something else i don't think it will work.

Edit: I wrote a Howto on how i accomplished it, but it hasn't been approved yet.

Last edited by easybake; August 7th, 2008 at 09:30 PM..
easybake is offline   Reply With Quote
Old August 7th, 2008   #9
The Warlock
Way Too Much Ubuntu
 
Join Date: May 2005
Beans: 151
Re: odd request: Webcam as desktop background?

No, I'm using compiz. xwinwrap doesn't work at all under metacity. But the transparent parts of compiz (i.e. the whole damn point of compiz) don't do a proper transparent overlay over the video background, instead they just show solid blue or solid black or whatever.

Unless I change mplayer's output driver to x11 software rendering, but that's pretty CPU-heavy. If it's what's needed, though, I guess it's what I have to do. I'll just give it a high "nice" value.
__________________
double free or corruption (fasttop)
The Warlock is offline   Reply With Quote
Old August 7th, 2008   #10
loell
☀ ☀ ☀
 
loell's Avatar
 
Join Date: Oct 2005
Location: Davao, Philippines
Beans: 4,681
Ubuntu 9.10 Karmic Koala
Send a message via Yahoo to loell Send a message via Skype™ to loell
Re: odd request: Webcam as desktop background?

this is the best hack i've seen for awhile now.
thanks easybake
loell is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:05 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry