microsoft / FFmpegInterop

This is a code sample to make it easier to use FFmpeg in Windows applications.
Apache License 2.0
1.29k stars 310 forks source link

Creating from Uri fails #71

Closed deify closed 8 years ago

deify commented 8 years ago

Hey,

my issue is i cant open any File or Uri. I got the example code running and it works perfectly. But as soon as i try to run it inside my app i am getting FileNotFound exceptions, eventhough i am using the exact same strings to call the function.

khouzam commented 8 years ago

Hi @deify,

This could be a few things.

  1. Did you specify the right permissions for your app in the appmanifest? For Uris, you'll want internet access.
  2. Did you properly add the FFmpeg dlls as content in your application?

Can you debug and see which statement fails in FFmpegInterop?

Thanks.

deify commented 8 years ago

Hi khouzam,

Thanks for your quick reply. The permissions were set properly, other bindings to Uris work just fine.

The second suggestion helped though. I've added the ARM dlls to my project, but i was debugging on x86, changing them to x86 worked on pc now. Ist there a way to include all dlls and make FFmpefInterop recognize the files corresponding to the current platform?

Thanks

khouzam commented 8 years ago

Yes, you can take the same approach that our samples are taking. You might need to modify the project file manually. For managed code, you can base yourself on our MediaPlayerCS project. If you open Samples\SamplesWin10\MediaPlayerCS\MediaPlayerCS.csproj you can see how this is defined. This will include the dlls based on the target architecture.

Include the following code in your project <Content Include="$(SolutionDir)ffmpeg\Build\Windows10\$(Platform)\bin\avcodec-56.dll" /> <Content Include="$(SolutionDir)ffmpeg\Build\Windows10\$(Platform)\bin\avdevice-56.dll" /> <Content Include="$(SolutionDir)ffmpeg\Build\Windows10\$(Platform)\bin\avfilter-5.dll" /> <Content Include="$(SolutionDir)ffmpeg\Build\Windows10\$(Platform)\bin\avformat-56.dll" /> <Content Include="$(SolutionDir)ffmpeg\Build\Windows10\$(Platform)\bin\avutil-54.dll" /> <Content Include="$(SolutionDir)ffmpeg\Build\Windows10\$(Platform)\bin\swresample-1.dll" /> <Content Include="$(SolutionDir)ffmpeg\Build\Windows10\$(Platform)\bin\swscale-3.dll" />

I hope this helps.

deify commented 8 years ago

Thank you alot! That helped fixig my issue!

Thanks and best regards