Open JoeGermuska opened 6 years ago
As a side note, someone I talked to suggested moving the ffmpeg
operations out of the "client" (aka "browser") code and situating it in main.js
(the Electron bootstrap file) instead. That would get us out of any Webpack-induced confusion, and might be architecturally sound for other reasons.
This webpage shows some example code about how to do that.
Because we're bundling ffmpeg binaries with our app, we also need to set the explicit path to those binaries as part of bootstrapping the app.
While we find a repository with example code, that project used
browserify
instead ofwebpack
to pull project code together. Since we're usingwebpack
, we're subject to issues about how the value of__dirname
is handled, as discussed at some length in webpack/webpack#1599 and also explained in the webpack docsIn short, even when handling the config,
__dirname
will have a different value when the code is executed in the webpacked bundle than it does in theffmpeg-static
code.We need to understand where (at which filesystem path) in the bundled Electron app the
ffmpeg
binaries are located, and then come up with a new way to get the path. We could probably adapt the construction method fromffmpeg-static
but execute the code with a better idea of__dirname
-- possibly withprocess.getCwd()
or possibly with__dirname
under more clearly controlled circumstances.