从FLV中提取音频数据并注入到MP3中

3
我需要使用C#从FLV文件中提取音频数据,并将其注入到MP3文件中。因此,我正在寻找相应的库或者如何使用原始数据/文件结构进行操作。
1个回答

3

看一下FLVExtract,一个用于提取oss flv音频流的工具。

编辑: 有用的文件在Library文件夹下。要在你的项目中使用它们,请尝试以下操作:

using (FLVFile flvFile = new FLVFile(fileName))
{
    // first param is whether or not to extract audio streams (true)
    // second param is whether or not to extract video streams (false)
    // third param is whether or not to extract timecodes (false)
    // fourth param is the delegate that gets called in case of an overwrite prompt (leave null in case you want to overwrite automatically)
    flvFile.ExtractStreams(true, false, false, null);
}

我几天前发现了这个,我查看了源代码,但是它非常令人困惑(我对C#有些陌生)。我只想将FLV转换为MP3,FLVExtract比这更复杂。 - Lienau
FLV 可以包含除 MP3 以外的其他音频流。因此,您可以选择提取音频流或转码它。如果您想提取它,FLVExtractor 是您最好的选择。 - Yannick Motton
如果有帮助的话,我已经添加了一些示例代码。这个库相当简单。将库文件包含到您的项目中,并在要从中调用它的源文件中添加 using JDP; - Yannick Motton
是的,那就是我最终所做的。第一次看它时,我的意图只是取得获取音频所需的代码,但这并不简单。但感谢你的帮助,我只需要另外一种看待它的方式。 - Lienau

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