torchcodec 0.8.0__cp313-cp313-macosx_12_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of torchcodec might be problematic. Click here for more details.

Files changed (82) hide show
  1. torchcodec/.dylibs/libc++.1.0.dylib +0 -0
  2. torchcodec/.dylibs/libpython3.13.dylib +0 -0
  3. torchcodec/__init__.py +16 -0
  4. torchcodec/_core/AVIOContextHolder.cpp +60 -0
  5. torchcodec/_core/AVIOContextHolder.h +64 -0
  6. torchcodec/_core/AVIOFileLikeContext.cpp +98 -0
  7. torchcodec/_core/AVIOFileLikeContext.h +55 -0
  8. torchcodec/_core/AVIOTensorContext.cpp +123 -0
  9. torchcodec/_core/AVIOTensorContext.h +43 -0
  10. torchcodec/_core/BetaCudaDeviceInterface.cpp +636 -0
  11. torchcodec/_core/BetaCudaDeviceInterface.h +191 -0
  12. torchcodec/_core/CMakeLists.txt +325 -0
  13. torchcodec/_core/CUDACommon.cpp +315 -0
  14. torchcodec/_core/CUDACommon.h +46 -0
  15. torchcodec/_core/Cache.h +138 -0
  16. torchcodec/_core/CpuDeviceInterface.cpp +347 -0
  17. torchcodec/_core/CpuDeviceInterface.h +132 -0
  18. torchcodec/_core/CudaDeviceInterface.cpp +357 -0
  19. torchcodec/_core/CudaDeviceInterface.h +64 -0
  20. torchcodec/_core/DeviceInterface.cpp +117 -0
  21. torchcodec/_core/DeviceInterface.h +148 -0
  22. torchcodec/_core/Encoder.cpp +807 -0
  23. torchcodec/_core/Encoder.h +173 -0
  24. torchcodec/_core/FFMPEGCommon.cpp +608 -0
  25. torchcodec/_core/FFMPEGCommon.h +245 -0
  26. torchcodec/_core/FilterGraph.cpp +149 -0
  27. torchcodec/_core/FilterGraph.h +59 -0
  28. torchcodec/_core/Frame.cpp +42 -0
  29. torchcodec/_core/Frame.h +72 -0
  30. torchcodec/_core/Metadata.h +72 -0
  31. torchcodec/_core/NVDECCache.cpp +70 -0
  32. torchcodec/_core/NVDECCache.h +104 -0
  33. torchcodec/_core/SingleStreamDecoder.cpp +1719 -0
  34. torchcodec/_core/SingleStreamDecoder.h +405 -0
  35. torchcodec/_core/StreamOptions.h +63 -0
  36. torchcodec/_core/Transform.cpp +60 -0
  37. torchcodec/_core/Transform.h +59 -0
  38. torchcodec/_core/ValidationUtils.cpp +35 -0
  39. torchcodec/_core/ValidationUtils.h +21 -0
  40. torchcodec/_core/__init__.py +41 -0
  41. torchcodec/_core/_metadata.py +317 -0
  42. torchcodec/_core/custom_ops.cpp +875 -0
  43. torchcodec/_core/fetch_and_expose_non_gpl_ffmpeg_libs.cmake +360 -0
  44. torchcodec/_core/nvcuvid_include/cuviddec.h +1374 -0
  45. torchcodec/_core/nvcuvid_include/nvcuvid.h +610 -0
  46. torchcodec/_core/ops.py +498 -0
  47. torchcodec/_core/pybind_ops.cpp +50 -0
  48. torchcodec/_frame.py +145 -0
  49. torchcodec/_internally_replaced_utils.py +67 -0
  50. torchcodec/_samplers/__init__.py +7 -0
  51. torchcodec/_samplers/video_clip_sampler.py +418 -0
  52. torchcodec/decoders/__init__.py +12 -0
  53. torchcodec/decoders/_audio_decoder.py +177 -0
  54. torchcodec/decoders/_decoder_utils.py +112 -0
  55. torchcodec/decoders/_video_decoder.py +500 -0
  56. torchcodec/encoders/__init__.py +1 -0
  57. torchcodec/encoders/_audio_encoder.py +150 -0
  58. torchcodec/libtorchcodec_core4.dylib +0 -0
  59. torchcodec/libtorchcodec_core5.dylib +0 -0
  60. torchcodec/libtorchcodec_core6.dylib +0 -0
  61. torchcodec/libtorchcodec_core7.dylib +0 -0
  62. torchcodec/libtorchcodec_core8.dylib +0 -0
  63. torchcodec/libtorchcodec_custom_ops4.dylib +0 -0
  64. torchcodec/libtorchcodec_custom_ops5.dylib +0 -0
  65. torchcodec/libtorchcodec_custom_ops6.dylib +0 -0
  66. torchcodec/libtorchcodec_custom_ops7.dylib +0 -0
  67. torchcodec/libtorchcodec_custom_ops8.dylib +0 -0
  68. torchcodec/libtorchcodec_pybind_ops4.so +0 -0
  69. torchcodec/libtorchcodec_pybind_ops5.so +0 -0
  70. torchcodec/libtorchcodec_pybind_ops6.so +0 -0
  71. torchcodec/libtorchcodec_pybind_ops7.so +0 -0
  72. torchcodec/libtorchcodec_pybind_ops8.so +0 -0
  73. torchcodec/samplers/__init__.py +2 -0
  74. torchcodec/samplers/_common.py +84 -0
  75. torchcodec/samplers/_index_based.py +287 -0
  76. torchcodec/samplers/_time_based.py +358 -0
  77. torchcodec/version.py +2 -0
  78. torchcodec-0.8.0.dist-info/METADATA +253 -0
  79. torchcodec-0.8.0.dist-info/RECORD +82 -0
  80. torchcodec-0.8.0.dist-info/WHEEL +5 -0
  81. torchcodec-0.8.0.dist-info/licenses/LICENSE +28 -0
  82. torchcodec-0.8.0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,360 @@
1
+ # This file fetches the non-GPL ffmpeg libraries from the torchcodec S3 bucket,
2
+ # and exposes them as CMake targets so we can dynamically link against them.
3
+ # These libraries were built on the CI via the build_ffmpeg.yaml workflow.
4
+
5
+ # Avoid warning: see https://cmake.org/cmake/help/latest/policy/CMP0135.html
6
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
7
+ cmake_policy(SET CMP0135 NEW)
8
+ endif()
9
+
10
+ include(FetchContent)
11
+
12
+ if (UNIX AND NOT APPLE)
13
+ set(LINUX TRUE)
14
+ else()
15
+ set(LINUX FALSE)
16
+ endif()
17
+
18
+ set(
19
+ base_url
20
+ https://pytorch.s3.amazonaws.com/torchcodec/ffmpeg/2025-03-14
21
+ )
22
+
23
+ if (LINUX)
24
+ set(lib_dir "lib")
25
+
26
+ set(
27
+ platform_url
28
+ ${base_url}/linux_x86_64
29
+ )
30
+
31
+ set(
32
+ f4_sha256
33
+ 1a083f1922443bedb5243d04896383b8c606778a7ddb9d886c8303e55339fe0c
34
+ )
35
+ set(
36
+ f5_sha256
37
+ 65d6ad54082d94dcb3f801d73df2265e0e1bb303c7afbce7723e3b77ccd0e207
38
+ )
39
+ set(
40
+ f6_sha256
41
+ 8bd5939c2f4a4b072e837e7870c13fe7d13824e5ff087ab534e4db4e90b7be9c
42
+ )
43
+ set(
44
+ f7_sha256
45
+ 1cb946d8b7c6393c2c3ebe1f900b8de7a2885fe614c45d4ec32c9833084f2f26
46
+ )
47
+ set(
48
+ f8_sha256
49
+ c55b3c1a4b5e4d5fdd7c632bea3ab6f45b4e37cc8e0999dda3f84a8ed8defad8
50
+ )
51
+ set(
52
+ f4_library_file_names
53
+ libavutil.so.56
54
+ libavcodec.so.58
55
+ libavformat.so.58
56
+ libavdevice.so.58
57
+ libavfilter.so.7
58
+ libswscale.so.5
59
+ libswresample.so.3
60
+ )
61
+ set(
62
+ f5_library_file_names
63
+ libavutil.so.57
64
+ libavcodec.so.59
65
+ libavformat.so.59
66
+ libavdevice.so.59
67
+ libavfilter.so.8
68
+ libswscale.so.6
69
+ libswresample.so.4
70
+ )
71
+ set(
72
+ f6_library_file_names
73
+ libavutil.so.58
74
+ libavcodec.so.60
75
+ libavformat.so.60
76
+ libavdevice.so.60
77
+ libavfilter.so.9
78
+ libswscale.so.7
79
+ libswresample.so.4
80
+ )
81
+ set(
82
+ f7_library_file_names
83
+ libavutil.so.59
84
+ libavcodec.so.61
85
+ libavformat.so.61
86
+ libavdevice.so.61
87
+ libavfilter.so.10
88
+ libswscale.so.8
89
+ libswresample.so.5
90
+ )
91
+ set(
92
+ f8_library_file_names
93
+ libavutil.so.60
94
+ libavcodec.so.62
95
+ libavformat.so.62
96
+ libavdevice.so.62
97
+ libavfilter.so.11
98
+ libswscale.so.9
99
+ libswresample.so.6
100
+ )
101
+ elseif (APPLE)
102
+ set(lib_dir "lib")
103
+ set(
104
+ platform_url
105
+ ${base_url}/macos_arm64
106
+ )
107
+ set(
108
+ f4_sha256
109
+ f0335434529d9e19359eae0fe912dd9e747667534a1c92e662f5219a55dfad8c
110
+ )
111
+ set(
112
+ f5_sha256
113
+ cfc3449c9af6863731a431ce89e32c08c5f8ece94b306fb6b695828502a76166
114
+ )
115
+ set(
116
+ f6_sha256
117
+ ec47b4783c342038e720e33b2fdfa55a9a490afb1cf37a26467733983688647e
118
+ )
119
+ set(
120
+ f7_sha256
121
+ 48a4fc8ce098305cfd4a58f40889249c523ca3c285f66ba704b5bad0e3ada53a
122
+ )
123
+ set(
124
+ f8_sha256
125
+ beb936b76f25d2621228a12cdb67c9ae3d1eff7aa713ef8d1167ebf0c25bd5ec
126
+ )
127
+
128
+ set(
129
+ f4_library_file_names
130
+ libavutil.56.dylib
131
+ libavcodec.58.dylib
132
+ libavformat.58.dylib
133
+ libavdevice.58.dylib
134
+ libavfilter.7.dylib
135
+ libswscale.5.dylib
136
+ libswresample.3.dylib
137
+ )
138
+ set(
139
+ f5_library_file_names
140
+ libavutil.57.dylib
141
+ libavcodec.59.dylib
142
+ libavformat.59.dylib
143
+ libavdevice.59.dylib
144
+ libavfilter.8.dylib
145
+ libswscale.6.dylib
146
+ libswresample.4.dylib
147
+ )
148
+ set(
149
+ f6_library_file_names
150
+ libavutil.58.dylib
151
+ libavcodec.60.dylib
152
+ libavformat.60.dylib
153
+ libavdevice.60.dylib
154
+ libavfilter.9.dylib
155
+ libswscale.7.dylib
156
+ libswresample.4.dylib
157
+ )
158
+ set(
159
+ f7_library_file_names
160
+ libavutil.59.dylib
161
+ libavcodec.61.dylib
162
+ libavformat.61.dylib
163
+ libavdevice.61.dylib
164
+ libavfilter.10.dylib
165
+ libswscale.8.dylib
166
+ libswresample.5.dylib
167
+ )
168
+ set(
169
+ f8_library_file_names
170
+ libavutil.60.dylib
171
+ libavcodec.62.dylib
172
+ libavformat.62.dylib
173
+ libavdevice.62.dylib
174
+ libavfilter.11.dylib
175
+ libswscale.9.dylib
176
+ libswresample.6.dylib
177
+ )
178
+
179
+ elseif (WIN32)
180
+ set(lib_dir "bin")
181
+ set(
182
+ platform_url
183
+ ${base_url}/windows_x86_64
184
+ )
185
+ set(
186
+ f4_sha256
187
+ 270a1aa8892225267e68a7eb87c417931da30dccbf08ee2bde8833e659cab5cb
188
+ )
189
+ set(
190
+ f5_sha256
191
+ b8b2a349a847e56a6da875b066dff1cae53cb8ee7cf5ba9321ec1243dea0cde0
192
+ )
193
+ set(
194
+ f6_sha256
195
+ 5d9f8c76dc55f790fa31d825985e9270bf9e498b8bfec21a0ad3a1feb1fa053a
196
+ )
197
+ set(
198
+ f7_sha256
199
+ ae391ace382330e912793b70b68529ee7c91026d2869b4df7e7c3e7d3656bdd5
200
+ )
201
+ set(
202
+ f8_sha256
203
+ bac845ac79876b104959cb0e7b9dec772a261116344dd17d2f97e7ddfac4a73f
204
+ )
205
+
206
+ set(
207
+ f4_library_file_names
208
+ avutil.lib
209
+ avcodec.lib
210
+ avformat.lib
211
+ avdevice.lib
212
+ avfilter.lib
213
+ swscale.lib
214
+ swresample.lib
215
+ )
216
+ set(
217
+ f5_library_file_names
218
+ avutil.lib
219
+ avcodec.lib
220
+ avformat.lib
221
+ avdevice.lib
222
+ avfilter.lib
223
+ swscale.lib
224
+ swresample.lib
225
+ )
226
+ set(
227
+ f6_library_file_names
228
+ avutil.lib
229
+ avcodec.lib
230
+ avformat.lib
231
+ avdevice.lib
232
+ avfilter.lib
233
+ swscale.lib
234
+ swresample.lib
235
+ )
236
+ set(
237
+ f7_library_file_names
238
+ avutil.lib
239
+ avcodec.lib
240
+ avformat.lib
241
+ avdevice.lib
242
+ avfilter.lib
243
+ swscale.lib
244
+ swresample.lib
245
+ )
246
+ set(
247
+ f8_library_file_names
248
+ avutil.lib
249
+ avcodec.lib
250
+ avformat.lib
251
+ avdevice.lib
252
+ avfilter.lib
253
+ swscale.lib
254
+ swresample.lib
255
+ )
256
+ else()
257
+ message(
258
+ FATAL_ERROR
259
+ "Unsupported operating system: ${CMAKE_SYSTEM_NAME}"
260
+ )
261
+ endif()
262
+
263
+ FetchContent_Declare(
264
+ f4
265
+ URL ${platform_url}/4.4.4.tar.gz
266
+ URL_HASH
267
+ SHA256=${f4_sha256}
268
+ )
269
+ FetchContent_Declare(
270
+ f5
271
+ URL ${platform_url}/5.1.4.tar.gz
272
+ URL_HASH
273
+ SHA256=${f5_sha256}
274
+ )
275
+ FetchContent_Declare(
276
+ f6
277
+ URL ${platform_url}/6.1.1.tar.gz
278
+ URL_HASH
279
+ SHA256=${f6_sha256}
280
+ )
281
+ FetchContent_Declare(
282
+ f7
283
+ URL ${platform_url}/7.0.1.tar.gz
284
+ URL_HASH
285
+ SHA256=${f7_sha256}
286
+ )
287
+ FetchContent_Declare(
288
+ f8
289
+ URL ${platform_url}/8.0.tar.gz
290
+ URL_HASH
291
+ SHA256=${f8_sha256}
292
+ )
293
+
294
+ FetchContent_MakeAvailable(f4 f5 f6 f7 f8)
295
+
296
+ add_library(ffmpeg4 INTERFACE)
297
+ add_library(ffmpeg5 INTERFACE)
298
+ add_library(ffmpeg6 INTERFACE)
299
+ add_library(ffmpeg7 INTERFACE)
300
+ add_library(ffmpeg8 INTERFACE)
301
+
302
+ # Note: the f?_SOURCE_DIR variables were set by FetchContent_MakeAvailable
303
+ target_include_directories(ffmpeg4 INTERFACE ${f4_SOURCE_DIR}/include)
304
+ target_include_directories(ffmpeg5 INTERFACE ${f5_SOURCE_DIR}/include)
305
+ target_include_directories(ffmpeg6 INTERFACE ${f6_SOURCE_DIR}/include)
306
+ target_include_directories(ffmpeg7 INTERFACE ${f7_SOURCE_DIR}/include)
307
+ target_include_directories(ffmpeg8 INTERFACE ${f8_SOURCE_DIR}/include)
308
+
309
+
310
+ list(
311
+ TRANSFORM f4_library_file_names
312
+ PREPEND ${f4_SOURCE_DIR}/${lib_dir}/
313
+ OUTPUT_VARIABLE f4_library_paths
314
+ )
315
+ list(
316
+ TRANSFORM f5_library_file_names
317
+ PREPEND ${f5_SOURCE_DIR}/${lib_dir}/
318
+ OUTPUT_VARIABLE f5_library_paths
319
+ )
320
+ list(
321
+ TRANSFORM f6_library_file_names
322
+ PREPEND ${f6_SOURCE_DIR}/${lib_dir}/
323
+ OUTPUT_VARIABLE f6_library_paths
324
+ )
325
+ list(
326
+ TRANSFORM f7_library_file_names
327
+ PREPEND ${f7_SOURCE_DIR}/${lib_dir}/
328
+ OUTPUT_VARIABLE f7_library_paths
329
+ )
330
+ list(
331
+ TRANSFORM f8_library_file_names
332
+ PREPEND ${f8_SOURCE_DIR}/${lib_dir}/
333
+ OUTPUT_VARIABLE f8_library_paths
334
+ )
335
+
336
+ target_link_libraries(
337
+ ffmpeg4
338
+ INTERFACE
339
+ ${f4_library_paths}
340
+ )
341
+ target_link_libraries(
342
+ ffmpeg5
343
+ INTERFACE
344
+ ${f5_library_paths}
345
+ )
346
+ target_link_libraries(
347
+ ffmpeg6
348
+ INTERFACE
349
+ ${f6_library_paths}
350
+ )
351
+ target_link_libraries(
352
+ ffmpeg7
353
+ INTERFACE
354
+ ${f7_library_paths}
355
+ )
356
+ target_link_libraries(
357
+ ffmpeg8
358
+ INTERFACE
359
+ ${f8_library_paths}
360
+ )