c# - 如何在除ffmpeg之外的C# windows窗体中合并音频和视频

标签 c# winforms audio video ffmpeg

我尝试使用 ffmpeg 合并音频和视频,下面是我的代码,
问题是长视频需要太多时间,有没有其他方法可以合并音频和视频文件

        string Path_FFMPEG = Application.StartupPath + "\\ffmpeg.exe";
        string Wavefile = applicationPath + @"\Vizipp_Video_" + currentDateTime + ".wav"; ;
        string videoFile = applicationPath + @"\Vizipp_Video_" + currentDateTime + ".avi";
        string strResult = applicationPath + @"\Vizipp_Video_" + currentDateTime + ".mpg";

        System.Diagnostics.Process proc = new System.Diagnostics.Process();


            proc.StartInfo.Arguments = string.Format("-i {0} -i {1} {2}", Wavefile, videoFile, strResult);
            proc.StartInfo.UseShellExecute = false;
            proc.StartInfo.CreateNoWindow = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.RedirectStandardError = true;
            proc.StartInfo.FileName = Path_FFMPEG;
            proc.Start();
            //string StdOutVideo = proc.StandardOutput.ReadToEnd();
            //string StdErrVideo = proc.StandardError.ReadToEnd();
            MessageBox.Show("Please wait while we are processing on your video recording...", "Vizipp", MessageBoxButtons.OK, MessageBoxIcon.Information);

最佳答案

将 -codec 副本添加到您的 FFmpeg 命令中。这假设最终容器支持编解码器。您可能至少需要对音频进行编码(-vcodec copy -acodec aac)

关于c# - 如何在除ffmpeg之外的C# windows窗体中合并音频和视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48542265/

相关文章:

c# - 无法将 List<Foo> 传递给需要 List<IFoo> 的方法,其中 Foo : IFoo

c# - 什么是 C++ 中拼接的 C# 替代方案

c# - 我有一个 RichTextBox,里面装满了文本文件中的文本,我现在想将文本中包含单词 "Error"的所有地方都涂成红色,该怎么做?

python - 如何将 music21 中的输出保存为 MIDI 文件?

ios - 使用Deezer SDK for iPhone播放歌曲

c# - 使用 ReSharper 将扩展方法转换为实例方法?

c# - 如何调用 Windows API

c# - 用于显示图像的 Windows 窗体文本框

c# - 是否可以创建可以在 Windows 中以编程方式登录用户的服务或应用程序

javascript从按钮点击停止音频