1

I built a WPF app that uses System.Diagnostics.Process to run ffmpeg.exe. In there I added an "External" folder to hold the ffmpeg files.

enter image description here

Then just did something like

new ProcessStartInfo()
{
    FileName = @"External\ffmpeg\bin\x64\ffmpeg.exe",
    ...
}

Which worked just fine.

Now I want to port this project to .Net Maui to leverage its cross-platformness so my app can be run on PC or Mac.

My question is where do I add the ffmpeg files in the Maui project? Do I Just put them in "Resources/Raw" and do some kind of check in my code to see which version use; do I make a "Resources" folder in "Platforms/Windows" and "Platforms/MacCatalyst" and add the appropriate files there?

Side Note: I know almost nothing about Mac.

master_ruko
  • 435
  • 2
  • 13
  • Since you want to target both Windows and Mac, it would be a better approach to use ffmpeg as a library instead of bundling an unsigned executable: https://stackoverflow.com/questions/2401764/can-ffmpeg-be-used-as-a-library-instead-of-a-standalone-program – r2d2rigo Apr 27 '22 at 16:45
  • @r2d2rigo I considered that when I first started playing with ffmpeg when I started my WPF project, but was unable to work out how to use the ffmpeg libraries (libavcodec and libavformat, from what I gather) in a c# project. That is why I settled on running ffmpeg.exe and ffprobe.exe through a process. – master_ruko May 01 '22 at 20:50

0 Answers0