Skip to content

Commit

Permalink
* Upgrade presets for FFmpeg 7.0 and its dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Apr 20, 2024
1 parent d45473a commit ea4d8b9
Show file tree
Hide file tree
Showing 197 changed files with 2,289 additions and 2,466 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Build FFmpeg with zimg to enable zscale filter ([pull #1481](https://github.com/bytedeco/javacpp-presets/pull/1481))
* Enable PulseAudio support for FFmpeg on Linux ([pull #1472](https://github.com/bytedeco/javacpp-presets/pull/1472))
* Virtualize `btCollisionWorld`, `btOverlapFilterCallback`, `btOverlapCallback` from Bullet Physics SDK ([pull #1475](https://github.com/bytedeco/javacpp-presets/pull/1475))
* Upgrade presets for PyTorch 2.2.2 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466))
* Upgrade presets for FFmpeg 7.0, PyTorch 2.2.2 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466))

### January 29, 2024 version 1.5.10
* Introduce `macosx-arm64` builds for PyTorch ([pull #1463](https://github.com/bytedeco/javacpp-presets/pull/1463))
Expand Down
8 changes: 4 additions & 4 deletions ffmpeg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Introduction
------------
This directory contains the JavaCPP Presets module for:

* FFmpeg 6.1.1 http://ffmpeg.org/
* FFmpeg 7.0 http://ffmpeg.org/

Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.

Expand Down Expand Up @@ -38,22 +38,22 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
<modelVersion>4.0.0</modelVersion>
<groupId>org.bytedeco.ffmpeg</groupId>
<artifactId>readfewframe</artifactId>
<version>1.5.10</version>
<version>1.5.11-SNAPSHOT</version>
<properties>
<exec.mainClass>ReadFewFrame</exec.mainClass>
</properties>
<dependencies>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>6.1.1-1.5.10</version>
<version>7.0-1.5.11-SNAPSHOT</version>
</dependency>

<!-- Optional GPL builds with (almost) everything enabled -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>6.1.1-1.5.10</version>
<version>7.0-1.5.11-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
Expand Down
126 changes: 63 additions & 63 deletions ffmpeg/cppbuild.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ SPEEX=speex-1.2.1
OPUS=opus-1.3.1
OPENCORE_AMR=opencore-amr-0.1.6
VO_AMRWBENC=vo-amrwbenc-0.1.3
OPENSSL=openssl-3.2.0
OPENH264_VERSION=2.4.0
OPENSSL=openssl-3.3.0
OPENH264_VERSION=2.4.1
X264=x264-stable
X265=3.4
VPX_VERSION=1.13.1
ALSA_VERSION=1.2.10
VPX_VERSION=1.14.0
ALSA_VERSION=1.2.11
FREETYPE_VERSION=2.13.2
MFX_VERSION=1.35.1
NVCODEC_VERSION=12.1.14.0
NVCODEC_VERSION=12.2.72.0
XML2=libxml2-2.9.12
LIBSRT_VERSION=1.5.3
WEBP_VERSION=1.3.2
AOMAV1_VERSION=3.8.0
SVTAV1_VERSION=1.8.0
WEBP_VERSION=1.4.0
AOMAV1_VERSION=3.8.2
SVTAV1_VERSION=2.0.0
ZIMG_VERSION=3.0.5
FFMPEG_VERSION=6.1.1
FFMPEG_VERSION=7.0
download https://download.videolan.org/contrib/nasm/nasm-$NASM_VERSION.tar.gz nasm-$NASM_VERSION.tar.gz
download http://zlib.net/$ZLIB.tar.gz $ZLIB.tar.gz
download http://downloads.sourceforge.net/project/lame/lame/3.100/$LAME.tar.gz $LAME.tar.gz
Expand Down Expand Up @@ -139,10 +139,10 @@ case $PLATFORM in
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=arm-linux
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=arm-linux
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -295,10 +295,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=aarch64-linux
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=aarch64-linux
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -450,10 +450,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=i686-linux
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=i686-linux
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -602,10 +602,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=x86_64-linux
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=x86_64-linux
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -749,10 +749,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --host=i686-linux
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=i686-linux
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -898,10 +898,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --host=x86_64-linux
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=x86_64-linux
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -1062,10 +1062,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=arm-linux-gnueabihf
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=arm-linux-gnueabihf
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -1270,10 +1270,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=aarch64-linux-gnu
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=aarch64-linux-gnu
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -1417,14 +1417,14 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
if [[ "$MACHINE_TYPE" =~ ppc64 ]]; then
CC="gcc -m64 -fPIC" ./configure --prefix=$INSTALL_PATH
autoreconf -iv
if [[ "$MACHINE_TYPE" =~ ppc64 ]]; then
CC="gcc -m64 -fPIC" ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic
else
CC="powerpc64le-linux-gnu-gcc -m64 -fPIC" ./configure --prefix=$INSTALL_PATH --host=powerpc64le-linux-gnu
CC="powerpc64le-linux-gnu-gcc -m64 -fPIC" ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=powerpc64le-linux-gnu
fi
make -j $MAKEJ V=0
make install
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -1646,10 +1646,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH --host=aarch64-apple-darwin
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=aarch64-apple-darwin
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -1781,10 +1781,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-shared --with-pic
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -1914,10 +1914,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --build=i686-w64-mingw32
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down Expand Up @@ -2055,10 +2055,10 @@ EOF
echo "--------------------"
echo ""
cd zimg-release-$ZIMG_VERSION
autoreconf -iv
./configure --prefix=$INSTALL_PATH
make -j $MAKEJ V=0
make install
autoreconf -iv
./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --build=x86_64-w64-mingw32
make -j $MAKEJ V=0
make install
echo ""
echo "--------------------"
echo "Building zlib"
Expand Down
31 changes: 17 additions & 14 deletions ffmpeg/ffmpeg.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
--- ffmpeg-6.1/configure 2023-11-11 09:25:17.000000000 +0900
+++ ffmpeg-6.1-patch/configure 2023-11-11 19:18:26.388930944 +0900
@@ -6675,7 +6675,7 @@ enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gn
diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure
--- ffmpeg-7.0/configure 2024-04-05 08:22:59.000000000 +0900
+++ ffmpeg-7.0-patch/configure 2024-04-20 00:59:06.473315424 +0900
@@ -6823,7 +6823,7 @@
enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
enabled ladspa && require_headers "ladspa.h dlfcn.h"
enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
Expand All @@ -10,7 +10,7 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
{ enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
@@ -6701,7 +6701,7 @@ flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lfl
@@ -6851,7 +6851,7 @@
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
enabled fontconfig && enable libfontconfig
enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
Expand All @@ -19,7 +19,7 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
enabled libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create
enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
@@ -6731,15 +6731,7 @@ if enabled libmfx && enabled libvpl; then
@@ -6881,15 +6881,7 @@
# pkg-config support. Instead, users should make sure that the build
# can find the libraries and headers through other means.
elif enabled libmfx; then
Expand All @@ -36,11 +36,11 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
warn "libmfx is deprecated. Please run configure with --enable-libvpl to use libvpl instead."
elif enabled libvpl; then
# Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option
@@ -6766,21 +6758,14 @@ enabled libopencv && { check_headers opencv2/core/core_c.h &&
@@ -6917,21 +6909,14 @@
{ check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
-enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
-enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
+enabled libopenh264 && require libopenh264 wels/codec_api.h WelsGetCodecVersion -lopenh264 $pthreads_extralibs
enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
{ require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
Expand All @@ -59,8 +59,8 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
+enabled libopus && add_cppflags -I ../include/opus/ && require libopus opus_multistream.h opus_multistream_decoder_create -lopus
enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
@@ -6796,9 +6781,9 @@ enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbcli
enabled libqrencode && require_pkg_config libqrencode libqrencode qrencode.h QRcode_encodeString
@@ -6949,9 +6934,9 @@
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
Expand All @@ -73,7 +73,7 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
@@ -6817,19 +6802,15 @@ enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h
@@ -6971,19 +6956,15 @@

enabled libvpx && {
enabled libvpx_vp8_decoder && {
Expand All @@ -93,7 +93,7 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
}
if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
@@ -6838,24 +6819,24 @@ enabled libvpx && {
@@ -6992,27 +6973,27 @@
}

enabled libwebp && {
Expand All @@ -106,15 +106,18 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && {
[ "$toolchain" != "msvc" ] ||
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
check_cpp_condition libx264_hdr10 x264.h "X264_BUILD >= 163" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"
-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
+enabled libx265 && require libx265 x265.h x265_encoder_encode -lx265 $pthreads_extralibs &&
require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
enabled libxevd && require_pkg_config libxevd "xevd >= 0.4.1" "xevd.h" xevd_decode
enabled libxeve && require_pkg_config libxeve "xeve >= 0.4.3" "xeve.h" xeve_encode
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
-enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
+enabled libzimg && require libzimg zimg.h zimg_get_api_version -lzimg -lstdc++
+enabled libzimg && require libzimg zimg.h zimg_get_api_version -lzimg -lstdc++
enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
{ test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
Expand All @@ -124,7 +127,7 @@ diff -ruN ffmpeg-6.1/configure ffmpeg-6.1-patch/configure
enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
@@ -6894,15 +6875,13 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
@@ -7051,15 +7032,13 @@
die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
enable omx
enabled omx && require_headers OMX_Core.h
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/platform/gpl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform-gpl</artifactId>
<version>6.1.1-${project.parent.version}</version>
<version>7.0-${project.parent.version}</version>
<name>JavaCPP Presets Platform for FFmpeg (GPL enabled)</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion ffmpeg/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.bytedeco</groupId>
<artifactId>ffmpeg-platform</artifactId>
<version>6.1.1-${project.parent.version}</version>
<version>7.0-${project.parent.version}</version>
<name>JavaCPP Presets Platform for FFmpeg</name>

<properties>
Expand Down
Loading

0 comments on commit ea4d8b9

Please sign in to comment.