x86 32 bit support for Accord.video.FFMPEG

0

Accord version 3.8.2

I am using Accord, Accord.video, Accord.video.FFMPEG Dll's for capturing the screen, my code is compiled to ANYCPU, everything works fine in 64 bit machine, but I am facing issue when it comes to 32 bit machine below is exception which I am getting.

Exception occurred while loading the assemblies 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),    at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at ProHance.ProbeTray.Program.MPvcUlyJUg(Object  , ResolveEventArgs  )
ffmpeg
aforge
accord.net
asked on Stack Overflow Feb 26, 2021 by Ravi Kanth

1 Answer

0
  1. Add Library Project to solution.

  2. Add nuget package Accord.Video.ffmpeg (or x64) to Library project (do not change platform target , if your environment is x64 use x64 version otherwise use x86)

  3. Change copy local of these references to false Accord ,Accord.Video , Accord.Video.ffmpeg

  4. Copy all the files in packages\Accord.Video.FFMPEG.3.8.0\build + Accord ,Accord.Video , Accord.Video.ffmpeg to your output folder like bin\ffmpeg

  5. put these line in Application_Start.

var path = Thread.GetDomain().BaseDirectory + "bin\ffmpeg\";
Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") + ";"+ path);
AppDomain.CurrentDomain.AppendPrivatePath(path);
answered on Stack Overflow Mar 1, 2021 by Ravi Kanth

User contributions licensed under CC BY-SA 3.0