0

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:

  1. 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
  1. 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
    }
}
2
  • Packages should be added from NuGet, not as downloads from GitHub. It's quite possible the wrong binaries were loaded. Does the problem appear if you create a completely separate new project and add the package reference? Commented Jan 16 at 14:26
  • @PanagiotisKanavos, I agree, the packets should be added from Nuget as I did. The problem is that some codecs and DLLs are not available for being downloaded from Nuget. Instead of that, you must get them from GitHub project. Commented Jan 16 at 15:42

1 Answer 1

0

It was such a project destination platform error. My x64 bit platform was missconfigured, so I just changed it to x64 bits as follows: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.