Sometimes you like a dialogue of a film you watch on DVD and you wish you could listen to it while on the move, for example using an iPod. Or maybe you recorded a karaoke session on video, like A.Nurboe and you would like to convert the video into audio only mp3 files. Regardless of the reason, it’s possible to convert the video DVDs into audio only mp3s using Linux and mplayer. Disclaimer: in some countries the legality of this kind of conversion might be in question even if you own the DVD, it’s up to you to make sure you don’t break any laws. It’s usually legal to convert the videos you recorded yourself.

What do you need:

  1. Linux, any distribution will do. Linux can be installed on the physical hardware or in a virtual machine (like for example VMware, Xen, VirtualBox or Virtual PC). It is important that you have access to a DVD drive. Otherwise you’ll have to first create an .iso image of the video DVD you want to convert. mplayer is also available for Windows so you could try the same process using Windows if you prefer.
  2. mplayer. Installation of mplayer depends on the Linux distribution, some have it preinstalled, others require you to install it yourself. For most users the easiest option will be to find pre-built binaries in .rpm, .deb or other appropriate format and install them. I’m not going to go into details here, if you need directions drop me a comment.
  3. DVD with the videos you want to convert. If your Linux installation can access a DVD drive you just need to insert the DVD disc, otherwise you need to create an .iso image.
  4. Some program to convert .wav files into .mp3. Anything you use to convert CDs to mp3 can usually convert .wav files also.

Preparations:

  1. Decide whether you want to convert the whole video or only some specific fragments.
  2. Decide whether you want to convert the video into one audio file or maybe you prefer separate file for each chapter.
  3. If you decided to do the conversion from an .iso image you need to create it.
  4. Make sure you have enough disk space for the audio files. You need about 6 MB per one minute.

Conversion:

  1. Create .wav files from your video using mplayer. The command to execute is:
    mplayer dvd://1 -chapter [first chapter]-[last chapter] -vc null -vo null -alang [language code] -ao pcm:waveheader:fast:file=[output file] -dvd-device [path to .iso file] -ss [start time in seconds] -endpos [duration in seconds]

      where:

    • dvd://1 usually is the correct option although sometimes (depends on the DVD) it will have to be another number instead of 1. The number corresponds to the DVD title on the disc; usually 1 is the main video.
    • [first chapter] – is the first video chapter to start the conversion from.
    • [last chapter] – is the last video chapter to finish the conversion with; in case your video has no chapters or you want to convert the whole video into a single audio file you should skip the whole -chapter [first chapter]-[last chapter] fragment of the command; in case you’re converting each chapter of the DVD to a separate audio file the [last chapter] must be the same as [first chapter] and you need to run this command for each chapter (with a different output file each time).
    • [language code] – code of the audio language, this is important if the video has audio track in multiple languages; for example English is en, Spanish is es, Hungarian is hu.
    • [output file] – the path to the output audio file including the .wav extension.
    • [path to .iso file] – the path to the source .iso file of the video; in case you are converting without first creating the .iso file you should skip the whole -dvd-device [path to .iso file] fragment of the command.
    • [start time in seconds] – this option can be used to specify how many seconds at the beginning of the video should be skipped; you should not use this option if you want to convert the whole video.
    • [duration in seconds] – this option can be used to specify how many seconds of the video to convert; you should not use this option if you want to convert the whole video. This option together with -ss is useful when you want to do a trial run and convert just a short fragment first to see if it works or if you need to skip some fragments at the beginning or at the end.
      Some examples:

    • Save audio of chapter 4 of the DVD disk as file chapter4.wav:
      mplayer dvd://1 -chapter 4-4 -vc null -vo null -alang en -ao pcm:waveheader:fast:file=chapter4.wav
    • The same but from an ISO image:
      mplayer dvd://1 -chapter 4-4 -vc null -vo null -alang en -ao pcm:waveheader:fast:file=chapter4.wav -dvd-device image.iso
    • Save audio of chapters 2 to 14 of the DVD disk as file chapters2-14.wav:
      mplayer dvd://1 -chapter 2-14 -vc null -vo null -alang en -ao pcm:waveheader:fast:file=chapters2-14.wav
    • Save the last 10 seconds of the first minute of chapter 3 from the DVD disk as file chapter3.wav, this time we want the Spanish soundtrack:
      mplayer dvd://1 -chapter 3-3 -vc null -vo null -alang es -ao pcm:waveheader:fast:file=chapter3.wav -ss 50 -endpos 10
  2. Convert .wav files to mp3 format or any other you prefer using a program you like.

That’s it. Enjoy the new mp3s!



Subscribe to olivetalks to receive an email whenever a new post appears in the category of your choice.
Print This Post Print This Post

Tags: , , ,

One Response to 'Convert videos to audio'

Subscribe to comments with RSS or TrackBack to 'Convert videos to audio'.

  1. April 20th, 2008 at 8:46 pm
    A.Nurboe said,

    Thanks for the post, ZoltarStark!! I’ll let you know how I get on with it :)

Post a comment