#5148 [end of libtorchcodec loading traceback].

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
......
leNotFoundError: Could not find module '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].


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

1 Replies

这个错误是因为 torchcodec 无法加载系统的 FFmpeg 动态链接库(DLL)。在 Windows 上,torchcodec 需要 FFmpeg 的“full-shared”版本(包含 avcodec-*.dllavformat-*.dll 等文件),但你当前的 FFmpeg 安装可能缺少这些 DLL,或者环境变量未正确配置。

解决方案

方案一:使用 pyVideoTrans 官方 Windows 预打包版(推荐)

  • 前往官网下载 完整版压缩包(约 2.6GB,已内置 FFmpeg 所有依赖),解压后直接运行 sp.exe,无需手动配置 FFmpeg。
  • 详见:下载软件

方案二:手动安装 FFmpeg full-shared 版本(源码部署用户)

  1. 下载 FFmpeg 的 Windows 完整共享版(full-shared),例如从 gyan.dev 下载 ffmpeg-release-full-shared.7z
  2. 解压到任意目录,将 bin 文件夹路径添加到系统环境变量 Path 中(例如 C:\ffmpeg\bin)。
  3. 重启 pyVideoTrans 软件。

方案三:临时规避
如果你当前不需要降噪功能,可以暂时关闭:

  • 在主界面点击 “设置更多参数”,取消勾选 “降噪”“分离人声背景声”,然后重新运行任务。

验证 FFmpeg 安装

打开命令提示符(CMD),输入以下命令确认能够正常显示版本信息:

ffmpeg -version

如果提示“不是内部或外部命令”,说明环境变量未生效。


请查阅相关文档:

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