如何以编程方式提取YouTube视频音频? [英] How do I programmatically extract the audio from a YouTube video?

查看:505
本文介绍了如何以编程方式提取YouTube视频音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个C#应用程序,它可以让我从YouTube视频中提取只是音频。我遇到那些已经在做了网站,但我不知道他们是如何工作的。什么会以编程方式做到这一点的最好方法是什么?

I'm trying to create a C# application which allows me to extract just the audio from YouTube videos. I've come across sites that already do that, but I'm not sure how they actually work. What would be the best way to do this programmatically?

感谢您的任何建议。

推荐答案

编写一个应用程序,这可能是矫枉过正。现有的工具已经做了pretty好工作,这是很难被击败的简单:

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

完成!

如果您的应用程序需要做一些特别的与事后的音频,它是有意义的写这部分的应用程序。但对于刚刚起步的音频输出,炮击了以的ffmpeg 将轻松很多。

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.

这篇关于如何以编程方式提取YouTube视频音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆