【问题标题】:ffmpeg run with c# avformat_open failedffmpeg 使用 c# avformat_open 运行失败
【发布时间】:2018-01-09 18:23:24
【问题描述】:

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

请朋友们帮帮我,谢谢。

【问题讨论】:

    标签: c# audio merge ffmpeg


    【解决方案1】:

    您可以通过连接相同的文件来实现此目的。

    创建一个包含内容的文本文件(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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      • 2017-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多