Open ChironeX1976 opened 2 years ago
I‘ve got the same question and look forward to the answer :(
It works! Just simply add AudioSegment.converter = r"path_to_your_ffmpeg.exe"
after from pydub import AudioSegment
in your code. Then you don't need to add it to the environment variables.
thank you for sharing!
I have found that adding AudioSegment.converter = 'path/to/ffmpegexe'
is not always sufficient when ffprobe.exe is needed as well. I have found many suggesting to add AudioSegment.ffprobe = 'path/to/ffprobe.exe'
to ones code, but that seems to do nothing as of today
However, changing the returned value of the else clause in get_prober_name() in the utils.py to the absolute path of ffprobe.exe mitigates the issue.
Maybe it would be possible to make AudioSegment.ffprobe = 'path/to/ffprobe.exe'
actually work, as I think that would be the most intiuitive solution!?
I know this is a old issue, but just to help other people that are having the same problem but none of the others solutions worked, you can use the OS library to create a temporarily PATH Assignment this is just temporarily while your code runs so don't need to have admin rights
from os import environ, pathsep, path
environ["PATH"] += pathsep + path.abspath(f"absolute path to ffmpeg/ffplay/ffprobe folder")
Hello, I have a piece of working Pydub-code on my personal laptop, with 'c:/ffmpeg/bin' added to path in de environment variables in windows. So far so good. I want to use this code on the company-laptop i use. I cannot access the environment variables to add 'c:/ffmpeg/bin' to path because i have no Admin rights. The system administrator won't change my permissions, which i understand completely.
Is there a workaround? I mean: can i force "audiosegment" to use the ffmpeg - program directly from the python code, without adding ffmpeg to path in windows?
Hereby i share my code :