Skip to content

Commit 946d78c

Browse files
author
Daniel Flores
committed
add ffmpeg8 to CI
1 parent 7f96f98 commit 946d78c

File tree

6 files changed

+67
-6
lines changed

6 files changed

+67
-6
lines changed

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
# but for releases we should add 12.8.
7272
cuda-version: ['12.6', '13.0']
7373
# TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
74-
ffmpeg-version-for-tests: ['4.4.2', '6', '7']
74+
ffmpeg-version-for-tests: ['4.4.2', '6', '7', '8.0']
7575

7676
container:
7777
image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"

.github/workflows/linux_wheel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
fail-fast: false
6464
matrix:
6565
python-version: ['3.10']
66-
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
66+
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1', '8.0']
6767
needs: build
6868
steps:
6969
- uses: actions/download-artifact@v4

.github/workflows/macos_wheel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
fail-fast: false
6666
matrix:
6767
python-version: ['3.10']
68-
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
68+
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1', '8.0']
6969
needs: build
7070
steps:
7171
- name: Download wheel

.github/workflows/windows_wheel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
# TODO: FFmpeg 5 on Windows segfaults in avcodec_open2() when passing
7272
# bad parameters.
7373
# See https://github.com/pytorch/torchcodec/pull/806
74-
ffmpeg-version-for-tests: ['4.4.2', '6.1.1', '7.0.1']
74+
ffmpeg-version-for-tests: ['4.4.2', '6.1.1', '7.0.1', '8.0']
7575
needs: build
7676
steps:
7777
- uses: actions/download-artifact@v4

src/torchcodec/_core/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,12 @@ if(DEFINED ENV{BUILD_AGAINST_ALL_FFMPEG_FROM_S3})
263263
you still need a different FFmpeg to be installed for run time!"
264264
)
265265

266-
# This will expose the ffmpeg4, ffmpeg5, ffmpeg6, and ffmpeg7 targets
266+
# This will expose the ffmpeg4, ffmpeg5, ffmpeg6, ffmpeg7, and ffmpeg8 targets
267267
include(
268268
${CMAKE_CURRENT_SOURCE_DIR}/fetch_and_expose_non_gpl_ffmpeg_libs.cmake
269269
)
270270

271+
make_torchcodec_libraries(8 ffmpeg8)
271272
make_torchcodec_libraries(7 ffmpeg7)
272273
make_torchcodec_libraries(6 ffmpeg6)
273274
make_torchcodec_libraries(4 ffmpeg4)

src/torchcodec/_core/fetch_and_expose_non_gpl_ffmpeg_libs.cmake

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ if (LINUX)
4444
f7_sha256
4545
1cb946d8b7c6393c2c3ebe1f900b8de7a2885fe614c45d4ec32c9833084f2f26
4646
)
47+
set(
48+
f8_sha256
49+
c55b3c1a4b5e4d5fdd7c632bea3ab6f45b4e37cc8e0999dda3f84a8ed8defad8
50+
)
4751
set(
4852
f4_library_file_names
4953
libavutil.so.56
@@ -84,6 +88,16 @@ if (LINUX)
8488
libswscale.so.8
8589
libswresample.so.5
8690
)
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+
)
87101
elseif (APPLE)
88102
set(lib_dir "lib")
89103
set(
@@ -106,6 +120,10 @@ elseif (APPLE)
106120
f7_sha256
107121
48a4fc8ce098305cfd4a58f40889249c523ca3c285f66ba704b5bad0e3ada53a
108122
)
123+
set(
124+
f8_sha256
125+
beb936b76f25d2621228a12cdb67c9ae3d1eff7aa713ef8d1167ebf0c25bd5ec
126+
)
109127

110128
set(
111129
f4_library_file_names
@@ -147,6 +165,16 @@ elseif (APPLE)
147165
libswscale.8.dylib
148166
libswresample.5.dylib
149167
)
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+
)
150178

151179
elseif (WIN32)
152180
set(lib_dir "bin")
@@ -170,6 +198,10 @@ elseif (WIN32)
170198
f7_sha256
171199
ae391ace382330e912793b70b68529ee7c91026d2869b4df7e7c3e7d3656bdd5
172200
)
201+
set(
202+
f8_sha256
203+
bac845ac79876b104959cb0e7b9dec772a261116344dd17d2f97e7ddfac4a73f
204+
)
173205

174206
set(
175207
f4_library_file_names
@@ -211,6 +243,16 @@ elseif (WIN32)
211243
swscale.lib
212244
swresample.lib
213245
)
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+
)
214256
else()
215257
message(
216258
FATAL_ERROR
@@ -242,19 +284,27 @@ FetchContent_Declare(
242284
URL_HASH
243285
SHA256=${f7_sha256}
244286
)
287+
FetchContent_Declare(
288+
f8
289+
URL ${platform_url}/8.0.tar.gz
290+
URL_HASH
291+
SHA256=${f8_sha256}
292+
)
245293

246-
FetchContent_MakeAvailable(f4 f5 f6 f7)
294+
FetchContent_MakeAvailable(f4 f5 f6 f7 f8)
247295

248296
add_library(ffmpeg4 INTERFACE)
249297
add_library(ffmpeg5 INTERFACE)
250298
add_library(ffmpeg6 INTERFACE)
251299
add_library(ffmpeg7 INTERFACE)
300+
add_library(ffmpeg8 INTERFACE)
252301

253302
# Note: the f?_SOURCE_DIR variables were set by FetchContent_MakeAvailable
254303
target_include_directories(ffmpeg4 INTERFACE ${f4_SOURCE_DIR}/include)
255304
target_include_directories(ffmpeg5 INTERFACE ${f5_SOURCE_DIR}/include)
256305
target_include_directories(ffmpeg6 INTERFACE ${f6_SOURCE_DIR}/include)
257306
target_include_directories(ffmpeg7 INTERFACE ${f7_SOURCE_DIR}/include)
307+
target_include_directories(ffmpeg8 INTERFACE ${f8_SOURCE_DIR}/include)
258308

259309

260310
list(
@@ -277,6 +327,11 @@ list(
277327
PREPEND ${f7_SOURCE_DIR}/${lib_dir}/
278328
OUTPUT_VARIABLE f7_library_paths
279329
)
330+
list(
331+
TRANSFORM f8_library_file_names
332+
PREPEND ${f8_SOURCE_DIR}/${lib_dir}/
333+
OUTPUT_VARIABLE f8_library_paths
334+
)
280335

281336
target_link_libraries(
282337
ffmpeg4
@@ -298,3 +353,8 @@ target_link_libraries(
298353
INTERFACE
299354
${f7_library_paths}
300355
)
356+
target_link_libraries(
357+
ffmpeg8
358+
INTERFACE
359+
${f8_library_paths}
360+
)

0 commit comments

Comments
 (0)