Home > English > Extracting Audio from Youtube Videos (.flv files) on a GNU/Linux System

Extracting Audio from Youtube Videos (.flv files) on a GNU/Linux System

I am not explaining the way to download youtube videos.

  1. Install ffmpeg package if not installed yet. Fire up a terminal and issue this command to install ffmpeg
  2. sudo apt-get install ffmpeg

  3. Steer to the folder where you have downloaded the youtube video (the .flv file) and issue the following command (match the command parameter colors with output chara)
  4. ffmpeg -title Some_Title -i Input_video_file_name.flv -acodec vorbis -ac 2 -ab 512000 -vn -y output_audio.ogg
    ==> This will give a 2-channel ogg-vorbis file with 512 kBps bitrate (most recommended)

    ffmpeg -title Some_Title -i Input_video_file_name.flv -acodec libmp3lame -ac 2 -ab 512000 -vn -y output_audio.mp3
    ==> This will give a 2-channel MP3 file with 512 kBps bitrate (least recommended)

I personally prefer OGG over MP3. Quality-to-size ratio is pretty high for OGG-VORBIS as compared to MP3. Try it out yourself.

Possibly Related Posts:


  1. December 23rd, 2008 at 16:19 | #1

    Wow! That was an awesome tip. Thanks a lot, chetta. :-)

  2. Gregory Maxwell
    February 8th, 2009 at 04:03 | #2

    What you should never do is use the “-acodec vorbis” option of ffmpeg as described here. Instead use “-acodec libvorbis”. This small change is very important. The former uses the the internal FFMPEG encoder, the latter uses the libVorbis library.

    The internal ffmpeg vorbis encoder is about the simplest possible encoder that produces working output. It sounds terrible compared to the reference encoder. On a typical musical input the ffmpeg encoder set to 128k produces quality which is obviously worse than libvorbis at 32kbit/sec.

    The ffmpeg vorbis encoder is not going to have better quality than MP3. If you use a proper encoder (libvorbis) you should seldom have a need for a bitrate greater than 130kbit/sec.

  1. No trackbacks yet.

Subscribe without commenting