Youtube music
There's loads of music on YouTube. However, when I want to listen to music, I'm not necessarily interested in slideshows. And yes, that's a euphemism.
Luckily, extracting the video and audio from a youtube clip isn't very hard.
- First, download the clip. Yes, that's possible. This will get you a movie clip, by default in the highest quality format available for the particular clip you're trying to download.
- You want to know which codecs the clip is using. Mplayer to the rescue:
wouter@carillon:~$ mplayer -frames 1 -v <file> 2>&1|grep -i 'stream.*audio' [lavf] stream 1: audio (vorbis), -aid 0
meaning, this particular file has Vorbis audio. - Next, extract the audio:
ffmpeg -i <file> -vn -acodec copy <output>.ogg
The critical bit is the '-vn' part, which tells ffmpeg not to encode the video to the output file. The 'mplayer' step isn't strictly required; but since youtube only uses lossy audio codecs, re-encoding the audio to a different codec will cost you audio quality. You may not want to do that; hence the mplayer step (to figure out which codec the source file is using), and the '-acodec copy' argument to ffmpeg's command line (which tells ffmpeg to not re-encode the audio, but just store the unmodified original audio stream in a different container file).
Tadaa, music without video.
Hi,
you can skip the step with mplayer and figure out filetype of audio later using file utility:
$ file audio.ogg audio.ogg: Ogg data, Vorbis audio, stereo, 48000 Hz, ~112000 bps, created by: Xiph.Org libVorbis I $ file audio.mp3 audio.mp3: Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
I think you can extract the audio with
mplayer -novideo -dumpaudio -dumpfile
Downloadhelper is a browser add-on that simply downloads almost any music or video from a website... sounds easier to me.
cheers, paul