Pydub не может найти ffprobe, несмотря на все решения, которые я пробовал - PullRequest
0 голосов
/ 18 апреля 2020

Это очень похоже на вопрос Pydub не может найти ffprobe , однако после выполнения решения он все равно не работает: |

У меня есть FFmpeg в пути для переменных среды а также.

мой текущий код является простым, чтобы я мог ознакомиться с pydub.

from pydub import AudioSegment
import os

directory = r"C:\Users\Wei's PC\Music\Files\Relaxing"

AudioSegment.converter = 'C:\\FFmpeg\\bin\\ffmpeg.exe'
AudioSegment.ffmpeg = "C:\\FFmpeg\\bin\\ffmpeg.exe"
AudioSegment.ffprobe = "C:\\FFmpeg\\bin\\ffprobe.exe"

os.chdir(directory)
file = AudioSegment.from_file(rf'{directory}\test.flac', 'flac')
file.export(f'River Flows in You.mp3', format = 'mp3')

, но я продолжаю получать эту ошибку

Warning (from warnings module):
  File "C:\Users\Wei's PC\AppData\Local\Programs\Python\Python37\lib\site-packages\pydub\utils.py", line 193
    warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
Traceback (most recent call last):
  File "C:\Users\Wei's PC\Documents\Python\testing pydub.py", line 11, in <module>
    file = AudioSegment.from_file(rf'{directory}\test.flac', 'flac')
  File "C:\Users\Wei's PC\AppData\Local\Programs\Python\Python37\lib\site-packages\pydub\audio_segment.py", line 665, in from_file
    info = mediainfo_json(orig_file)
  File "C:\Users\Wei's PC\AppData\Local\Programs\Python\Python37\lib\site-packages\pydub\utils.py", line 263, in mediainfo_json
    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
  File "C:\Users\Wei's PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Wei's PC\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
...