Open ruliworst opened 1 month ago
Loading manullay the binaries is working but, I would like it was automatic.
ctypes.CDLL('C:/Program Files/ffmpeg/bin/avcodec-60.dll')
ctypes.CDLL('C:/Program Files/ffmpeg/bin/avdevice-60.dll')
ctypes.CDLL('C:/Program Files/ffmpeg/bin/avfilter-9.dll')
ctypes.CDLL('C:/Program Files/ffmpeg/bin/avformat-60.dll')
ctypes.CDLL('C:/Program Files/ffmpeg/bin/avutil-58.dll')
I still don't know why it is not working without preloading libraries.
If I locate the libraries in the same folder of libtorio_ffmpeg6.pyd
, they are detected while importing. That is, in Lib/site-packages/torio/lib
EDIT: I have been checking the internal code and in file torchaudio\_extension\__init__.py
line 24 there is a code which is not being executed:
if os.name == "nt" and (3, 8) <= sys.version_info < (3, 9):
_init_dll_path()
This code adds the paths from PATH
environment variable to the DLL search path. However, I would like to know why it is only executed in Python 3.8 version.
Thank you.
🐛 Describe the bug
Hi everyone,
I am trying to use torchaudio with FFmpeg but for some reason it is not being detected.
I added the path 'C:\Program Files\ffmpeg\bin' to the PATH environment variable. As you can see I can execute ffmpeg from cmd. However, when I execute
torchaudio.list_audio_backends()
only 'soundfile' is detected. I tested this in a Python PIP (I can't use conda) virtual environment with version 3.10 and in another one with version 3.12 but, it didn't work in both. Torchaudio and torch versions are2.2.1
. I don't know if it is a problem with version compatibility but in the official documentation I saw ffmpeg 6 is supported and I checked the code which tries to load the libraries.I checked a lot of related issues but I couldn't find the right solution.
Any suggestions are welcome! Thanks.
Versions