0

I am using FFMPeg to code a cross platform app for Windows and Mac in Blazor Hybrid (Dotnet Maui).

One of the things I want to do is get information about a video file. To do that I am using ffmpeg and redirecting the stream in the code to capture the returned data in the code.

here's what it looks like

string ffmpegPath = Globals.GetFfmpegPath();
ffmpegProcess.StartInfo.FileName = ffmpegPath;
ffmpegProcess.StartInfo.Arguments = $"-i \"{videoPath}\"";
ffmpegProcess.StartInfo.RedirectStandardError = true;
ffmpegProcess.StartInfo.UseShellExecute = false;
ffmpegProcess.StartInfo.CreateNoWindow = true;
ffmpegProcess.StartInfo.WorkingDirectory = videoPath;

But when I run this code, I am getting a permission denied error.

Any ideas what do I need to do to get this working.

The use case is simple. I want to run ffmpeg and get informatino about a file.

Thanks

2
  • What exception did it throw? Commented Aug 26, 2024 at 1:06
  • 1
    FYI Instead of ffmpegProcess.StartInfo.Arguments = $"-i \"{videoPath}\""; use ffmpegProcess.StartInfo.ArgumentList.Add( "-i" ); ffmpegProcess.StartInfo.ArgumentList.Add( videoPath ); as it will take care of correct quoting Commented Aug 26, 2024 at 3:13

0

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.