I am not explaining the way to download youtube videos.
- Install ffmpeg package if not installed yet. Fire up a terminal and issue this command to install ffmpeg
- 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)
sudo apt-get install ffmpeg
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.