#5150 self.api_url='http://127.0.0.1:8808'

38.75* Posted at: 9 hours ago

Audio denoising processing failed: Could not load libtorchcodec. Likely causes:

      1. FFmpeg is not properly installed in your environment. We support
         versions 4, 5, 6, 7, and 8, and we attempt to load libtorchcodec
         for each of those versions. Errors for versions not installed on
         your system are expected; only the error for your installed FFmpeg
         version is relevant. On Windows, ensure you've installed the
         "full-shared" version which ships DLLs.
      2. The PyTorch version (2.11.0+cu128) is not compatible with
         this version of TorchCodec. Refer to the version compatibility
         table:
         https://github.com/pytorch/torchcodec?tab=readme-ov-file#installing-torchcodec.
      3. Another runtime dependency; see exceptions below.

    The following exceptions were raised as we tried to load libtorchcodec:
    

[start of libtorchcodec loading traceback]
FFmpeg
......
'E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core7.dll' (or one of its dependencies). Try using the full path with constructor syntax.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "E:\VoxCPM\python\lib\site-packages\torchcodec\_internally_replaced_utils.py", line 93, in load_torchcodec_shared_libraries

torch.ops.load_library(core_library_path)

File "E:\VoxCPM\python\lib\site-packages\torch\_ops.py", line 1505, in load_library

raise OSError(f"Could not load this library: {path}") from e

OSError: Could not load this library: E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core7.dll

FFmpeg version 6:
Traceback (most recent call last):
File "E:\VoxCPM\python\lib\site-packages\torch\_ops.py", line 1503, in load_library

ctypes.CDLL(path)

File "E:\VoxCPM\python\lib\ctypes\__init__.py", line 374, in init

self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core6.dll' (or one of its dependencies). Try using the full path with constructor syntax.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "E:\VoxCPM\python\lib\site-packages\torchcodec\_internally_replaced_utils.py", line 93, in load_torchcodec_shared_libraries

torch.ops.load_library(core_library_path)

File "E:\VoxCPM\python\lib\site-packages\torch\_ops.py", line 1505, in load_library

raise OSError(f"Could not load this library: {path}") from e

OSError: Could not load this library: E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core6.dll

FFmpeg version 5:
Traceback (most recent call last):
File "E:\VoxCPM\python\lib\site-packages\torch\_ops.py", line 1503, in load_library

ctypes.CDLL(path)

File "E:\VoxCPM\python\lib\ctypes\__init__.py", line 374, in init

self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core5.dll' (or one of its dependencies). Try using the full path with constructor syntax.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "E:\VoxCPM\python\lib\site-packages\torchcodec\_internally_replaced_utils.py", line 93, in load_torchcodec_shared_libraries

torch.ops.load_library(core_library_path)

File "E:\VoxCPM\python\lib\site-packages\torch\_ops.py", line 1505, in load_library

raise OSError(f"Could not load this library: {path}") from e

OSError: Could not load this library: E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core5.dll

FFmpeg version 4:
Traceback (most recent call last):
File "E:\VoxCPM\python\lib\site-packages\torch\_ops.py", line 1503, in load_library

ctypes.CDLL(path)

File "E:\VoxCPM\python\lib\ctypes\__init__.py", line 374, in init

self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core4.dll' (or one of its dependencies). Try using the full path with constructor syntax.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "E:\VoxCPM\python\lib\site-packages\torchcodec\_internally_replaced_utils.py", line 93, in load_torchcodec_shared_libraries

torch.ops.load_library(core_library_path)

File "E:\VoxCPM\python\lib\site-packages\torch\_ops.py", line 1505, in load_library

raise OSError(f"Could not load this library: {path}") from e

OSError: Could not load this library: E:\VoxCPM\Python\Lib\site-packages\torchcodec\libtorchcodec_core4.dll
[end of libtorchcodec loading traceback].
self.api_url='http://127.0.0.1:8808'


=
system:Windows-10-10.0.26200-SP0
version:v4.02
frozen:True
language:zh
root_dir:E:/win-pyvideotrans-v4.01-0602

1 Replies

核心原因:libtorchcodec 加载失败,您的 Windows 系统缺少 FFmpeg 的共享库(.dll)或版本不兼容。源码部署时,pyVideoTrans 依赖系统 FFmpeg,而 torchcodec 组件需要 FFmpeg 的 full-shared 版本(包含 avcodec-*.dll 等动态库),仅安装普通 ffmpeg.exe 是不够的。此外,当前 PyTorch 2.11.0+cu128 可能与所装 torchcodec 版本不匹配。

解决方案(按顺序执行):

  1. 安装 FFmpeg full-shared 版

    • 前往 gyan.dev FFmpeg builds 下载 ffmpeg-full-shared.7z
    • 解压后将其中的 bin 目录路径(例如 C:\ffmpeg\bin)添加到系统 环境变量 PATH 中。
    • 重启计算机 或重启软件。
  2. 安装微软 VC++ 运行库

  3. 检查 PyTorch 与 torchcodec 兼容性

    • 错误显示 PyTorch 版本为 2.11.0+cu128。请参考 torchcodec 版本兼容表 确认当前 torchcodec 是否支持此 PyTorch 版本。若不支持,可尝试降低 PyTorch 版本(例如 2.10.0)或升级 torchcodec
  4. 验证 FFmpeg 环境

    • 打开 CMD 输入 ffmpeg -version,应看到版本信息。如果提示“不是内部或外部命令”,说明 PATH 未生效,请重做步骤 1。

若以上步骤仍无效,请提供 logs/ 文件夹中的最新日志报错片段,以便进一步分析。

请查阅相关文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update. Dondate: ko-fi.com/jianchang512

Related resource

Similar issues already exist