Add ffmpeg-binaries as a possible source of ffmpeg (#975)

* Add ffmpeg-binaries as a possible source of ffmpeg

* Add note in faq
This commit is contained in:
Hackzzila
2016-12-11 13:02:01 -06:00
committed by Amish Shah
parent d766e727a1
commit 52a83b9218
2 changed files with 9 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ Update to Node.js 6.0.0 or newer.
node-opus is greatly preferred, due to it having significantly better performance. node-opus is greatly preferred, due to it having significantly better performance.
## How do I install FFMPEG? ## How do I install FFMPEG?
- **npm:** `npm install --save ffmpeg-binaries`
- **Ubuntu 16.04:** `sudo apt install ffmpeg` - **Ubuntu 16.04:** `sudo apt install ffmpeg`
- **Ubuntu 14.04:** `sudo apt-get install libav-tools` - **Ubuntu 14.04:** `sudo apt-get install libav-tools`
- **Windows:** See the [FFMPEG section of AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md#download-ffmpeg). - **Windows:** See the [FFMPEG section of AoDude's guide](https://github.com/bdistin/OhGodMusicBot/blob/master/README.md#download-ffmpeg).

View File

@@ -67,7 +67,14 @@ class FfmpegConverterEngine extends ConverterEngine {
} }
function chooseCommand() { function chooseCommand() {
for (const cmd of ['ffmpeg', 'avconv', './ffmpeg', './avconv']) { for (const cmd of [
'ffmpeg',
'avconv',
'./ffmpeg',
'./avconv',
'node_modules\\ffmpeg-binaries\\bin\\ffmpeg',
'node_modules/ffmpeg-binaries/bin/ffmpeg',
]) {
if (!ChildProcess.spawnSync(cmd, ['-h']).error) return cmd; if (!ChildProcess.spawnSync(cmd, ['-h']).error) return cmd;
} }
throw new Error( throw new Error(