c# - ffmpeg 使用 c# avformat_open 运行失败

标签 c# audio merge ffmpeg

我想在 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/

相关文章:

c# - 主线程的 SynchronizationContext.Current 如何在 Windows 窗体应用程序中变为 null?

c - 如何使用核心音频正确录制 16 位 LittleEndian 签名整数 PCM 格式的音频

ios4 - MIME类型音频/mpeg不流式传输?

mercurial - Mercurial 如何处理拆分的文件?

c# - 如何安全地混契约(Contract)步和异步代码?

c# - 无法在 .Net 2.0 Web 服务中传递枚举

c# - 如何实例化uwp Windows.Media.Playback.MediaPlayer?

audio - 如何编写脚本来使用应用程序

MySQL 将不同表中的列合并到同一行中

git - 在一个 rebase 后 merge 来自相似分支的选定文件