Ffmpeg 电子封装器的电子封装错误

Ffmpeg 电子封装器的电子封装错误,ffmpeg,electron,pack,Ffmpeg,Electron,Pack,我用ffmepg和ffprob开发了electron应用程序。 我在main.js中使用ffmpeg和ffprob以及execFile和spawn函数 const spawnProc = require('child_process').spawn const execProc = require('child_process').execFile const mpegPath = "ffmpeg.exe"; const probePath = "ffprobe.e

我用ffmepg和ffprob开发了electron应用程序。 我在main.js中使用ffmpeg和ffprob以及execFile和spawn函数

const spawnProc = require('child_process').spawn
const execProc = require('child_process').execFile
const mpegPath = "ffmpeg.exe";
const probePath = "ffprobe.exe"
开发时没有问题,但使用电子包装机包装后发生意外错误

让我知道如何解决这个问题


不确定这是否能回答您的问题,但我发现确保跨平台兼容ffmpeg依赖项的最简单方法是:

  • 使用包并使其成为构建脚本的一部分。例如,我使用的网页包将我的电子应用程序的前端编译到
    dist/
    文件夹中,因此我让它将二进制文件下载到
    dist/bin
  • 用于使用绑定到应用中的ffmpeg依赖项的正确路径。如果在Windows等系统上,您可以使用
    .exe
    扩展名来执行此操作