c# - 用于合并音频和视频的 FFmpeg 命令不起作用 - C#

标签 c# audio ffmpeg mp4 wav

我试图结合一个 video.mp4带有 mic.wav 的文件如下所示。但是没有生成组合视频。
命令提示符说 -

'ffmpeg' is not recognized as an internal or external command, operable program or batch file.



我需要安装 Accord.Video.FFMPEG 以外的 ffmpeg 吗?如果那么它对于应用程序执行的每个系统都是独立的吗?
请帮忙改正。
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Accord.Video.FFMPEG;
using System;
public void merge()
{
    try
    {
        // string args = "/c ffmpeg -i video.mp4 -i mic.wav -c copy -map 0:v:0 -map 1:a:0 output.mp4";
        // string args = "/c ffmpeg - i mic.wav - i example - video.mp4 - c:v copy -vcodec copy final.mp4";
        string args = $"/c ffmpeg -i video.mp4 -i mic.wav -shortest out.mp4";
        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.CreateNoWindow = false;
        startInfo.FileName = "cmd.exe";
        startInfo.WorkingDirectory = "E:\\Newfolder";
        startInfo.Arguments = args;
        using (Process exeProcess = Process.Start(startInfo))
        {
            exeProcess.WaitForExit();
        }
    }
    catch(Exception ex)
    {
        string exx = ex.ToString();
    }
}

最佳答案

试试 FFmpeg -map显示的标志here .

ffmpeg -i video.mp4 -i mic.wav -map 0:v -map 1:a output.mp4

关于c# - 用于合并音频和视频的 FFmpeg 命令不起作用 - C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56525522/

相关文章:

matlab - 快速傅里叶在matlab中检测钢琴频率

c# - 使用接口(interface)作为构造函数参数

c# - 如何在Tizen Xamarin上播放声音

c# - 将 TIFF 转换为 JPG 格式

c++ - 您如何在mciSendString中使用变量代替体积? C++

ffmpeg - 尝试使用 NVDEC 解码 4K 视频时出错

ffmpeg - 为什么我会收到 testsrc ffmpeg 的输入/输出错误?

php - 找到ffmpeg的绝对路径

c# - 接受 TCP 客户端异步

c# - 组合await 和ContinueWith