-
Notifications
You must be signed in to change notification settings - Fork 2k
Accord.Video.FFMPEG in IIS? -Could not load file or assembly #428
Comments
Hello, It seems your project is configured to compile as x86. By default IIS runs code in x64 mode and you have to configure your IIS to run x86 code. This can be done by going to the corresponding application pool and entering Advanced Settings. Here you will find an "Enable 32-Bit Appplications" options. The other option is the get your code to compile as x64. |
Hey, Thanks for the quick reply - I might have left the configuration to x86 in the zip I've posted, but like I said, I've tried getting it to work in both debug and release, and also both x86 and x64, which did not help. The winform project I just left it on Any CPU, (which would probably default to x64) which worked instantly. |
I think this is happening because the msbuild targets that is supposed to copy FFMPEG dlls to the output folder of the application does not work with web applications. In order to use Accord.Video.FFMPEG, it is necessary to copy the native FFMPEG .dlls (that normally should be present inside the directory /packages/Accord.Video.FFMPEG/build if you installed using NuGet) to the same folder where Accord.Video.FFMPEG.dll resides. I am not completely sure how this is set up in web projects. But without this, indeed one would get the "Could not load file or assembly" errors as seen above. Also, note that since 2 releases ago Accord.NET now has 64-bit versions of the FFMPEG dlls, but you might have to install them explicitly by choosing the Accord.Video.FFMPEG*.x64* package in the NuGet browser. Regards, |
I'm seeing a similar issue to what @RonSijm is seeing. I have an x86 project and IIS is configured to have 32-bit applications enabled. It looks like the ffmpeg .dlls @cesarsouza mentioned are being copied over. I've also noticed that if I change the target framework of the project to 3.5 I no longer get the error. I saw in a few similar issues that installing the x86 2015 C++ redistributables solves the 3.5 dependency. I'm using Visual Studio 2017, and the 2017 redistributable I have is v14.11.25325, so the 2015 installer fails because it thinks a higher version of 14.* is already installed. I tried uninstalling the 2017 and installing the 2015, which causes me to get the following error instead:
|
Hi @AlexaHLE, It should be possible to have both VS2015, VS2017, as well as both 2015 and 2017 C++ redistributables installed together at the same time. Note that the redistributables can be downloaded and installed separately from Visual Studio from https://www.microsoft.com/en-us/download/details.aspx?id=48145 and https://go.microsoft.com/fwlink/?LinkId=746572. Have you installed all of them? Also, have you tried to create a 64-bit application and using Accord.Video.FFMPEG.x64 instead? Regards, |
Does anybody find a working solution? |
Hi @devbratghosh, Could you please try with the latest pre-release package (3.8.2-alpha) currently available in NuGet? This version should depend only on the VS2015 runtime, so at least it should make it easier to eliminate what should be the problem. Then, please make sure your application is running in 64-bits mode (check Environment.Is64BitProcess and Environment.Is64BitOperatingSystem), and if so, download and install only Accord.Video.FFMPEG.x64 from NuGet (do not install Accord.Video.FFMPEG). If you are still having the problem, please check the value for Directory.GetCurrentDirectory() and make sure the FFmpeg's dlls are contained in this folder. I suspect they aren't there, and that's the reason for the error. Instead, try to adjust the PATH variable to include the directory where those .dlls are (normally in your Bin folder). For example, you may try to set it inside your process using something like...
... maybe as soon as your process starts, or maybe just before attempting to use type from Accord.Video.FFmpeg. Please let me know if it helps, |
I had the same issue with Accord.Video.FFMPEG.DLL
I removed "Accord.Video.FFMPEG" and install "Accord.Video.FFMPEG.x64 3.8.2-alpha" then I got this error:
finally by setting "User the 64 bit version of IIS Express...." issue solved and dlls load correctly, without need to setting PATH variable. Thanks @cesarsouza for clear comments. |
As @cesarsouza said. I directly copy all dlls from /packages/Accord.Video.FFMPEG to the /bin folder. It worked correctly. |
Hello, Could not load file or assembly 'Accord.Video.FFMPEG.DLL' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) This is huge burdening, couldn't find out Accod.video.ffmpeg.dll for 32 bit. Thanks in advance |
[image: image.png]
manage nuget package-> search for Accord.Video.FFMPEG
you have both 32 and 64
…On Fri, Apr 5, 2019 at 5:13 AM toriqsagor ***@***.***> wrote:
Hello,
*I'm trying to integrate in a 32 bit windows, but showing below problem.
I've got only X64 bit dll. Is there any x86 bit dll for accord video file
writer.*
*Could not load file or assembly 'Accord.Video.FFMPEG.DLL' or one of its
dependencies. is not a valid Win32 application. (Exception from HRESULT:
0x800700C1)*
*This is huge burdening, couldn't find out Accod.video.ffmpeg.dll for 32
bit.*
Anyone can help me.
Thanks in advance
By
Toriqsagor
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#428 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD1tTMrNLlBHKhVfV9F4l8x3HqKM3Yo0ks5vdxOigaJpZM4MBb8r>
.
--
Thanks and Regards
Prakash Paul
|
Thanks a lot PrakashPaul. |
I have copied all the files to "bin" directory as mentioned by @PrakashPaul , set the project to x64 and deployed on trial MS Azure web app. But I'm still getting this error. Please help? |
Microsoft visual c++ redistributable 2010,2012,2013,2015 x64,x86 |
I'm trying to get Accord.Video.FFMPEG to work in IIS, but I keep getting the error:
Could not load file or assembly 'Accord.Video.FFMPEG' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I've tried a bunch of different things, like copying the Accord.Video.FFMPEG files and other codec files to system32, and SysWOW64 - tried compiling both x86 and x64, debug and release, adding config to my web.config, but nothing seems to work.
I've created 2 sample projects. One I made as a winform, which just contains the following:
Which worked instantly after adding the Accord.Video.FFMPEG nuget.
I then made a new ASP.Net Web Application, chose the Web API template, configured it to run under normal IIS (instead of IIS express) added the Accord.Video.FFMPEG nuget and tried to run the application.
This is the full log:
I've added the two sample projects as attachments: videoTest.zip
Can someone please tell me how to solve this? And how to get this library running in IIS? Or if someone could post a sample project that does working under IIS, that'd be great.
Thanks!
I'm using Visual Studio 2015 community edition update 3, and my computer is running Windows 10, x64.
The actual application that I want this to work in will run on Windows Server 2012 R2, AMD64
The text was updated successfully, but these errors were encountered: