Skip to content

Commit 359ef18

Browse files
author
Daniel Flores
committed
add ffmpeg8 in various locations
1 parent fddf741 commit 359ef18

File tree

4 files changed

+51
-5
lines changed

4 files changed

+51
-5
lines changed

.github/workflows/build_ffmpeg.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
30+
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1", "8.0"]
3131
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
3232
permissions:
3333
id-token: write
@@ -52,7 +52,7 @@ jobs:
5252
strategy:
5353
fail-fast: false
5454
matrix:
55-
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
55+
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1", "8.0"]
5656
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
5757
with:
5858
job-name: Build
@@ -75,7 +75,7 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
78+
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1", "8.0"]
7979
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
8080
with:
8181
job-name: Build

packaging/build_ffmpeg.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ if [[ "$(uname)" == Darwin ]]; then
104104
avfilter=libavfilter.10
105105
swscale=libswscale.8
106106
swresample=libswresample.5
107+
elif [[ ${major_ver} == 8 ]]; then
108+
avutil=libavutil.60
109+
avcodec=libavcodec.62
110+
avformat=libavformat.62
111+
avdevice=libavdevice.62
112+
avfilter=libavfilter.11
113+
swscale=libswscale.9
114+
swresample=libswresample.6
107115
else
108116
printf "Error: unexpected FFmpeg major version: %s\n" ${major_ver}
109117
exit 1;

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: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ if (LINUX)
8484
libswscale.so.8
8585
libswresample.so.5
8686
)
87+
set(
88+
f8_library_file_names
89+
libavutil.so.60
90+
libavcodec.so.62
91+
libavformat.so.62
92+
libavdevice.so.62
93+
libavfilter.so.11
94+
libswscale.so.9
95+
libswresample.so.6
96+
)
8797
elseif (APPLE)
8898
set(lib_dir "lib")
8999
set(
@@ -147,6 +157,16 @@ elseif (APPLE)
147157
libswscale.8.dylib
148158
libswresample.5.dylib
149159
)
160+
set(
161+
f8_library_file_names
162+
libavutil.60.dylib
163+
libavcodec.62.dylib
164+
libavformat.62.dylib
165+
libavdevice.62.dylib
166+
libavfilter.11.dylib
167+
libswscale.9.dylib
168+
libswresample.6.dylib
169+
)
150170

151171
elseif (WIN32)
152172
set(lib_dir "bin")
@@ -211,6 +231,16 @@ elseif (WIN32)
211231
swscale.lib
212232
swresample.lib
213233
)
234+
set(
235+
f8_library_file_names
236+
avutil.lib
237+
avcodec.lib
238+
avformat.lib
239+
avdevice.lib
240+
avfilter.lib
241+
swscale.lib
242+
swresample.lib
243+
)
214244
else()
215245
message(
216246
FATAL_ERROR
@@ -242,13 +272,20 @@ FetchContent_Declare(
242272
URL_HASH
243273
SHA256=${f7_sha256}
244274
)
275+
FetchContent_Declare(
276+
f8
277+
URL ${platform_url}/8.0.tar.gz
278+
URL_HASH
279+
SHA256=${f8_sha256}
280+
)
245281

246-
FetchContent_MakeAvailable(f4 f5 f6 f7)
282+
FetchContent_MakeAvailable(f4 f5 f6 f7 f8)
247283

248284
add_library(ffmpeg4 INTERFACE)
249285
add_library(ffmpeg5 INTERFACE)
250286
add_library(ffmpeg6 INTERFACE)
251287
add_library(ffmpeg7 INTERFACE)
288+
add_library(ffmpeg8 INTERFACE)
252289

253290
# Note: the f?_SOURCE_DIR variables were set by FetchContent_MakeAvailable
254291
target_include_directories(ffmpeg4 INTERFACE ${f4_SOURCE_DIR}/include)

0 commit comments

Comments
 (0)