Combine audio and video files with FFMPEG in C#

前端 未结 1 1530
臣服心动
臣服心动 2021-01-22 01:56

I\'m currently trying to combine two files, one audio and one video, in my C# program using FFMPEG with the following code:

ProcessStartInfo startInfo = new Proc         


        
相关标签:
1条回答
  • 2021-01-22 02:58

    I ended up solving it by doing the following:

     string args = "/c ffmpeg -i \"video.mp4\" -i \"mic.wav\" -shortest outPutFile.mp4";
                ProcessStartInfo startInfo = new ProcessStartInfo();
                startInfo.CreateNoWindow = false;
                startInfo.FileName = "cmd.exe";
                startInfo.WorkingDirectory = @"" + outputPath;
                startInfo.Arguments = args;
                using (Process exeProcess = Process.Start(startInfo))
                {
                    exeProcess.WaitForExit();
                }
    
    0 讨论(0)
提交回复
热议问题