Wednesday, 23 February 2011

Enabling USB Support in VirtualBox for Ubuntu

Unfortunately, I still need Windows.  There are a few applications that won't work properly on WINE in Ubuntu (iTunes and Rosetta Stone to name two)...  So I use VirtualBox to boot Windows XP inside Ubuntu.

Here's the problem: there's no native USB support in VirtualBox.  This makes the whole virtual system just useless.  If you install the virtualbox-ose package from the Ubuntu repositories you will face this problem. The solution is to install virtualbox-4.0 from www.virtualbox.org.  Here's how:

This procedure was tested on Ubuntu 10.10 Maverick using a Windows XP Pro SP3 virtual machine.  The virtualbox started out as virtualbox-ose 3.2.8-dfsg-2ubuntu1 and ended up as Oracle virtualbox-4.0.4-70112~Ubuntu~Maverick.

*Don't worry about your existing virtualbox machines.  The install procedure outlined below is turnkey and  your machines will roll over unharmed to the upgraded application.*

1. Add the virtualbox.org repository

sudo gedit /etc/apt/source.list
Add the appropriate repository relative to your linux distribution
deb http://download.virtualbox.org/virtualbox/debian maverick contrib
deb http://download.virtualbox.org/virtualbox/debian lucid contrib
deb http://download.virtualbox.org/virtualbox/debian karmic contrib
deb http://download.virtualbox.org/virtualbox/debian jaunty contrib
deb http://download.virtualbox.org/virtualbox/debian intrepid contrib
deb http://download.virtualbox.org/virtualbox/debian hardy contrib

Get the Oracle public key:
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

Upgrade virtualbox:
sudo apt-get update
sudo apt-get install virtualbox-4.0

2. Install the VirtualBox Extension Pack

You can grab it here or from the VirtualBox.org downloads page if the address has changed.  Virtualbox manager will open and ask if you wish to install the extension pack (yes).

3. Enable USB support

Add the current user (or whichever user will be running the virtual machine) to the vboxusers group.  You can do this graphically by System > Administration > Users and Groups.  Select the desired user and click Manage Groups.  Scroll to vboxusers, select Properties and add the desired user.



Next, open virtualbox manager if not already open.  You should be able to do this via Gnome Menu > System Tools > Oracle VirtualBox Manager or by launching virtualbox.  Select the machine in question, scroll to USB and enable.  You may need to install a generic usb driver to get the ball rolling.  

Next time you boot the virtual machine, simply right click the USB icon in the lower right hand corner to enable.

 

Finally, USB support for Windows programs in Ubuntu... now that wasn't so hard lol.

Friday, 25 June 2010

How to Manage WBFS Partitions in Ubuntu Linux

A previous post of mine, How To Play Nintendo Wii Games from a USB HD, deals only with the Windows OS.  Suppose you'd like to load Wii games from a USB HD, but you're using, say, Ubuntu Linux?  Well then you would need an alternative WBFS partition manager.

Enter Wiithon.

Wiithon is python-based GUI linux application for managing WBFS partitions.  It's clean, simple to use, and even supports remote updates of game info, pictures, etc.  If your external HD doesn't already have a WBFS partition, Wiithon can create one.  The application can even copy wii games from one partition to another...

The current stable version is 1.1 and I believe development might be at a standstill (the latest repo is Karmic), but it works great on Lucid.  To install, simply run the following commands from Terminal:

grep "deb http://ppa.launchpad.net/wii.sceners.linux/wiithon-1.1/ubuntu karmic main" /etc/apt/sources.list || echo deb http://ppa.launchpad.net/wii.sceners.linux/wiithon-1.1/ubuntu karmic main | sudo tee -a /etc/apt/sources.list && sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1F882273 && sudo apt-get update && sudo apt-get install wiithon && sudo gpasswd -a $USER disk

This will add the Wiithon repository to your /etc/apt/source.list, and download and install the program.  Once installed, you can launch from the Applications > Games > Wiithon menu, but you must be in sudo mode to do so!




If you'd like to give the current user permission to launch (recommended), simply run

sudo gpasswd -a $USER disk

You can now launch Wiithon from the Applications menu using your current user profile!

Tuesday, 22 June 2010

How to Convert MTS to AVI in Linux

I played in an Ultimate tournament yesterday and thought it would be great to take some team video and create a highlights/bloopers reel.  However, this requires some editing on the computer and I was filming with my Sony HDR-SR10, which records in full HD 1080 AVCHD.  This results in an bunch of .MTS files on your computer, and though some media players will play these files, they video quality is chopping and full of weird horizontal lines.

Clearly these video files must be converted to a more workable format....

I've tried many different scripts and packages, including m2tstoavi and handbrake without success.  After some fiddling, it seems that the best option is a customised ffmpeg.  Here's how it worked for me:

1. Download the Necessary Packages

sudo apt-get install build-essential libxvidcore4-dev libfaad-dev libfaac-dev libmp3lame-dev subversion


2. Grab Most Recent FFMPEG

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg


3. Compile the Source Code

cd ffmpeg
./configure --enable-gpl --enable-libmp3lame --enable-libxvid --enable-libfaac --enable-nonfree
make
sudo make install

This will probably take a little while...


4. Configure FFMPEG to Your Camera

Run ffmpeg and pass it one of your .MTS video files to the program.  This will allow you to see some basic info about the video/audio formats your camera uses.  Then, tailor ffmpeg to your camera (assuming you only have one of these super-hd video cameras).  I'm using a sample video called 00451.MTS.

ffmpeg -i 00451.MTS

The important output will be near the bottom:

Input #0, mpegts, from '00451.MTS':
  Duration: 00:00:24.54, start: 1.000033, bitrate: 5510 kb/s
  Program 1
    Stream #0.0[0x1011]: Video: h264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 59.96 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
    Stream #0.2[0x1200]: Subtitle: pgssub

There are 3 streams: video, audio, and subtitle.  I'm not sure what subtitle is, but let's ignore it for now.  Video is in 1440x1080 resolution, pixel aspect ratio is 4:3, display aspect ratio is 16:9, and 59.96 frames per second, at 5510 kb/s.  Audio is in ac3 at 448 kb/s.

5. Use FFMPEG

Now ffmpeg can be used to convert video.  If you only have one or two files to convert, simply navigate to the proper directory, and enter the following comand in your terminal:

ffmpeg -i InputFile.MTS -vcodec libxvid -b 18000k -acodec libmp3lame -ac 2 -ab 320k -deinterlace -s 1440x1080 OutputFile.AVI


But if you have many files you may want to use a batch conversion script.  Create a gedit file in your favourite scripts directory... /usr/share/myscripts will do fine.  Save the following text file to the directory:

#!/bin/bash
for a in `ls *.MTS` ; do ffmpeg -i $a -vcodec libxvid -b 18000k -acodec libmp3lame -ac 2 -ab 320k -deinterlace -s 1440x1080 `echo "$a" | cut -d'.' -f1`.avi ; done
exit

Call it ConvertMTS or something.  When run, this script will convert any .MTS files in the current directory to .AVI and save the new files in the same directory.   To use the script, navigate to your MTS folder in terminal:

bash /usr/share/myscripts/ConvertMTS

.... Sit back and wait :-)

Thursday, 17 June 2010

How to Play DVDs in Ubuntu Linux

Ubuntu linux comes ready to do many things out of the box, but DVD playback isn't one of them.  However, it's quite easy to enable this feature by following the steps below.

To play DVDs in a movie player like VLC or Totem Movie Player (Ubuntu default) you require a package called libdvdcss2.  You can't get this package directly from the repositories, probably for legal reasons, but it can be downloaded via the libdvdread4 package.

sudo apt-get install libdvdread4

Now run the libdvdcss2 install script:

sudo /usr/share/doc/libdvdread4/install-css.sh

This is all you need to play DVDs....Just open via Totem, VLC, or your favourite movie player.  I had to restart the system before it would take effect.

  © Blogger template 'Isolation' by Ourblogtemplates.com 2008

Back to TOP