Monday, May 19, 2008

iPod from Ubuntu

The mac hard disk died taking iTunes along with it and i wanted to copy some songs off the ipod. Connecting the ipod to a different computer running itunes was no help as only 1 computer can manage the ipod. This is the 30 gig 5th generation model. (x9585)

So i installed gtkpod on ubuntu along with Gpixpod (for download pictures to it) and Hipo
Ran the Gtkpod and it found the plugged in ipod and took a minute to retrieve the 1500 songs on it. It did display an error message about being unable to open 'itunesDB.ext' for reading extended info. I think that is because apple changes the ipod database. I don't store album covers or any of that stuff anyway.

Copying a track off the ipod was as easy as highlighting the track and right clicking and selecting Copy selected track to local.

However, trying to play a track gave an error message about xmms. Apparently it is not installed, which is odd - a package should know it dependencies and install them when it is installed. Anyway we install XMMS from the package manager and Audacious while we are at it. We exit and restart.

The play function now works - it load the X window music player which looks a lot like winamp, which i use on windows in preference to the media player.

I find the UI a bit confusing. The bottom pane displays the tracks but there are two side by side windows on above it whose purpose it not clear. They have tabs to sort by artist, album, genre on both panes. I see it is a browsing resource discovery function that uses filtering. For example, if you select Rock as a genre in the first window you can narrow it down by filtering by artist or album in the second.

Clicking on the special tab brings up an advanced search function. You can use Boolean logic but the fields you can search on are limited such as rating and played. You can't seem to do a search for country songs

Update - the macbook hard disk died so i needed to get the songs off the ipod but i didn't want to copy them song by song - a straight dump of everything into Ubuntu was needed. The worry was the ipod hard disk would die, which happened to the first ipod. I didn't want to have to import all the songs from the backups and re-enter all the metadata.

I installed Banshee and it picked up the ipod immediately. However, the ipod had been upgraded to the latest version of itunes which prevented banshee from reading its database. Banshee helpfully allowed me to rebuild the ipod database to make it accessible. I was able to now copy the entire music collection from the ipod to the Ubuntu laptop. The next test is to take the ipod to the Ubuntu desktop and plug it in and see if Banshee on that machine can manage it too - itunes has a very annoying restriction that only 1 computer can manage the ipod.

Video

I had copied some Ubuntu tutorial movies in mpeg format to the ipod using iTunes to show in class using the AV cable. The movies worked well when viewed on the ipod but when plugged in to an external monitor only the audio was available - no video could be seen. I suspected the cable but....

Today i discovered that the ipod considered the files to be audio files not video files. This provided the opportunity to test out putting some downloaded cartoons on the ipod. The clips were in .AVI format and dragging them to the ipod doesn't work as it says it can't play them.

Ok so we have to convert them. As it turns out the excellent open source player we use, called VLC can also convert video - who knew?

Our first attempt was in fiddling with some of the included video programs in Ubuntu but the conversion to the ipod format did not seem to work. We had success in using DeeVeeDee to convert some divx movies and burn them to standard DVD discs for regular players. The only issues seems to be that some discs work with both upstairs DVD players but some only work on the one universal player. Anyway we went back to VLC.

Following the detailed guide written by loqu (AKA Rob) at http://wiki.videolan.org/IPod i opened some files and let VLC convert them. It was quite quick although getting the settings right is a bit tricky.

You basically open the file you want to convert, check the Stream/Save box and click Settings.
Save the streaming output to a file with an .mp4 extension with the following settings:

Video codec = h264 at 768 kb/s
Audio codex = =mp4a at 128 kb/s
The code in the Stream output MRL Target box has to be edited to add width and height values with the added text inside the {} brackets being width=320,canvas-height=240

One problem is if you are converting a number of files you have to add this each time. However, i am sure i left it out but it did not seem to matter as i had to do a second step anyway. You can always do this in batch mode with a script.

Once the file was converted i imported the mp4 video files into iTunes Movies. Then i selected a file and right clicked to bring up the itunes menu. Select Convert Selection for iPod/iPhone and the file is processed. Once it is done you have 2 files - delete the original and copy the converted file to the iPod icon in iTunes. (I sync manually - if you have automatic syncing on then it should copy the files when you plug in your ipod).

I can now play the video files in the iPod and they are the correct resolution and look pretty good. Of course they are cartoons, i have not tried this yet with regular movies. As a test i should convert a old black and white movie like Gunga Din or Lives of a Bengal Lancer or Charge of the Light Brigade to the older non-color ipod. You would think that as portable video players fall in price and increase in capacity that there would be a market for ipod-ready movie downloads. It seems ready-made for tutorials or TV shows like Dotto Tech or Coronation Street.

No comments: