I'm facing an issue when trying to use FFmpeg in my .NET Framework 4.8 application (64-bit) with FFmpeg.AutoGen 7.0. When I try to call any FFmpeg method, such as ffmpeg.av_version_info() in the constructor, I encounter the next "Not supported method" error:
System.NotSupportedException HResult=0x80131515 Mensaje = El método especificado no es compatible. Origen = FFmpeg.AutoGen.Bindings.DynamicallyLoaded Seguimiento de la pila: at FFmpeg.AutoGen.Bindings.DynamicallyLoaded.DynamicallyLoadedBindings.<>c.b__6_1165() at FFmpeg.AutoGen.Bindings.DynamicallyLoaded.DynamicallyLoadedBindings.<>c.b__6_454() at FFmpeg.AutoGen.Abstractions.ffmpeg.av_version_info()
My binaries path contains:
- FFmpeg/bin:
- avcodec-61.dll
- avdevice-61.dll
- avfilter-10.dll
- avformat-61.dll
- avutil-59.dll
- postproc-58.dll
- swresample-5.dll
- swscale-8.dll
- FFmpeg/include
- libavcodec
- libavdevice
- libavfilter
- libavformat
- libavutil
- libpostproc
- libswrseample
- libswscale
I'm using the FFmpeg binaries obtained from GitHub (https://github.com/Ruslan-B/FFmpeg.AutoGen) and I'm specifically working with FFmpeg version 7.0. This is the code snippet:
public sealed unsafe partial class VideoPlayer : Form
{
private bool _isPlaying = false;
private Thread playbackThread;
private int _videoStreamIndex;
private AVFormatContext* _formatContext;
private AVCodecContext* _codecContext;
private SwsContext* _swsContext;
public VideoPlayer()
{
InitializeComponent();
FFMpegBinariesHelper.RegisterFFMpegBinaries(); // FFmpeg registration
DynamicallyLoadedBindings.Initialize();
Console.WriteLine($"FFmpeg version info: {ffmpeg.av_version_info()}"); // Error occurs here
}
}
