unosquare / ffmediaelement

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

Unable to load ffmpeg Binaries #634

Closed StrikingPopcorn closed 1 year ago

StrikingPopcorn commented 1 year ago

Issue Title (Unable to load ffmpeg Binaries)

Hello, I have the Issue that my program is not able to load the binaries, it just gives back a FileNotFoundException. I also tested the sample program and that was also not able to load the binaries either. I've tested every ffmpeg release since 4.4 up to 5.1.2 for Windows 64 Bit. I made sure that I compile for 64 Bit and checked that the DLLs exist using System.IO.File.Exists() and that told me that they exist. I've also moved my entire project from .net framework 4.8.1 to .net 6.0 to test, if that was the issue but it wasn't. And I am completely out of ideas. So I would be really thankful for help. I don't know how it could be reproduced because I have absolutely no idea, what's causing the issue in the first place.

Issue Category

Version Information

Steps to Reproduce

  1. Don't know how it could be reproduced.

Expected Results

Sample Code

XAML

            <StackPanel Grid.Row="2" Grid.Column="8" Grid.ColumnSpan="8" Background="#2f2633">
                <Slider x:Name="TimelineSlider" Margin="16.6" IsMoveToPointEnabled="True"  
                   MouseUp="TimelineSlider_MouseLeftButtonUp" MouseDown="TimelineSlider_MouseLeftButtonDown"/>
                <ffme:MediaElement x:Name="me" LoadedBehavior="Play" UnloadedBehavior="Stop" Stretch="None" 
                  MediaOpened="me_MediaOpened_1" MediaEnded="me_MediaEnded_1" Height="0" Width="0"/>
            </StackPanel>

C

MainWindow.xaml.cs----------------------------------------------------------------------------------------------------------------------------
        private async void Play_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (playstate != 1)
            {
                var filepath = new Uri(selectedfilepath);
                await me.Open(filepath);
                await me.Play();
                playstate = 1;
            }
            else
            {
                return;
            }
        }

App.xaml.cs---------------------------------------------------------------------------------------------------------------------------------------
        public App()
        {

            Unosquare.FFME.Library.FFmpegDirectory = @"c:\ffmpeg\bin" + (Environment.Is64BitProcess ? @"\x64" : string.Empty);

            Unosquare.FFME.Library.FFmpegLoadModeFlags = FFmpegLoadMode.FullFeatures;
        }
StrikingPopcorn commented 1 year ago

Found the cause, gonna close the issue now.