NReco Error: "The specified executable is not a valid application for this OS platform"

NReco Error: "The specified executable is not a valid application for this OS platform"

我正在使用 NReco 转换视频。我像下面这样声明转换器,并向 ConvertProgress 添加一个处理程序。

Dim vid_Convert As New FFMpegConverter
AddHandler vid_Convert.ConvertProgress, Sub(sender, e) vidConvertProgress(folder,fname,fext,fverdest,fint,fcount,fhost,e)
vid_Convert.ConvertMedia(file_temp, Nothing, file_dest, "mp4", cSettings)

媒体转换正常。问题出在我声明一个新转换器并让它执行 GetVideoThumbnail 的处理程序中(当先前的转换完成时),如下所示:

Dim vid_Extract As New FFMpegConverter
vid_Extract.GetVideoThumbnail(inputFile, outputFile, extractposition)

这会产生错误 "The specified executable is not a valid application for this OS platform"。但是,我已经在程序的其他地方单独执行了 GetVideoThumbnail 方法,没有任何问题。出于某种原因,如果它在处理程序中执行,它将不起作用。有解决办法吗?

我假设您使用 NReco.VideoConverter 嵌入 ffmpeg.exe 的 nuget 包,并在首次使用时提取它。您很可能同时调用 "ConvertMedia" 和 "GetVideoThumbnail",这可能会导致 ffmpeg.exe.

的提取不正确

此问题的解决方法可能是在应用程序启动时调用 new FFMpegConverter().ExtractFFmpeg();(在 Program.cs 中)以保证在 "ConvertMedia" 和 "GetVideoThumbnail" 调用时 ffmpeg 已被提取。