我想在 c# 上用 ffmpeg 扩展音乐
我的 C# 代码,
proc2.StartInfo.FileName = "H:\\bin\\ffmpeg.exe";
proc2.StartInfo.Arguments = "-lavfi amovie=input.mp3:loop=9 C:\\Users\\serhat-pc\\Desktop\\newinput.mp3";
proc2.StartInfo.RedirectStandardError = true;
proc2.StartInfo.UseShellExecute = false;
if (!proc2.Start())
{
Console.WriteLine("Error starting");
return;
}
StreamReader reader = proc2.StandardError;
string line;
while ((line = reader.ReadLine()) != null)
{
Console.WriteLine(line);
}
proc2.Close();
但我收到了这个问题:
ffmpeg problem
请 friend 帮帮我,谢谢。
最佳答案
您可以通过连接相同的文件来实现这一点。
创建一个包含内容的文本文件 (concat.txt):
file '/path/to/input.mp3'
file '/path/to/input.mp3'
file '/path/to/input.mp3'
file '/path/to/input.mp3'
file '/path/to/input.mp3'
file '/path/to/input.mp3'
file '/path/to/input.mp3'
file '/path/to/input.mp3'
file '/path/to/input.mp3'
然后使用以下命令:
ffmpeg -f concat -i concat.txt -c copy output.mp3
关于c# - ffmpeg 使用 c# avformat_open 运行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45462313/