Convert images to video on the fly using Aforge.net.framework and c#

3

We need to convert images (which is coming from the camera live stream) into video stream on the fly using ffmpeg binaries and c# project.

We installed Aforge.net framework 2.2.4.1 in our system(windows 7,32 bit) and implemented the video recording coding using Aforge.video.Ffmpeg dll.It works fine as we expected.Then we tried to work the same project in a 64 bit system.

It gives me the error

"Could not load file or assembly 'AForge.Video.FFMPEG.dll' or one of its dependencies. is not a valid Win32 application.(Exception from HRESULT: 0x800700C1)".

And we went through some forums and found the solution to change the target platform to x86 to run in 32 bit.But for some other reasons we should stay in x64 as our platform target.And based on another post in the forums we downloaded the 64 bit ffmpeg libraries from this link "http://ffmpeg.zeranoe.com/builds/" and replaced the 64 bit versions of avcodec-53.dll,avdevice-53.dll, avfilter-2.dll,avformat-53.dll, avutil-53.dll, swscale-2.dll into my projects output folder.When we try to make the Aforge.video.ffmpeg.dll for 64 bit version by using the source code given by Aforge.net framework, build was not successfull.

We think that this source code is built for win32 platform and we try to get the Aforge.Video.Ffmpeg dll by only repalcing the 64 bit ffmpeg binaries alone.We are not sure whether we need to include any other dependency files apart from the ffmpeg binaries to make the dll.Is there any Aforge.net framework setup is available to produce the 64 bit version of the Aforge.Video.ffmpeg dll?

c#
aforge
asked on Stack Overflow Apr 12, 2013 by user1929519 • edited Apr 12, 2013 by Freelancer

3 Answers

0

From the documentation: you have to compile for x86.

answered on Stack Overflow Aug 25, 2016 by Mauro Sampietro
0

First you must get the 64 bits libraries of Aforeg.Video.FFMPEG. The URL for that is
https://aforgeffmpeg.codeplex.com/ (In the moment to write this CodePlex is just saying that they are shutting down).

Also you can get the FFMPEG libraries from https://ffmpeg.zeranoe.com/builds/. All this FFMPEG dlls must be copied to the directory where your .exe or binary will be executed. Set special attention that exists a x86 version of them that you must avoid.

You must compile your App to x64 (No AnyCPU).

And you must set App.config

<configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> </startup> <runtime> <NetFx40_LegacySecurityPolicy enabled="true" /> </runtime> </configuration>

This is described by https://bydaniel.wordpress.com/2017/05/01/aforge-net-ffmpeg/

answered on Stack Overflow Jun 19, 2017 by Fidel Orozco
-1

Try to change Framework, changing it from 4.0 to 3.5 helped me


User contributions licensed under CC BY-SA 3.0