1

This is a very similar question to this Pydub unable to locte ffprobe however after following the solution, it still doesn't work :|

I have FFmpeg in path for environment variables as well.

my current code is just a simple one to let myself familiarise with 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')

but I keep getting this error

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
Wei
  • 31
  • 1

0 Answers0