Tuesday, December 29, 2009

Convert YouTube Video to MP3 Audio (Updated)


Someone recently asked me, "You know how singers publish their songs as music videos on YouTube?" 


<"How do you get the music without the video? Make it into an MP3 sound file?"
The easiest approach is to download the FLV video version of the music video and then strip out the audio and save it to MP3. Of course, there are approaches that allow you to go straight from YouTube video on the Web to an MP3 file you can save on your computer...we'll start with those approaches first:

How To Go Straight From YouTube Music Video to MP3
  1. Use Media-Converter, a web-based service that not allows you to convert video to audio, but you can actually browse YouTube and add items to the list to be converted. Pretty awesome!
  2. YouTube to MP3 Converter. From their web site: ...the only thing you need is a YouTube URL. We will start to convert the audiotrack of your videofile to mp3 as soon as you have submitted it and you will be able to download it.
Converting from FLV to MP3 or OGG
You can also download the FLV file and then strip out the audio from the FLV video file. There are many tools you can use to download FLV...ClipNabber.com,  Keepvid.com are only a few of those. 


To convert from FLV to MP3...depending on what computer you are on:

GNU/Linux:
  • On UbuntuLinux, although it will probably work for others (download source here)

    Required Software

    I am using Ubuntu Linux, but the concept should be the same for other distros. Make sure you already have all of the multimedia codecs including ffmpeg and mplayer. You will also need to install youtube-dl:sudo apt-get install youtube-dl 
    Downloading YouTube Videos on Linux (works on Windows)
    To download YouTube videos on Linux, use youtube-dl in the terminal like this:
    youtube-dl [options] video_url

    Ripping MP3s from YouTube Videos on Linux

    It is easy to extract MP3 audio from a YouTube movie on Linux with mplayer.
    The method to rip MP3 audio from FLV files with ffmpeg from this site doesn't work on my computer so I use mplayer to do it:
    mplayer -dumpaudio old-file.flv -dumpfile new-file.mp3

    Automating the Process with a Shell Script

    If you want to download a set of YouTube movies and convert them to MP3 audio, or save them as MPG movies on your hard drive, you can automate the process with a shell script.This is just a quick script showing how it might be done. Use the following code at your own risk, and make sure you understand what it does before doing it. It will delete all the FLV files in the current directory after it processes them.
    Here's the script...I renamed it to "video2mp3.sh"

    Follow the excellent instructions outlined at this blog post. Works great and not just for YouTube downloaded videos in FLV format...you can use it to extract audio from ANY FLV file. The command using ffmpeg:


  • ffmpeg -title “my_title” -i filename.flv -acodec mp3 -ac 2 -ab 128 -vn -y filename.mp3

Windows:
  • Use FLV Extract...you'll need to have .NET Framework 2.0 installed. The benefit of using FLV Extract, as opposed to other converters, is that the program won't re-encode the audio (which might result in sound quality issues). FLV Extract can do multiple files at once, so...this may be the best app if not using a web-based service.
  • Download FLV video then use one of these 4 tools to convert it....
    Use Freez FLV to MP3 Converter - http://tinyurl.com/5jhjhh
    Use VLC Media Player - http://videolan.org - Record online video stream to a file.
    WinFF or FormatFactory - http://www.formatoz.com/
  • Pay for a software program that will do the conversion for you...more on that below.
Macintosh
  • Use GetTube, an application that will allow you to download YouTube video straight to MP3. I couldn't get this to work in Snow Leopard 8-<
  • Use Free Video Downloader and then convert it with VLC Media Player.
Purchasable Programs and Copyright
Finally, be aware that you can buy TubeSock for Windows and/or Mac for $15. Note that this is not an endorsement...using any of these program will constitute a YouTube license violation. However, knowing how to convert FLV video format to MP3 audio is certainly a valuable thing to know how to do.

For general conversion on a Mac, you might consider FFMPEGX...$15 shareware. Sigh.



Subscribe to Around the Corner-MGuhlin.org





Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure
Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner

Disclaimer

Disclaimer

Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure