我需要转换来自 AWS 云的文件,它使用 TntDrive 像本地驱动器一样安装。
我尝试使用 FFMpegConverter.ConvertMedia
方法,但运行缓慢。在另一个问题中,有人接下来向我解释:
“看起来您需要使用 FFMpegConverter.ConvertLiveMedia
方法而不是 FFMpegConverter.ConvertMedia 方法来实现这一点。总的来说,您仍然会发现您可能会受到 I/O 限制而不是 CPU 限制。”
但是下一个代码对我不起作用:
static void Main(string[] args)
{
string input_path =
@"D:\WAV\ALBUM1\UNDER_ALBUM1\APOV01_10 POV 8_MAIN.WAV";
string dest_path = @"D:\result.mp3";
using (FileStream inputStream = new FileStream(input_path, FileMode.Open))
{
var converter = new FFMpegConverter();
var result = converter.ConvertLiveMedia(
inputStream, "WAV",
dest_path, "MP3",
new ConvertSettings
{
AudioSampleRate = 44100,
CustomOutputArgs = " -b:a 192k "
}
);
Console.ReadLine();
}
}
我的代码有什么问题?
最佳答案
var ffMpeg = new FFMpegConverter();
ffMpeg.ConvertMedia(input_path, null, dest_path, "mp3", new ConvertSettings() {
CustomOutputArgs = " -b:a 192k -ar 44100 -y -f mp3 -movflags faststart"
});
关于c# - FFMpeg转换器。 ConvertLiveMedia 方法不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35177220/