unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.17k stars 240 forks source link

Another MediaElement.Open FileNotFound Exception #505

Closed cdgodfrey closed 4 years ago

cdgodfrey commented 4 years ago

This is similar to #486 but not quite the same. I too am trying to get a simple test player to work. I can compile and run the sample application with no problem, but can't open an MP3 file in my test program.
My MainWindow Grid contains:

The player control appears in the design view as expected. The code-behind looks like: public MainWindow() { InitializeComponent();

        Unosquare.FFME.Library.FFmpegDirectory = @"C:\Programming\FFME Binaries";
        OpenAsync();
    }

    private async Task<bool> OpenAsync()
    {
        System.Uri theUri = new Uri(@"C:\Test.mp3");
        var openResult = await player.Open(theUri);
        return openResult;
    }

player.Open returns false, and the file doesn't play. (It does play in your sample app.) When the program runs, I get 3 instances of '"System.IO.FileNotFoundException' in ffme.win.dll" in the Output window.

Is it unable to find the input file, or is it looking for something else (a DLL?) I haven't included in the test program?

I'm obviously missing something basic, but I'm not able to figure out what it is. Can you point me in the right direction? Thanks.

cdgodfrey commented 4 years ago

Ach... Never mind.

cdgodfrey commented 4 years ago

The issue likewise turned out to be due to not having the correct (x86/x64) version of ffme.win in the right folder. That results in MediaPlayer.Open(filename) returning false, but no other (apparent) symptoms. Except, of course, that it doesn't work.