From bf7a05b4bb7f8c89dbf13b35ac7af2994c80fdc0 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Thu, 17 Jul 2025 07:57:25 -0700 Subject: [PATCH 1/3] Fix typing error --- src/torchcodec/_internally_replaced_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torchcodec/_internally_replaced_utils.py b/src/torchcodec/_internally_replaced_utils.py index d49e0346..c5e9511a 100644 --- a/src/torchcodec/_internally_replaced_utils.py +++ b/src/torchcodec/_internally_replaced_utils.py @@ -53,7 +53,7 @@ def _load_pybind11_module(module_name: str, library_path: str) -> ModuleType: return importlib.util.module_from_spec(spec) -def _get_pybind_ops_module_name(ffmpeg_major_version: str) -> str: +def _get_pybind_ops_module_name(ffmpeg_major_version: int) -> str: # Note that this value must match the value used as PYBIND_OPS_MODULE_NAME # when we compile _core/pybind_ops.cpp. If the values do not match, we will # not be able to import the C++ shared library as a Python module at From 7469443060305936c89046be71551e600148a120 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Thu, 17 Jul 2025 08:05:42 -0700 Subject: [PATCH 2/3] Remove comments about internal --- src/torchcodec/_core/ops.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/torchcodec/_core/ops.py b/src/torchcodec/_core/ops.py index 20f3ff14..4fa60cae 100644 --- a/src/torchcodec/_core/ops.py +++ b/src/torchcodec/_core/ops.py @@ -28,9 +28,6 @@ def load_torchcodec_shared_libraries(): # ffmpeg major version. This should cover all potential ffmpeg versions # installed on the user's machine. # - # On fbcode, _get_extension_path() is overridden and directly points to the - # correct .so file, so this for-loop succeeds on the first iteration. - # # Note that we use two different methods for loading shared libraries: # # 1. torch.ops.load_library(): For PyTorch custom ops and the C++ only From 33611ba52fc920e9797c1b8cac0614c3ef1ce43e Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Thu, 17 Jul 2025 17:15:44 -0700 Subject: [PATCH 3/3] Improve library loading comment --- src/torchcodec/_core/ops.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/torchcodec/_core/ops.py b/src/torchcodec/_core/ops.py index 4fa60cae..4e4f7320 100644 --- a/src/torchcodec/_core/ops.py +++ b/src/torchcodec/_core/ops.py @@ -23,10 +23,10 @@ def load_torchcodec_shared_libraries(): - # Successively try to load libtorchcodec_*7.so, libtorchcodec_*6.so, - # libtorchcodec_*5.so, and libtorchcodec_*4.so. Each of these correspond to an - # ffmpeg major version. This should cover all potential ffmpeg versions - # installed on the user's machine. + # Successively try to load the shared libraries for each version of FFmpeg + # that we support. We always start with the highest version, working our way + # down to the lowest version. Once we can load ALL shared libraries for a + # version of FFmpeg, we have succeeded and we stop. # # Note that we use two different methods for loading shared libraries: #