torchcodec 0.7.0__cp311-cp311-win_amd64.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 (67) hide show
  1. torchcodec/__init__.py +16 -0
  2. torchcodec/_core/AVIOContextHolder.cpp +60 -0
  3. torchcodec/_core/AVIOContextHolder.h +64 -0
  4. torchcodec/_core/AVIOFileLikeContext.cpp +98 -0
  5. torchcodec/_core/AVIOFileLikeContext.h +55 -0
  6. torchcodec/_core/AVIOTensorContext.cpp +123 -0
  7. torchcodec/_core/AVIOTensorContext.h +43 -0
  8. torchcodec/_core/CMakeLists.txt +292 -0
  9. torchcodec/_core/Cache.h +138 -0
  10. torchcodec/_core/CpuDeviceInterface.cpp +266 -0
  11. torchcodec/_core/CpuDeviceInterface.h +70 -0
  12. torchcodec/_core/CudaDeviceInterface.cpp +514 -0
  13. torchcodec/_core/CudaDeviceInterface.h +37 -0
  14. torchcodec/_core/DeviceInterface.cpp +79 -0
  15. torchcodec/_core/DeviceInterface.h +67 -0
  16. torchcodec/_core/Encoder.cpp +514 -0
  17. torchcodec/_core/Encoder.h +123 -0
  18. torchcodec/_core/FFMPEGCommon.cpp +421 -0
  19. torchcodec/_core/FFMPEGCommon.h +227 -0
  20. torchcodec/_core/FilterGraph.cpp +142 -0
  21. torchcodec/_core/FilterGraph.h +45 -0
  22. torchcodec/_core/Frame.cpp +32 -0
  23. torchcodec/_core/Frame.h +118 -0
  24. torchcodec/_core/Metadata.h +72 -0
  25. torchcodec/_core/SingleStreamDecoder.cpp +1715 -0
  26. torchcodec/_core/SingleStreamDecoder.h +380 -0
  27. torchcodec/_core/StreamOptions.h +53 -0
  28. torchcodec/_core/ValidationUtils.cpp +35 -0
  29. torchcodec/_core/ValidationUtils.h +21 -0
  30. torchcodec/_core/__init__.py +40 -0
  31. torchcodec/_core/_metadata.py +317 -0
  32. torchcodec/_core/custom_ops.cpp +727 -0
  33. torchcodec/_core/fetch_and_expose_non_gpl_ffmpeg_libs.cmake +300 -0
  34. torchcodec/_core/ops.py +455 -0
  35. torchcodec/_core/pybind_ops.cpp +87 -0
  36. torchcodec/_frame.py +145 -0
  37. torchcodec/_internally_replaced_utils.py +67 -0
  38. torchcodec/_samplers/__init__.py +7 -0
  39. torchcodec/_samplers/video_clip_sampler.py +430 -0
  40. torchcodec/decoders/__init__.py +11 -0
  41. torchcodec/decoders/_audio_decoder.py +177 -0
  42. torchcodec/decoders/_decoder_utils.py +52 -0
  43. torchcodec/decoders/_video_decoder.py +464 -0
  44. torchcodec/encoders/__init__.py +1 -0
  45. torchcodec/encoders/_audio_encoder.py +150 -0
  46. torchcodec/libtorchcodec_core4.dll +0 -0
  47. torchcodec/libtorchcodec_core5.dll +0 -0
  48. torchcodec/libtorchcodec_core6.dll +0 -0
  49. torchcodec/libtorchcodec_core7.dll +0 -0
  50. torchcodec/libtorchcodec_custom_ops4.dll +0 -0
  51. torchcodec/libtorchcodec_custom_ops5.dll +0 -0
  52. torchcodec/libtorchcodec_custom_ops6.dll +0 -0
  53. torchcodec/libtorchcodec_custom_ops7.dll +0 -0
  54. torchcodec/libtorchcodec_pybind_ops4.pyd +0 -0
  55. torchcodec/libtorchcodec_pybind_ops5.pyd +0 -0
  56. torchcodec/libtorchcodec_pybind_ops6.pyd +0 -0
  57. torchcodec/libtorchcodec_pybind_ops7.pyd +0 -0
  58. torchcodec/samplers/__init__.py +2 -0
  59. torchcodec/samplers/_common.py +84 -0
  60. torchcodec/samplers/_index_based.py +287 -0
  61. torchcodec/samplers/_time_based.py +350 -0
  62. torchcodec/version.py +2 -0
  63. torchcodec-0.7.0.dist-info/METADATA +242 -0
  64. torchcodec-0.7.0.dist-info/RECORD +67 -0
  65. torchcodec-0.7.0.dist-info/WHEEL +5 -0
  66. torchcodec-0.7.0.dist-info/licenses/LICENSE +28 -0
  67. torchcodec-0.7.0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,300 @@
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
+ f4_library_file_names
49
+ libavutil.so.56
50
+ libavcodec.so.58
51
+ libavformat.so.58
52
+ libavdevice.so.58
53
+ libavfilter.so.7
54
+ libswscale.so.5
55
+ libswresample.so.3
56
+ )
57
+ set(
58
+ f5_library_file_names
59
+ libavutil.so.57
60
+ libavcodec.so.59
61
+ libavformat.so.59
62
+ libavdevice.so.59
63
+ libavfilter.so.8
64
+ libswscale.so.6
65
+ libswresample.so.4
66
+ )
67
+ set(
68
+ f6_library_file_names
69
+ libavutil.so.58
70
+ libavcodec.so.60
71
+ libavformat.so.60
72
+ libavdevice.so.60
73
+ libavfilter.so.9
74
+ libswscale.so.7
75
+ libswresample.so.4
76
+ )
77
+ set(
78
+ f7_library_file_names
79
+ libavutil.so.59
80
+ libavcodec.so.61
81
+ libavformat.so.61
82
+ libavdevice.so.61
83
+ libavfilter.so.10
84
+ libswscale.so.8
85
+ libswresample.so.5
86
+ )
87
+ elseif (APPLE)
88
+ set(lib_dir "lib")
89
+ set(
90
+ platform_url
91
+ ${base_url}/macos_arm64
92
+ )
93
+ set(
94
+ f4_sha256
95
+ f0335434529d9e19359eae0fe912dd9e747667534a1c92e662f5219a55dfad8c
96
+ )
97
+ set(
98
+ f5_sha256
99
+ cfc3449c9af6863731a431ce89e32c08c5f8ece94b306fb6b695828502a76166
100
+ )
101
+ set(
102
+ f6_sha256
103
+ ec47b4783c342038e720e33b2fdfa55a9a490afb1cf37a26467733983688647e
104
+ )
105
+ set(
106
+ f7_sha256
107
+ 48a4fc8ce098305cfd4a58f40889249c523ca3c285f66ba704b5bad0e3ada53a
108
+ )
109
+
110
+ set(
111
+ f4_library_file_names
112
+ libavutil.56.dylib
113
+ libavcodec.58.dylib
114
+ libavformat.58.dylib
115
+ libavdevice.58.dylib
116
+ libavfilter.7.dylib
117
+ libswscale.5.dylib
118
+ libswresample.3.dylib
119
+ )
120
+ set(
121
+ f5_library_file_names
122
+ libavutil.57.dylib
123
+ libavcodec.59.dylib
124
+ libavformat.59.dylib
125
+ libavdevice.59.dylib
126
+ libavfilter.8.dylib
127
+ libswscale.6.dylib
128
+ libswresample.4.dylib
129
+ )
130
+ set(
131
+ f6_library_file_names
132
+ libavutil.58.dylib
133
+ libavcodec.60.dylib
134
+ libavformat.60.dylib
135
+ libavdevice.60.dylib
136
+ libavfilter.9.dylib
137
+ libswscale.7.dylib
138
+ libswresample.4.dylib
139
+ )
140
+ set(
141
+ f7_library_file_names
142
+ libavutil.59.dylib
143
+ libavcodec.61.dylib
144
+ libavformat.61.dylib
145
+ libavdevice.61.dylib
146
+ libavfilter.10.dylib
147
+ libswscale.8.dylib
148
+ libswresample.5.dylib
149
+ )
150
+
151
+ elseif (WIN32)
152
+ set(lib_dir "bin")
153
+ set(
154
+ platform_url
155
+ ${base_url}/windows_x86_64
156
+ )
157
+ set(
158
+ f4_sha256
159
+ 270a1aa8892225267e68a7eb87c417931da30dccbf08ee2bde8833e659cab5cb
160
+ )
161
+ set(
162
+ f5_sha256
163
+ b8b2a349a847e56a6da875b066dff1cae53cb8ee7cf5ba9321ec1243dea0cde0
164
+ )
165
+ set(
166
+ f6_sha256
167
+ 5d9f8c76dc55f790fa31d825985e9270bf9e498b8bfec21a0ad3a1feb1fa053a
168
+ )
169
+ set(
170
+ f7_sha256
171
+ ae391ace382330e912793b70b68529ee7c91026d2869b4df7e7c3e7d3656bdd5
172
+ )
173
+
174
+ set(
175
+ f4_library_file_names
176
+ avutil.lib
177
+ avcodec.lib
178
+ avformat.lib
179
+ avdevice.lib
180
+ avfilter.lib
181
+ swscale.lib
182
+ swresample.lib
183
+ )
184
+ set(
185
+ f5_library_file_names
186
+ avutil.lib
187
+ avcodec.lib
188
+ avformat.lib
189
+ avdevice.lib
190
+ avfilter.lib
191
+ swscale.lib
192
+ swresample.lib
193
+ )
194
+ set(
195
+ f6_library_file_names
196
+ avutil.lib
197
+ avcodec.lib
198
+ avformat.lib
199
+ avdevice.lib
200
+ avfilter.lib
201
+ swscale.lib
202
+ swresample.lib
203
+ )
204
+ set(
205
+ f7_library_file_names
206
+ avutil.lib
207
+ avcodec.lib
208
+ avformat.lib
209
+ avdevice.lib
210
+ avfilter.lib
211
+ swscale.lib
212
+ swresample.lib
213
+ )
214
+ else()
215
+ message(
216
+ FATAL_ERROR
217
+ "Unsupported operating system: ${CMAKE_SYSTEM_NAME}"
218
+ )
219
+ endif()
220
+
221
+ FetchContent_Declare(
222
+ f4
223
+ URL ${platform_url}/4.4.4.tar.gz
224
+ URL_HASH
225
+ SHA256=${f4_sha256}
226
+ )
227
+ FetchContent_Declare(
228
+ f5
229
+ URL ${platform_url}/5.1.4.tar.gz
230
+ URL_HASH
231
+ SHA256=${f5_sha256}
232
+ )
233
+ FetchContent_Declare(
234
+ f6
235
+ URL ${platform_url}/6.1.1.tar.gz
236
+ URL_HASH
237
+ SHA256=${f6_sha256}
238
+ )
239
+ FetchContent_Declare(
240
+ f7
241
+ URL ${platform_url}/7.0.1.tar.gz
242
+ URL_HASH
243
+ SHA256=${f7_sha256}
244
+ )
245
+
246
+ FetchContent_MakeAvailable(f4 f5 f6 f7)
247
+
248
+ add_library(ffmpeg4 INTERFACE)
249
+ add_library(ffmpeg5 INTERFACE)
250
+ add_library(ffmpeg6 INTERFACE)
251
+ add_library(ffmpeg7 INTERFACE)
252
+
253
+ # Note: the f?_SOURCE_DIR variables were set by FetchContent_MakeAvailable
254
+ target_include_directories(ffmpeg4 INTERFACE ${f4_SOURCE_DIR}/include)
255
+ target_include_directories(ffmpeg5 INTERFACE ${f5_SOURCE_DIR}/include)
256
+ target_include_directories(ffmpeg6 INTERFACE ${f6_SOURCE_DIR}/include)
257
+ target_include_directories(ffmpeg7 INTERFACE ${f7_SOURCE_DIR}/include)
258
+
259
+
260
+ list(
261
+ TRANSFORM f4_library_file_names
262
+ PREPEND ${f4_SOURCE_DIR}/${lib_dir}/
263
+ OUTPUT_VARIABLE f4_library_paths
264
+ )
265
+ list(
266
+ TRANSFORM f5_library_file_names
267
+ PREPEND ${f5_SOURCE_DIR}/${lib_dir}/
268
+ OUTPUT_VARIABLE f5_library_paths
269
+ )
270
+ list(
271
+ TRANSFORM f6_library_file_names
272
+ PREPEND ${f6_SOURCE_DIR}/${lib_dir}/
273
+ OUTPUT_VARIABLE f6_library_paths
274
+ )
275
+ list(
276
+ TRANSFORM f7_library_file_names
277
+ PREPEND ${f7_SOURCE_DIR}/${lib_dir}/
278
+ OUTPUT_VARIABLE f7_library_paths
279
+ )
280
+
281
+ target_link_libraries(
282
+ ffmpeg4
283
+ INTERFACE
284
+ ${f4_library_paths}
285
+ )
286
+ target_link_libraries(
287
+ ffmpeg5
288
+ INTERFACE
289
+ ${f5_library_paths}
290
+ )
291
+ target_link_libraries(
292
+ ffmpeg6
293
+ INTERFACE
294
+ ${f6_library_paths}
295
+ )
296
+ target_link_libraries(
297
+ ffmpeg7
298
+ INTERFACE
299
+ ${f7_library_paths}
300
+ )