Commit 0bbd3d0
committed
fix: add ffmpeg directory to PATH so node-rtsp-stream can spawn it
Fixes the "spawn ffmpeg ENOENT" error when launching from Finder on macOS.
Problem:
- Detection code finds ffmpeg at full path (e.g., /opt/homebrew/bin/ffmpeg)
- But node-rtsp-stream doesn't support custom ffmpeg path option
- When node-rtsp-stream spawns ffmpeg, it uses 'ffmpeg' which requires PATH
- macOS GUI launches have minimal PATH without Homebrew directories
Solution:
- After finding ffmpeg, extract its directory and add to process.env.PATH
- This makes ffmpeg available when node-rtsp-stream spawns it later
- Works for both forward slashes (macOS/Linux) and backslashes (Windows)
- Only modifies PATH when using explicit paths (not when ffmpeg already in PATH)
Testing:
- Launch from Finder: ffmpeg should now be found and spawn successfully
- Launch from Terminal: continues to work as before
- Cross-platform compatible with proper path separator handling1 parent 2cfc722 commit 0bbd3d0
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
191 | 208 | | |
192 | 209 | | |
193 | 210 | | |
| |||
0 commit comments