[英]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.