Friday, July 14, 2006

Setup XGL/Compiz on Ubuntu and have your videos play at normal speed

I recently followed the instructions for installing XGL/Compiz in Ubuntu. Check this out, XGL and Compiz now accomplishes what Windows Vista plans to accomplish in 2007. Want to see it in action? Click on this link and then view the movie for "Visual Workspace". This shows it on Suse, but it works equally well on Ubuntu with ATI or Nvidia video cards. If you don't have one of these video cards, you may want to check out this link for AIGLX. XGL and Compiz provides your desktop with incredible visual effects and a cube you can spin to select one of four desktops for you to work/play on. My machine is only a 1.5 ghz processor with 512mb of RAM and a 32mb Nvidia card and XGL/Compiz worked perfectly after install. The only thing that didn't work was the playback of video formats like Quicktime and .wmv files. They played back very slow and this frustrated me. Apparently XGL/Compiz is very new at this date and is not fully compatible with all video drivers. After about 200 Google searches I found this link to fix video playback and it worked perfectly.

To sum it up, follow these instructions for good video playback after XGL/Compiz install.
  1. Google or search the Ubuntu Forum or Ubuntu Guide and figure out how to install Mplayer or view more notes below to see how to install Mplayer and the Firefox plugins automagically.
  2. After you install Mplayer edit ~/.mplayer/config and append a line: vo=gl2,sdl,x11
  3. The~/.mplayer/ folder can be found by opening Nautilus in Gnome and selecting the option to View Hidden files.
  4. To have a video play in Mplayer by default, right click the video in Nautilus, choose properties and select Mplayer as the default video player.
I used KSnapshot for this screenshot by using a 10 second timer to get the cube in the position I wanted it for the screenshot.
This is the screen you'll see when you are in Nautilus, right click a video file, select properties and then click on the "OpenWith" tab as shown:
This is the screen you'll see when you right click Mplayer, select properties, choose the Video tab and then choose "X11" for the driver. This driver selection played all of my video files perfectly with XGL/Compiz running.I used Automatix to install Mplayer and lots of other useful software. Automatix also installed the Mplayer plug into Firefox so that Quicktime Trailers play perfectly in Firefox. One more tip, the first time you play an embedded Mplayer movie in Firefox, you might have to right click the movie, select properties and choose the X11 driver. Try it,'ll like it.

If you want to disable XGL/Compiz and return to your original GDM then delete all of the text in file sudo gedit /etc/gdm/gdm.conf-custom, save the empty file and if you had "thefuture" setup to start automatically then disable it. Restart your PC and XGL/Compiz will not start. I found this removal method half way down the page at this link .