Archive for the programing Category

How To: Video’s for the iPod made easy, for Linux

Posted in programing on July 13, 2007 by Haxx Wolf

ipod-video.jpgThere are a lot of How to’s out there that can tell you how to rip and put DVD’s or any other video’s on your iPod, many people will say there are many things that you have to do, and there are some of them that are very terminal based, but this is easy, well it was the easiest way I could find, and in the past week I have put loads of movies on to my iPod and they all work fine, with good quality picture and sound.

Step 1: Ripping the DVD

Obviously if you already have a .avi or .mpg then you can just skip this part.

But if you have all your favorite movies on DVD then you will need to run the following command in a terminal window:

sudo apt-get install acidrip libdvdread3

doing this will install the two packages acidrip and libdvdread3. Acidrip is the face package for ripping the DVD’s, on its own it can only rip unencrypted DVD’s, this is where libdvdread3 comes in, this works with acidrip to decrypt the latest DVD’s with the “anti-copy protection”.

Once you have both of these installed simply load up acidrip, insert the DVD into the computer or laptop, and in the top right-hard corner of the window you will see “Load”. Once pressed all the chapters from the DVD will be displayed in a list, simply select the chapters you want (to make sure you have the right ones you can check them in the “Preview” tab at the top) and select the video codec (I use .avi) and select the audio codec (for .avi use mp3lame (*this may require additional codecs, but if you are already using audio players to play mp3’s then the codecs should be there already)*). Once this is done click “Start” and the ripping will commence, Once done you should now have a .avi of the movie in your user directory.

Helpful Tip: If you are trying to rip a series DVD then you can use the “Queue” button at the bottom next to “Start” by selecting an episode chapter and clicking “Queue” then selecting the next episode chapter and clicking “Queue” and, well you get the picture. Once all chapters are queued just click “Start” and it’ll do all the rest.

– Step 2: Converting the .avi

In this section I will tell you how to re-encode your movie, I will be refering to the movie as being a .avi, but it will work the same if it is a .mpg. At the moment these are the only two I have gotten working but if I find other formats that work I will post them up as well.

As you know the iPod will only accept a .mp4 coded file, so at the moment the .avi is useless to the iPod (however this does mean you now have a back up of the DVD). To get the .avi to a .mp4 I use avidemux. So in a terminal window run:

sudo apt-get install avidemux

Once installed right-click on the .avi file and “open with other application” in the list this shows there will be no avidemu, so you have to use a custom command:


This will open up avidemux and if you are using a .avi it will ask you to build a time map, to which you answer yes, if you are using a .mpg it will ask you to do something as well and again just answer yes. Depending on the file size the time it takes may vary. Now that you have the movie loaded up in avidemux you need to change th following:


You need to change them to look like this:


*Again this part my require you to install some further codecs*

Sorry, but I can’t remember exactly what it was that I installed but if you look around and around google I’m sure that you will find the codec you need. I think it’s ffmpeg but not completely sure. Again sorry about that but if you can get it working then your almost done.

Once the window is set up (See Picture Above) then go to File/Save/Save Video, then pretty standard stuff, type a file name followed by “.mp4” (otherwise the next step won’t work) and choose a place to save it (I suggest your normal user directory) and then just let it do it’s work.

Since there is a problem with the iPod accepting this encoded mp4 you will have to run it through a re-container to make it a fully working mp4. Now I know what your thinking, what exactly is the difference between the mp4 from avidux and the one that come out of the re-container? Well, to tell you the truth I don’t realy know, but I do know that if you put the mp4 from avidemux straight on to the iPod it won’t work, it will show on the screen but won’t play all you’ll get is a black screen for about 10 seconds and then it will take you back the the movies menu, or it will simply play but with no sound.

So I sugest that wile the video is encoding you go back to the terminal and do:

sudo apt-get install gpac

This is a terminal based program that re-pacages the mp4 and will fix the mp4 produced by avidemux. Once you have the completed mp4 from avidemux pull up a terminal window and type:

MP4Box -add ‘original.mp4’ ‘fixed.mp4’

* when typing in the original you also have to add its directory, and when putting in the name of the new fixed mp4 you need to also give the program a directory to put the fix in, for example:

scully@Laptop:~$ MP4Box -add ‘/home/scully/26.mp4’ ‘/home/scully/ghost26.mp4’
Or in other words just type the “MP4Box -add” then space, then drag the original file into the terminal (if there is a space in the file name it will be put in ‘ ‘ ) follow this wit ha space and then type the name of the new file to be created. (I usually use a simple file name e.g. 001.mp4, as long as you remember which one is which if your doing several in one batch, cause you can always go back and rename it later)

Helpful Tip: If you have just ripped a series DVD that produced several files, why not leave your computer one over night and convert them all at once (at the moment I am doing all this on a Compaq Armada M700, it’s quite old and it only has a pentium 3 processor, but every so often I leave it on over night and convert about 4-6 files in one batch) So put the files into batches and do a batch every night.

– Step 3: Putting the .mp4 on the iPod

To put the .mp4 into the iPod there are several programs with iPod support but the best program I found to put videos on the iPod is gtkpod. to install this go to a terminal and type:

sudo apt-get install gtkpod gtkpod-aac

Then once it’s finished load up gtkpod with your iPod plugged in and mounted and at the top of the window you will see “load ipod(s)”, click on it and it should load your iPod, once it is load you should see it in the library list down the side, in the picture bellow this is shown as the library “rei. There should be no additional configuration inside gtkpod to find your iPod, but I’m not sure, I didn’t get any problems but I can’t guarantee it on other systems.


(In the picture above my iPod is not connected)

Then like most programs like this just go to “files – add files” this will put them in the gtkpod library and then just drag them from there into the iPod. Then just wait till it’s copied your files click on save at the top and then you can dismount and unplug your iPod, and the videos should be on you iPod and they should work perfectly.

I hope you Enjoy using this how to and I hope that if you use this method it will work for you.