Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The specified executable is not a valid application for this OS platform. #458

Open
wsamplaw opened this issue Jun 21, 2023 · 0 comments
Open

Comments

@wsamplaw
Copy link

I am getting a System.ComponentModel.Win32Exception (0x80004005): The specified executable is not a valid application for this OS platform exception doing a FFmpeg.Conversions.FromSnippet.Split only when the FFmpeg.SetExecutablesPath is set to a different path then where I extracted the FFmpeg files from the .zip file.
I added ffmpeg.exe and ffprobe.exe to my project folder, added the files to my project and have them set to Copy always. I am trying to use them from the assembly location (the files are in the assembly location).

This is the entire exception:
System.ComponentModel.Win32Exception (0x80004005): The specified executable is not a valid application for this OS platform.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Xabe.FFmpeg.FFmpeg.RunProcess(String args, String processPath, Nullable1 priority, Boolean standardInput, Boolean standardOutput, Boolean standardError) at Xabe.FFmpeg.FFmpegWrapper.<>c__DisplayClass14_0.<RunProcess>b__0() at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xabe.FFmpeg.Conversion.d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

This is how I am setting the executable path when the exception happens:
FFmpeg.SetExecutablesPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

I added a line in my log to get FFmpeg's executable path _logger.DebugFormat("FFmpeg exe path {0}", FFmpeg.ExecutablesPath);
And that displays what appears to be a valid path
FFmpeg exe path C:\Development<solution name>\bin\x86\Debug

Should I be using more FFmpeg files in my project?

My project is a WinForms app using .NET Framework 4.8 and Xabe.FFmpeg 5.2.6.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant