Convert Video to mp3

By  on  

Let's all be honest for a moment:  we've all ... not paid for ... music.  Whether it was via a file sharing app like Kazaa or Napster, or it was downloading and seeding on bittorrent, or maybe even downloading a music video and ripping its audio, we've all pulled some "gangsta shit" to get a track or two.  You should only feel ashamed if it was Nickleback.  And hey, there are times when you legitimately want to pull audio from a video...though I can't think of any.

If you do want to pull the audio of a video file, for whatever reason, you can do so easily with ffmpeg.  Let's use ffmpeg to take a downloaded YouTube video and rip its audio into and MP3:

ffmpeg -i music-video.webm -vn -ar 44100 -ac 2 -ab 192 -f mp3 music.mp3

Using the command above, we take the source video and output its audio to mp3 with a 192kb/s bitrate.

There are in-browser tools and websites you can use to rip audio from YouTube or other video files, but ffmpeg is quick, simple, and hassle free. You can also replace "mp3" with other audio formats if you so choose!

Recent Features

  • By
    Create a CSS Cube

    CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals.  Add animation and you've got something really neat.  Unfortunately each CSS cube tutorial I've read is a bit...

  • By
    9 Mind-Blowing WebGL Demos

    As much as developers now loathe Flash, we're still playing a bit of catch up to natively duplicate the animation capabilities that Adobe's old technology provided us.  Of course we have canvas, an awesome technology, one which I highlighted 9 mind-blowing demos.  Another technology available...

Incredible Demos

  • By
    MooTools Overlay Plugin

    Overlays have become a big part of modern websites; we can probably attribute that to the numerous lightboxes that use them. I've found a ton of overlay code snippets out there but none of them satisfy my taste in code. Many of them are...

  • By
    Printing MooTools Accordion Items

    Sometimes we're presented with unforeseen problems when it comes to our JavaScript effects. In this case, I'm talking about printing jQuery and MooTools accordions. Each "closed" accordion content element has its height set to 0 which means it will be hidden when the...

Discussion

  1. Joe

    In case anybody is not into command line, there is a UI for this conversion,
    https://addons.mozilla.org/en-US/firefox/addon/media-converter-and-muxer/

  2. Suneel

    Thanks for saving my time!

    "ffmpeg -i music-video.webm -vn -ar 44100 -ac 2 -ab 192 -f mp3 music.mp3" above command helped to convert video to audio (Ubuntu machine).

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!