C# 如何将ffmpeg.exe文件添加到项目中,但添加两个文件,一个用于32位,另一个用于64位?

C# 如何将ffmpeg.exe文件添加到项目中,但添加两个文件,一个用于32位,另一个用于64位?,c#,winforms,C#,Winforms,我在我的项目中添加了一个ffmpeg.exe,但它是64位版本。我对我的项目中的文件属性执行了以下操作:内容和副本始终 但是当我哥哥试图运行需要ffmpeg.exe的项目时,程序崩溃了,因为他得到了WindowsXP32位 以下是我在代码中使用ffmpeg.exe的方式: public void Start(string pathFileName, int BitmapRate) { string outPath = pathFileName;

我在我的项目中添加了一个ffmpeg.exe,但它是64位版本。我对我的项目中的文件属性执行了以下操作:内容和副本始终

但是当我哥哥试图运行需要ffmpeg.exe的项目时,程序崩溃了,因为他得到了WindowsXP32位

以下是我在代码中使用ffmpeg.exe的方式:

public void Start(string pathFileName, int BitmapRate)
        {
            string outPath = pathFileName;
            p = new NamedPipeServerStream(pipename, PipeDirection.Out, 1, PipeTransmissionMode.Byte);
            b = new byte[1920 * 1080 * 3]; // some buffer for the r g and b of pixels of an image of size 720p

            ProcessStartInfo psi = new ProcessStartInfo();
            psi.WindowStyle = ProcessWindowStyle.Hidden;
            psi.UseShellExecute = false;
            psi.CreateNoWindow = true;
            psi.FileName = ffmpegFileName;
            psi.WorkingDirectory = workingDirectory;
            psi.Arguments = @"-f rawvideo -pix_fmt bgr0 -video_size 1920x1080 -i \\.\pipe\mytestpipe -map 0 -c:v libx264 -r " + BitmapRate + " " + outPath;
            //psi.RedirectStandardOutput = true;
            process = Process.Start(psi);
            process.EnableRaisingEvents = false;
            p.WaitForConnection();
        }
问题是:如何将另一个ffmpeg.exe添加到我的项目中,但这次的问题是我的项目已经有了ffmpeg.exe


其次,我如何检测或检查用户是否有32位so来运行/使用32位ffmpeg.exe,以及用户是否有windows 64位use 64位?

要包含两次ffmpeg,只需创建子目录-X86\ffmpeg.exe和x64\ffmpeg.exe和 打电话给合适的人


要查看您的操作系统是否支持64位,请使用System.Environment.is64位OperatingSystem

如何以编程方式检测您是否在64位Windows上运行


为什么不在这两个端口上都使用32位?性能是FFmpeg的一个重要因素吗?