Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

More robust method to set ffmpeg path #8

Open
JoeGermuska opened this issue Feb 6, 2018 · 1 comment
Open

More robust method to set ffmpeg path #8

JoeGermuska opened this issue Feb 6, 2018 · 1 comment

Comments

@JoeGermuska
Copy link
Member

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 of webpack to pull project code together. Since we're using webpack, 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 docs

In 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 the ffmpeg-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 from ffmpeg-static but execute the code with a better idea of __dirname -- possibly with process.getCwd() or possibly with __dirname under more clearly controlled circumstances.

@JoeGermuska
Copy link
Member Author

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.

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

No branches or pull requests

1 participant