从YouTube视频中提取音频

12

使用Java YouTube API仅检索YouTube视频的音频是否可能?

2个回答

4

如何在程序中提取YouTube视频的音频?非常相似。

那里的最佳答案是:

Writing an application for this might be overkill. Existing tools already do a pretty good job, and it's hard to beat their simplicity:

wget http://www.youtube.com/get_video.php?video_id=...

| ffmpeg -i - audio.mp3

All done!

If your application needs to do something special with the audio afterwards, it would make sense to write an app for that part. But for just getting the audio out, shelling out to ffmpeg will be a lot easier.

感谢John Feminella提供的答案。


1
这不完全是我需要的,但这是我的错,因为我没有表达清楚。我正在为学校项目构建RIA,并使用Echo Nest Api基于歌曲相似性获取播放列表。我需要其他API来获取知道歌曲名称的mp3。当请求完成时,我必须这样做,所以我需要不同的东西。感谢回复。 - papafe

4
sudo apt-get install youtube-dl ffmpeg libavcodec-extra-53 libav-tools

youtube-dl -x --audio-format mp3 --audio-quality 4 http://youtu.be/oRJ0FaOIIbM 

嗯,这难道不是自我解释的吗?:) - head_thrash
youtube-dl很酷。轻松下载整个播放列表。它在github上。 - Tony

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接