gpt4 book ai didi

c# - 在 ASP.NET 项目中运行 FFMPEG 时不断收到 WIN32Exception

转载 作者:行者123 更新时间:2023-12-04 23:29:14 25 4
gpt4 key购买 nike

我有一个 ASP.NET 项目,我想使用 FFMPEG 来帮助为我的视频创建缩略图。我已经将 FFMPEG 加载到项目中,每当我运行我的代码时,我都会遇到同样的错误:

“ffmpeg.MainModule”引发了“System.ComponentModel.Win32Exception”类型的异常
{“32 位进程无法访问 64 位进程的模块。”}

我正在使用 VS 2013,并且我已将目标平台设置为 x86,并且 100% 确定我使用的是 32 位版本的 ffmpeg。我正在使用来自该站点的静态库 (http://ffmpeg.zeranoe.com/builds/) 我还尝试将目标平台更改为所有 CPU 或 x64,并尝试使用 32 位和 64 位版本的 FFMPEG。总是同样的错误。我在本地环境中测试时正在运行 IIS Express。

这是我的代码。将不胜感激任何帮助!

String vSource = "http://example.com/myvideo.mp4";
String path1 = HttpContext.Current.Request.PhysicalApplicationPath;

Process ffmpeg = new Process();
ProcessStartInfo startinfo = new ProcessStartInfo(HostingEnvironment.MapPath("~/App_Data/exe/ffmpeg.exe"), "-i " + vSource + "-ss 00:00:05.000 -f image2 -vframes 1 " + path1 +"thumbnail1.jpg");

startinfo.RedirectStandardError = true;
startinfo.RedirectStandardOutput = true;
startinfo.RedirectStandardInput = true;
startinfo.UseShellExecute = false;
startinfo.CreateNoWindow = true;
ffmpeg.StartInfo = startinfo;

ffmpeg.Start();

最佳答案

槊,

我的客人是 IIS Express 以 64 位模式运行,无论您的项目中的配置如何。我会尝试在 IIS(不是 express)上运行它并将您正在使用的应用程序池设置为 32 位。该设置称为:启用 32 位应用程序(默认值:false)。您可以在应用程序池的高级设置下找到它。

祝你好运!

关于c# - 在 ASP.NET 项目中运行 FFMPEG 时不断收到 WIN32Exception,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26522751/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com