Page 1 of 4 123 ... LastLast
Results 1 to 10 of 39

Thread: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

  1. #1
    Join Date
    Apr 2008
    Beans
    332

    HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    This tutorial will show you how you can use your webcam feed as your wallpaper (For people who constantly need to look at themselves).
    This will NOT make you lose the functionality of icons, conkys, screenlets, or docks.

    From this_To This!
    *If you are clever enough and have time to do some tinkering, jdong pointed out that you could use this same idea to create a transparent display effect*

    1. Check Requirements:
    This will only work with Compiz-Fusion enabled as your Window Manager. Click Here for installation instructions.
    NOTE: This won't require any special settings in CompizConfig Settings Manager.

    This will also require Mplayer being installed. Click Here for installation instructions.


    This also requires an already working webcam.
    2. Download Xwinwrap.

    Installation Option 1
    Open Accessories>Terminal
    Enter the following codes:
    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
    Code:
    sudo cp xwinwrap /usr/bin

    Installation Option 2
    Go to this URL. http://www.getdeb.net/app/xwinwrap

    Select the option that fits your system.

    Click Download Xwinwrap

    A download popup should appear.

    Select the option Open with GDebi Package Installer (default)

    Click OK
    The rest of the installation is automated.[/quote]

    You have now successfully installed Xwinwrap.

    3. Test it out.

    In Terminal
    Code:
    cd
    Code:
    xwinwrap -ni -o 0.20 -fs -s -sp -st -b -nf -- mplayer -wid  WID -quiet -fps 15 tv://
    If you want a Mirror effect add this to the end of the line above
    Code:
     -vf mirror
    NOTICE: When you close the terminal window it will stop Xwinwrap.



    4. Create an easy way to start/stop this effect
    .

    In Teminal
    Code:
    gedit toggle
    Paste this in your 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
    NOTE: If you want the Mirror effect, after "tv://" , on the same line add:
    Code:
     -vf mirror
    Save and close.

    You now need to make the script executable.

    In Terminal
    Code:
    sudo chmod a+x toggle
    5. Create A Launcher:

    Right Click on either the desktop or on your panel.
    For Desktop select (create Launcher)
    For Panel select (click Add To Panel)+(Custom Application Launcher)

    For Name input anything.
    For Command input
    Code:
    ./toggle
    You can leave the comment section blank.
    Click Ok.

    You're done!
    -----------------------------------------------------

    Dissecting the Xwinwrap code.
    Code:
    xwinwrap -ni -o 0.20 -fs -s -sp -st -b -nf -- mplayer -wid  WID -quiet -fps 15 tv://
    -ni means No Input
    -o 0.20 is the Opacity setting from 0 to 1
    -fs means FullScreen
    -s means Sticky(its on all workspaces)
    -sp means Skip Pager (window won't appear in pager)
    -st means Skip Taskbar (window won't appear in taskbar)
    -b means Below
    -nf means No Focus
    -wid creates a window id
    --mplayer means mplayer
    -fps 15 means 15 Frames Per Second
    tv:// tells mplayer to use the default video input device.
    -vf mirror means video filter Mirror.

    Feel free to change any of these if you want it to act differently.
    More filters and effects can be found by opening Terminal and typing
    Code:
    man mplayer

    -----------------------------------------------------

    Problems you may run into.

    If you have another video input device hooked up to your computer you have to tell mplayer which one to use. The tv:// command alone selects the default device. Ace214 pointed out that you would have to use
    Code:
    -tv device=/dev/video1
    *change the path to where the webcam device is located if not /dev/video1*

    Other programs can't use the webcam simultaneously. I suggest turning Off the program before you use other programs.

    Suspend-To-Ram won't work while your webcam is on. I suggest turning Off the program when you don't want it in use. You could also add the line killall xwinwrap to /etc/acpi/sleep.sh Which would kill the process before suspending to ram. You can also add the line killall xwinwrap to /etc/acip/hibernate.sh if you have problems suspending to the hard drive.

    This apparently only works using the X11 driver in Mplayer. Other drivers tend to not be capable for handling due to the lack of indirect rendering on some Intel cards.

    Got to give credit to The Warlock, gaminggeek, Valdi, and cammin for pointing out problems


    -----------------------------------------------------

    (For more info on Xwinwrap click Here or Here)

    Credit for the original idea Here and Here
    Last edited by easybake; September 8th, 2008 at 08:53 PM.

  2. #2
    Join Date
    Apr 2008
    Beans
    332

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    Let me know if you have any ideas on what to add/change.

  3. #3
    Join Date
    Aug 2007
    Beans
    6

    Wink Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    Wonderful howto, thank you

  4. #4
    Join Date
    Apr 2008
    Beans
    332

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    Quote Originally Posted by melchiorre View Post
    Wonderful howto, thank you
    thanks

  5. #5
    Join Date
    Jun 2007
    Beans
    53
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    Great How-To, what exactly is that running on the top right of your desktop?

  6. #6
    Join Date
    Apr 2008
    Beans
    332

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    Quote Originally Posted by Eastisle View Post
    Great How-To, what exactly is that running on the top right of your desktop?
    Thanks. Thats just Pidgin with a Screenlet with a Transparent Theme.

  7. #7
    Join Date
    Jan 2007
    Beans
    63
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    First off, thanks for the awesome howto!

    However, I've found a slight problem: When the song changes in Rhythmbox, the popup that comes up is invisible under the webcam feed. It'll be visible if I use gnome-do to show the notification before I start the feed (using the toggle script), but if I start it afterwards, it doesn't show anything.

    Any ideas as to what this might be, fixes, etc.?

  8. #8
    Join Date
    Apr 2008
    Beans
    332

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    Quote Originally Posted by Prometheum View Post
    First off, thanks for the awesome howto!

    However, I've found a slight problem: When the song changes in Rhythmbox, the popup that comes up is invisible under the webcam feed. It'll be visible if I use gnome-do to show the notification before I start the feed (using the toggle script), but if I start it afterwards, it doesn't show anything.

    Any ideas as to what this might be, fixes, etc.?
    Thanks. I believe that problem is because Rhythmbox won't show that little popup window if you have any window set to fullscreen.

    (It's actually a good feature because it would be kind of annoying if that popup showed up while watching a full screen video or playing a game)


    Here's a fix for it. You have to edit the line in the Toggle Script.

    In Terminal
    Code:
    gedit toggle
    remove the entry
    Code:
     -fs
    and replace it with
    Code:
    -g 1280x1024
    (edit that line to fit your screen resolution)

    You end up having a title bar to deal with.

    Save and Close.

    If you close Xwinwrap with the title bar you have to click the toggle button again to retain use of your webcam.
    Last edited by easybake; August 22nd, 2008 at 11:38 PM.

  9. #9
    Join Date
    Jul 2007
    Location
    USA
    Beans
    194
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    I can't get this to work correctly. I can only get it to work when the opacity is set to 1. Otherwise, it just darkens my background picture. I haven't tested it with a webcam- I've been using movie files in mplayer with the same settings, but it should still work...

    Any ideas?

    UPDATE: If I install xserver-xgl, it works but it completely takes over my CPU. I was using the mesa driver before... I tried using the X11 driver in mplayer, but there are multiple ones, and some freeze my session.
    Also some screensavers, like glmatrix, only work properly with xgl installed on my box. So perhaps this is a bug of the mesa driver or xwinwrap not working properly with each other??
    Last edited by ace214; September 5th, 2008 at 04:50 PM.

  10. #10
    Join Date
    Apr 2008
    Beans
    332

    Re: HOWTO: Use your webcam feed as a wallpaper using Xwinwrap.

    Quote Originally Posted by ace214 View Post
    I can't get this to work correctly. I can only get it to work when the opacity is set to 1. Otherwise, it just darkens my background picture. I haven't tested it with a webcam- I've been using movie files in mplayer with the same settings, but it should still work...

    Any ideas?

    UPDATE: If I install xserver-xgl, it works but it completely takes over my CPU. I was using the mesa driver before... I tried using the X11 driver in mplayer, but there are multiple ones, and some freeze my session.
    Also some screensavers, like glmatrix, only work properly with xgl installed on my box. So perhaps this is a bug of the mesa driver or xwinwrap not working properly with each other??
    Definitely sounds like a driver problem. I've heard of people having problems on some intel based cards where indirect rendering isn't supported. So you might be out of luck. gaminggeek pointed out that you still might be able to use the opengl mplayer plugin. But I'm not sure if that will help your situation.

    SideNote: if you wanted to test out your webcam just with mplayer you can use this in terminal
    Code:
    mplayer -fps 15 tv://

Page 1 of 4 123 ... LastLast

Tags for this Thread

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
  •