Tuesday, August 11, 2009

Convert Youtube videos to audio in Linux

After reading Martin’s fine article “Download Youtube Videos” today, I had to give a bit of a Linux perspective and show how to do this in the Linux operating system. Inititially I assumed this would have to be done via the command line, because that is how I have always done conversions. But I have found that many people do not like having to do such tasks from the command line. So I sat out to find a good (and by “good” I mean easy). It didn’t take long to find, it didn’t take long to install, and it didn’t take too long to get working the way I wanted (which means including mp3 support).

The tool I eventually settled upon is Elltube. Of all the available tools this was the easiest to install, get working, and the most reliable. With this tool you will find download and converting Youtube videos a nobrainer. There is only one small hitch. If you want to add mp3 support you will have to do some extra installation (In this case it means installing unsupported files). The distribution I will use for this tutorial is Ubuntu 9.04. I will illustrate converting videos into audio-only mp3 format. This is the format that causes issues with most users due to the necessary installation of mp3-supporting libraries.

Preparing for the installation of Elltube

The good news is that everything you need, outside of Elltube itself, will be located in the default repositories. The bad news? You will have to install restricted applications. What this means is that Canonical is not responsible for the updating of these files. With that said you will need to fire up Synaptic. I do not suggest you just open up the Add/Remove Software utility from the menu. Instead open up a terminal window and issue the command:

sudo synaptic

The above command will open up the full-blown Synaptic tool where you will need to do the following:

  1. Search for “lame” (no quotes).
  2. Scroll down until you see the “ubuntu-restricted-extras”.
  3. Mark “ubuntu-restricted-extras” for installation.
  4. Search for “ffmpeg” (no quotes).
  5. Mark “ffmpeg” for installation.
  6. Click Apply to install.

Once all of this has installed download the Elltube .deb file and save it to your ~/ directory. After this file download has completed open up a terminal window and issue the following command to install:

sudo dpkg -i ~/elltube_0.3-1_all.deb

which will install Elltube. You are ready to convert.

Converting a video to mp3 format

Figure 1

Figure 1

You will find Elltube in your Internet sub-menu of either your Main or Applications menu. When the Elltube application opens you will see the Main window (see Figure1). There isn’t much to this application from the GUI perspective – but it serves the purpose well.

The first thing you need to do is find a video you want to convert on Youtube. Let’s convert a live version of Rush’s La Villa Strangiato. Find the URl and then copy and paste into the

Figure 2

Figure 2

Youtube URL area. When you do this the details of the file will appear in the main window (see Figure 2). Now what you have to do is to select MP3 (audio only) from the Format drop-down and select a Save to location for the download and conversion. When the details are done, click the Download button and the process will begin.

When the conversion process is complete the “Video found!” message will change to let you know it is finished. When it has completed you will have your mp3 file in the Save to folder. You are ready to rock!

Final thoughts

Elltube makes the downloading and conversion of Youtube videos as simple as it gets. The ease at which this process is done makes the installation well worth it.

1 comment:

  1. For reference, here's how I do it:

    last_vid=$(ls -1rt /tmp/Flash* | tail -n1)
    mplayer -ao pcm -vo null -vc dummy $last_vid
    oggenc audiodump.wav vid.ogg

    ReplyDelete