From 51004ebc9e1c9e265635b1cd378a89beb1887497 Mon Sep 17 00:00:00 2001 From: Benjamin Kaiser Date: Sat, 2 Jan 2016 00:45:34 -0800 Subject: [PATCH] fix ffmpeg path for windows electron binaries (manually shipping ffmpeg) --- library_functions.js | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/library_functions.js b/library_functions.js index 5de1b256..1c38ee06 100644 --- a/library_functions.js +++ b/library_functions.js @@ -8,6 +8,13 @@ var async = require('async'); var SoundcloudResolver = require('soundcloud-resolver'); var ytdl = require('ytdl-core'); var youtubePlaylistInfo = require('youtube-playlist-info').playlistInfo; +var os = require('os'); + +// if the platform is windows, set these +if (os.platform() === 'win32') { + process.env.FFMPEG_PATH = path.join(__dirname, 'ffmpeg.exe'); + process.env.FFPROBE_PATH = path.join(__dirname, 'ffprobe.exe'); +} // ffmpeg is optional, allow failure of loading try { diff --git a/package.json b/package.json index e0ec3c0a..40cf170e 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "ytdl-core": "*" }, "optionalDependencies": { - "ffmetadata": "^1.3.0", + "ffmetadata": "git+https://github.com/benkaiser/node-ffmetadata.git", "fluent-ffmpeg": "~2.0.0-rc1" }, "devDependencies": {