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
    Page Visibility API

    One event that's always been lacking within the document is a signal for when the user is looking at a given tab, or another tab. When does the user switch off our site to look at something else? When do they come back?

  • By
    An Interview with Eric Meyer

    Your early CSS books were instrumental in pushing my love for front end technologies. What was it about CSS that you fell in love with and drove you to write about it? At first blush, it was the simplicity of it as compared to the table-and-spacer...

Incredible Demos

  • By
    Dynamically Load Stylesheets Using MooTools 1.2

    Theming has become a big part of the Web 2.0 revolution. Luckily, so too has a higher regard for semantics and CSS standards. If you build your pages using good XHTML code, changing a CSS file can make your website look completely different.

  • By
    CSS pointer-events

    The responsibilities taken on by CSS seems to be increasingly blurring with JavaScript. Consider the -webkit-touch-callout CSS property, which prevents iOS's link dialog menu when you tap and hold a clickable element. The pointer-events property is even more JavaScript-like, preventing: click actions from doing...

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!