diff --git a/main.js b/main.js index c7c3566..fa65519 100644 --- a/main.js +++ b/main.js @@ -292,14 +292,16 @@ let recStream = null, recTempPath = null; function ffmpegPath() { const cands = []; try { cands.push(require('ffmpeg-static')); } catch (e) { /* optional */ } - cands.push(process.env.FFMPEG, 'ffmpeg', + // Absolute candidates FIRST: the packaged app launched from Finder has a + // minimal PATH (no /opt/homebrew/bin), so a bare 'ffmpeg' spawns ENOENT + // there even though the same call works when started from a terminal. + cands.push(process.env.FFMPEG, '/opt/homebrew/bin/ffmpeg', '/usr/local/bin/ffmpeg', '/usr/bin/ffmpeg', 'C:\\ffmpeg\\bin\\ffmpeg.exe', 'C:\\Program Files\\ffmpeg\\bin\\ffmpeg.exe'); for (const c of cands) { - if (!c) continue; - if (c === 'ffmpeg' || fs.existsSync(c)) return c; + if (c && fs.existsSync(c)) return c; } - return 'ffmpeg'; + return 'ffmpeg'; // last resort: hope PATH has it } function transcodeToMp4(input, output, opts) { diff --git a/package.json b/package.json index 024fcd9..c2535c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dj-visualizer", - "version": "1.8.0", + "version": "1.8.1", "description": "Audio-reactive fractal & abstract visualizer for external display (Mac)", "main": "main.js", "author": {