-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ffpb = WinError 2 #30
Comments
Do you have |
>>> from os import *
>>>
>>> # for variable in PATH
>>> # if lowercase variable ends with ffmpeg.exe
>>> # print(variable)
>>>
>>> for Variable in environ["PATH"].split(pathsep):
... if Variable.lower().endswith("ffmpeg.exe"):
... print(Variable)
...
C:\Users\kubinka0505\Programs\ffmpeg.exe TLDR: Yes |
If that's important I use:
|
I did some tweaking, and I've figured out that C:\Users\kubinka0505>: Not installed
C:\Users\kubinka0505>ffpb
'ffpb' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\kubinka0505>: Install
C:\Users\kubinka0505>pip install ffpb -q
C:\Users\kubinka0505>: Use
C:\Users\kubinka0505>ffpb
C:\Users\kubinka0505>: Check FFmpeg in %UserProfile%
C:\Users\kubinka0505>ffmpeg.exe -loglevel 0
C:\Users\kubinka0505>: Move FFmpeg
C:\Users\kubinka0505>move ffmpeg.exe Programs
1 file(s) moved.
C:\Users\kubinka0505>: Try to use ffpb
C:\Users\kubinka0505>ffpb
Unexpected exception: [WinError 2] Nie można odnaleźć określonego pliku
C:\Users\kubinka0505>cd Programs
C:\Users\kubinka0505\Programs>: Use ffpb in the directory where FFmpeg is
C:\Users\kubinka0505\Programs>ffpb
C:\Users\kubinka0505\Programs>: Move FFmpeg to home directory
C:\Users\kubinka0505\Programs>move ffmpeg.exe ..
1 file(s) moved.
C:\Users\kubinka0505\Programs>: Use ffpb
C:\Users\kubinka0505\Programs>ffpb
C:\Users\kubinka0505\Programs> It's likely that the error is caused by inaccurate path detection of the static FFmpeg executable binary, which is probably performed on this line: Line 155 in da41f96
I recommend applying some kind of universal detection function like this: from pathlib import Path
def Detect_Binary(Name: str.lower, Variable_Name: str = "PATH", Format: str = "EXE") -> str:
"""Looks for binary of `Name` in the `Variable` environment variable."""
Name_Original = Name
Name = Name.lower()
Format = Format.lower()
#-=-=-=-#
if os.sys.platform.lower().startswith("win"):
for Variable in os.environ[Variable_Name].split(os.pathsep):
if Name + "." + Format in Variable:
# Fix the final path
Name = str(Path(Variable).resolve())
if not os.path.exists(Name):
raise AttributeError(Name_Original + " not found!")
#-=-=-=-#
return Name ...and then ...
cmd = [Detect_Binary("FFmpeg")] + argv
... |
That's weird, on my Windows machine |
I've just installed ffpb and this dropped. Any solutions?
The text was updated successfully, but these errors were encountered: