macOS: LBRY Desktop will not find ffmpeg executable #7539

Open
opened 2022-04-11 04:12:44 +02:00 by Geordon · 5 comments
Geordon commented 2022-04-11 04:12:44 +02:00 (Migrated from github.com)

Using a Mac (OS 11.6.5), downloaded ffmpeg through Homebrew. Manually executed ffmpeg successfully, but LBRY client ver 0.52.6 is not picking up ffmpeg binary. Also not picking it up from ~/Library/Application Support/LBRY/ffmpeg

Using a Mac (OS 11.6.5), downloaded ffmpeg through Homebrew. Manually executed ffmpeg successfully, but LBRY client ver 0.52.6 is not picking up ffmpeg binary. Also not picking it up from ~/Library/Application Support/LBRY/ffmpeg
moodyjon commented 2022-05-05 16:05:58 +02:00 (Migrated from github.com)

As a workaround, use the configuration panel to manually enter a path to ffmpeg:

image

Use Command-Shift-Period if needed to reveal hidden paths. My installation was in /opt/homebrew/bin/ffmpeg.

Other info and installation tips:
https://lbry.com/faq/video-publishing-guide#automatic

As a workaround, use the configuration panel to manually enter a path to ffmpeg: ![image](https://user-images.githubusercontent.com/103143855/166938365-e0fa30da-67d5-42f1-9f6b-0237ad6e44f9.png) Use Command-Shift-Period if needed to reveal hidden paths. My installation was in /opt/homebrew/bin/ffmpeg. Other info and installation tips: https://lbry.com/faq/video-publishing-guide#automatic
moodyjon commented 2022-05-05 16:34:20 +02:00 (Migrated from github.com)

On my system: (lbrynet.log)

2022-05-05 10:08:38,724 WARNING lbry.file_analysis:93: Unable to locate ffmpeg executable. Path: :/Users/username/Library/Application Support/LBRY/ffmpeg/bin:/usr/bin:/bin:/usr/sbin:/sbin

At some point I or homebrew added /opt/homebrew/bin to PATH via ~/.zprofile, but LBRY is not using that.

echo $PATH
/usr/local/go/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin

Mac-mini lbry % cat /etc/profile   
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
	eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
	[ -r /etc/bashrc ] && . /etc/bashrc
fi

Description of path_helper functionality:
http://www.softec.lu/site/DevelopersCorner/MasteringThePathHelper

Mac-mini lbry % cat ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

alias brew86="arch -x86_64 /usr/local/bin/brew"
alias pyenv86="arch -x86_64 pyenv"

# lbrysdk
export PYTHONUNBUFFERED=1
export EVENT_NOKQUEUE=1

# golang
export PATH=/usr/local/go/bin:${PATH}

Mac-mini lbry % cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
Mac-mini lbry % ls -l /etc/paths.d
total 16
-rwxr-xr-x  1 root  wheel  23 Dec 27 18:57 100-rvictl
-rw-r--r--  1 root  wheel  18 Mar 15 10:23 go
Mac-mini lbry % cat /etc/paths.d/100-rvictl 
/Library/Apple/usr/bin
Mac-mini lbry % cat /etc/paths.d/go        
/usr/local/go/bin
On my system: (lbrynet.log) 2022-05-05 10:08:38,724 WARNING lbry.file_analysis:93: Unable to locate ffmpeg executable. Path: :/Users/username/Library/Application Support/LBRY/ffmpeg/bin:/usr/bin:/bin:/usr/sbin:/sbin At some point I or homebrew added /opt/homebrew/bin to PATH via ~/.zprofile, but LBRY is not using that. ``` echo $PATH /usr/local/go/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin Mac-mini lbry % cat /etc/profile # System-wide .profile for sh(1) if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s` fi if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi Description of path_helper functionality: http://www.softec.lu/site/DevelopersCorner/MasteringThePathHelper Mac-mini lbry % cat ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" alias brew86="arch -x86_64 /usr/local/bin/brew" alias pyenv86="arch -x86_64 pyenv" # lbrysdk export PYTHONUNBUFFERED=1 export EVENT_NOKQUEUE=1 # golang export PATH=/usr/local/go/bin:${PATH} Mac-mini lbry % cat /etc/paths /usr/local/bin /usr/bin /bin /usr/sbin /sbin Mac-mini lbry % ls -l /etc/paths.d total 16 -rwxr-xr-x 1 root wheel 23 Dec 27 18:57 100-rvictl -rw-r--r-- 1 root wheel 18 Mar 15 10:23 go Mac-mini lbry % cat /etc/paths.d/100-rvictl /Library/Apple/usr/bin Mac-mini lbry % cat /etc/paths.d/go /usr/local/go/bin ```
moodyjon commented 2022-05-05 16:38:03 +02:00 (Migrated from github.com)

Using "open" in the shell works for me with no need to edit daemon_settings.yml. In that context the which-based lookup works.

Mac-mini ~ % open /Applications/LBRY.app

When clicking on LBRY icon in Dock it does not.

Using "open" in the shell works for me with no need to edit daemon_settings.yml. In that context the which-based lookup works. Mac-mini ~ % open /Applications/LBRY.app When clicking on LBRY icon in Dock it does not.
jessopb commented 2022-07-11 18:42:47 +02:00 (Migrated from github.com)

@moodyjon thanks for the detailed reply. Can you recommend the simplest way on mac to make this work automagically for more users?

@moodyjon thanks for the detailed reply. Can you recommend the simplest way on mac to make this work automagically for more users?
moodyjon commented 2022-07-12 18:29:28 +02:00 (Migrated from github.com)

Everything I find online says that the rules for MacOS apps and PATH keep changing, becoming obsolete:

https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications

I think basically the problem is all these MacOS mechanisms are not understood well, and people tend to fall back to what they're familiar with: /etc/zprofile, $HOME/.zprofile, $HOME/.zshrc, etc. Users don't fiddle with "launchctl". At least I never learned to do that.

It might be possible to pick up PATH entries from the shell config files using something like:

subprocess.run("sh -l -c 'which ffmpeg'", shell=True)

Currently the code looks like:

    def _which_ffmpeg_and_ffmprobe(path):
        return shutil.which("ffmpeg", path=path), shutil.which("ffprobe", path=path)

30dd0c1e11/lbry/file_analysis.py (L78)

Everything I find online says that the rules for MacOS apps and PATH keep changing, becoming obsolete: https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications I think basically the problem is all these MacOS mechanisms are not understood well, and people tend to fall back to what they're familiar with: /etc/zprofile, $HOME/.zprofile, $HOME/.zshrc, etc. Users don't fiddle with "launchctl". At least I never learned to do that. It *might* be possible to pick up PATH entries from the shell config files using something like: ``` subprocess.run("sh -l -c 'which ffmpeg'", shell=True) ``` Currently the code looks like: ``` def _which_ffmpeg_and_ffmprobe(path): return shutil.which("ffmpeg", path=path), shutil.which("ffprobe", path=path) ``` https://github.com/lbryio/lbry-sdk/blob/30dd0c1e11d86d0677ed7088007dfab3433e81cf/lbry/file_analysis.py#L78
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#7539
No description provided.