fix: enhance ffmpeg detection for macOS and cross-platform support#17
Merged
GhostTypes merged 2 commits intomainfrom Nov 4, 2025
Merged
Conversation
…tallations Fixes #13 - RTSP camera streaming failing on macOS due to ffmpeg not being detected. Problem: - Electron apps launched from Finder on macOS don't inherit user shell PATH - Homebrew installs ffmpeg to /opt/homebrew/bin (Apple Silicon) or /usr/local/bin (Intel Mac) - Current implementation only checks PATH, causing ffmpeg to not be found Solution: - Enhanced checkFfmpegAvailability() to check common installation paths across all platforms - Tries PATH first (backward compatible), then checks platform-specific locations: * macOS: Homebrew (Apple Silicon & Intel), MacPorts * Linux: apt/yum/pacman, Snap, Flatpak, manual installs * Windows: common Program Files locations - Provides helpful error messages with platform-specific installation instructions Impact: - macOS users with Homebrew-installed ffmpeg can now use RTSP cameras - Linux users with Snap/Flatpak installations are now supported - Better diagnostics when ffmpeg is not found - No breaking changes - fully backward compatible
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 handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes