問題描述
我正在嘗試創建一個 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?
感謝您的建議
推薦答案
為此編寫應用程序可能有點矯枉過正.現有的工具已經做得很好,而且它們的簡單性很難被打敗:
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 視頻中提取音頻?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!