简体   繁体   English

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

[英]How can i add ffmpeg.exe file to my project but two files one for 32bit and one for 64bit?

I added one ffmpeg.exe to my project but it's 64bit version . 我在项目中添加了一个ffmpeg.exe,但它是64位版本。 I did on the file properties in my project : Content and Copy always . 我对项目中的文件属性进行了操作:始终为内容和复制。

But when my brother tried to run the project which need the ffmpeg.exe the program crashed since he got windows xp 32bit. 但是,当我的兄弟尝试运行需要ffmpeg.exe的项目时,该程序崩溃了,因为他安装了Windows XP 32位。

This is how i'm using the ffmpeg.exe in my code : 这就是我在代码中使用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();
        }

The questions are : How can i add another ffmpeg.exe to my project but 32bit this time the problem is that my project have already ffmpeg.exe 问题是:如何将另一个ffmpeg.exe添加到我的项目中,但是这次是32位,问题是我的项目已经有ffmpeg.exe。

Second how can i detect or check if the user have 32bit so to run/use the ffmpeg.exe 32bit and if the user have windows 64bit use 64bit ? 其次,我如何才能检测或检查用户是否具有32bit,以便运行/使用ffmpeg.exe 32bit,以及用户是否具有Windows 64bit,请使用64bit?

To include ffmpeg twice, just make subdirectories - X86\\ffmpeg.exe and x64\\ffmpeg.exe and call the appropriate one. 要两次包含ffmpeg,只需创建子目录-X86 \\ ffmpeg.exe和x64 \\ ffmpeg.exe,然后调用相应的子目录即可。

To see if your OS is 64-bit capable, use System.Environment.Is64BitOperatingSystem 若要查看您的操作系统是否支持64位,请使用System.Environment.Is64BitOperatingSystem

How to detect programmatically whether you are running on 64-bit Windows 如何以编程方式检测您是否在64位Windows上运行

http://blogs.msdn.com/b/oldnewthing/archive/2005/02/01/364563.aspx http://blogs.msdn.com/b/oldnewthing/archive/2005/02/01/364563.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查我在 C# 中运行的是 32 位还是 64 位 java - How can I check if I am running 32bit or 64bit java in C# 检查我的程序是否在64位机器上以32位模式运行,如果以64位运行 - 如何强制它为32位 - Check if my program is running in 32 bit mode on a 64bit machine, if running in 64bit - how do I force it to be 32bit 当exe在64位计算机上为x86(32bit)时,dll是否将以32位或64位加载? - Will dll be loaded as 32bit or 64bit when exe is x86(32bit) on a 64bit machine? 项目引用包含32位或64位 - Project references contain 32bit or 64bit msbuild在一台计算机上编译为32位,在另一台计算机上编译为64位 - msbuild compiles 32bit on one machine and 64bit on another 我可以从64位应用程序运行C#程序集(dll)为32位吗? - Can I run a C# assembly (dll) as 32bit from a 64bit application? 使用C#,如何获取我的机器是64位还是32位? - Using C#, how to get whether my machine is 64bit or 32bit? 为什么我不能在64位机器上正确读取HKCU中的32位注册表值? - Why can't I properly read 32bit registry values in HKCU on 64bit machine? 如何从32位.NET App在64位Windows Server 2008上启动ServerManager.msc? - How can I start ServerManager.msc on a 64bit Windows Server 2008 from a 32bit .NET App? 用C#构建两个.exe文件,一个32位,另一个64位 - Building two .exe files in C# One 32 bit and the other 64 bit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM