Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: odd request: Webcam as desktop background?

  1. #1
    Join Date
    May 2005
    Beans
    150

    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)

  2. #2
    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?

  3. #3
    Join Date
    May 2005
    Beans
    150

    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)

  4. #4
    Join Date
    Apr 2008
    Beans
    332

    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 11:58 AM.

  5. #5
    Join Date
    May 2005
    Beans
    150

    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)

  6. #6
    Join Date
    Apr 2008
    Beans
    332

    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

  7. #7
    Join Date
    May 2005
    Beans
    150

    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)

  8. #8
    Join Date
    Apr 2008
    Beans
    332

    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 8th, 2008 at 02:30 AM.

  9. #9
    Join Date
    May 2005
    Beans
    150

    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)

  10. #10
    Join Date
    Oct 2005
    Location
    Davao, Philippines
    Beans
    4,831

    Re: odd request: Webcam as desktop background?

    this is the best hack i've seen for awhile now.
    thanks easybake

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •