Sunday, August 28, 2011

Extracting audio clips from YouTube videos

If you use the stock Ubuntu v10.04 youtube-dl version, you may encounter this error message when trying to download a YouTube clip:
youtube-dl http://www.youtube.com/watch?v=
ERROR: no fmt_url_map or conn information found in video info
The solution is to git clone the youtube-dl repo and use the latest youtube-dl version:
git clone https://github.com/rg3/youtube-dl.git

Extracting only the audio portion means that you should set the -vn option, which disables video encoding. The -acodec option determines the output format. So you would execute the command (depending if you want Ogg bitstream or Mp3 format)

ffmpeg -i  -vn -acodec vorbis 
ffmpeg -i  -vn -acodec mp3 

No comments:

Post a Comment