Skip to content

Commit 9eba3d8

Browse files
author
Markus Perl
committed
FFmpeg 7.1 upgrade
1 parent 7f3c8d5 commit 9eba3d8

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ workspace
44
linux
55
.artifacts
66
build
7+
full-static-test.dockerfile

build-ffmpeg

+24-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# LICENSE: https://github.com/markus-perl/ffmpeg-build-script/blob/master/LICENSE
55

66
PROGNAME=$(basename "$0")
7-
FFMPEG_VERSION=7.0
8-
SCRIPT_VERSION=1.52
7+
FFMPEG_VERSION=7.1
8+
SCRIPT_VERSION=1.53
99
CWD=$(pwd)
1010
PACKAGES="$CWD/packages"
1111
WORKSPACE="$CWD/workspace"
@@ -26,6 +26,7 @@ if [[ ("$(uname -m)" == "arm64") && ("$OSTYPE" == "darwin"*) ]]; then
2626
# If arm64 AND darwin (macOS)
2727
export ARCH=arm64
2828
export MACOSX_DEPLOYMENT_TARGET=11.0
29+
export CXX=$(which clang++)
2930
MACOS_M1=true
3031
fi
3132

@@ -53,7 +54,7 @@ make_dir() {
5354

5455
remove_dir() {
5556
if [ -d "$1" ]; then
56-
rm -r "$1"
57+
rm -rf "$1"
5758
fi
5859
}
5960

@@ -120,7 +121,16 @@ download() {
120121
)
121122
}
122123

124+
print_flags () {
125+
echo "Flags: CFLAGS \"$CFLAGS\", CXXFLAGS \"$CXXFLAGS\", LDFLAGS \"$LDFLAGS\", LDEXEFLAGS \"$LDEXEFLAGS\""
126+
}
127+
123128
execute() {
129+
130+
if [[ "$1" == *configure* ]]; then
131+
print_flags
132+
fi
133+
124134
echo "$ $*"
125135

126136
OUTPUT=$("$@" 2>&1)
@@ -251,7 +261,9 @@ while (($# > 0)); do
251261
echo "Error: A full static binary can only be build on Linux."
252262
exit 1
253263
fi
254-
LDEXEFLAGS="-static"
264+
LDEXEFLAGS="-static -fPIC"
265+
CFLAGS+=" -fPIC"
266+
CXXFLAGS+=" -fPIC"
255267
fi
256268
if [[ "$1" == "--latest" ]]; then
257269
LATEST=true
@@ -339,8 +351,8 @@ fi
339351
if build "pkg-config" "0.29.2"; then
340352
download "https://pkgconfig.freedesktop.org/releases/pkg-config-$CURRENT_PACKAGE_VERSION.tar.gz"
341353
if [[ "$OSTYPE" == "darwin"* ]]; then
342-
export XXFLAGS="-Wno-int-conversion" # pkg-config 0.29.2 has a warning that is treated as an error
343-
export CFLAGS="-Wno-error=int-conversion"
354+
export XXFLAGS +=" -Wno-int-conversion" # pkg-config 0.29.2 has a warning that is treated as an error
355+
export CFLAGS +=" -Wno-error=int-conversion"
344356
fi
345357
execute ./configure --silent --prefix="${WORKSPACE}" --with-pc-path="${WORKSPACE}"/lib/pkgconfig --with-internal-glib
346358
execute make -j $MJOBS
@@ -455,12 +467,15 @@ else
455467
fi
456468
fi
457469

458-
if build "cmake" "3.27.7"; then
470+
if build "cmake" "3.31.0"; then
471+
CXXFLAGS_BACKUP=$CXXFLAGS
472+
export CXXFLAGS+=" -std=c++11"
459473
download "https://github.com/Kitware/CMake/releases/download/v$CURRENT_PACKAGE_VERSION/cmake-$CURRENT_PACKAGE_VERSION.tar.gz"
460474
execute ./configure --prefix="${WORKSPACE}" --parallel="${MJOBS}" -- -DCMAKE_USE_OPENSSL=OFF
461475
execute make -j $MJOBS
462476
execute make install
463477
build_done "cmake" $CURRENT_PACKAGE_VERSION
478+
export CXXFLAGS=$CXXFLAGS_BACKUP
464479
fi
465480

466481
##
@@ -537,6 +552,7 @@ CONFIGURE_OPTIONS+=("--enable-libsvtav1")
537552
if command_exists "cargo"; then
538553
if [[ ! "$SKIPRAV1E" == "yes" ]]; then
539554
if build "rav1e" "0.7.1"; then
555+
echo "if you get the message 'cannot be built because it requires rustc x.xx or newer, try to run 'rustup update'"
540556
execute cargo install cargo-c
541557
download "https://github.com/xiph/rav1e/archive/refs/tags/v$CURRENT_PACKAGE_VERSION.tar.gz"
542558
export RUSTFLAGS="-C target-cpu=native"
@@ -1037,7 +1053,7 @@ fi
10371053
build "ffmpeg" "$FFMPEG_VERSION"
10381054
download "https://github.com/FFmpeg/FFmpeg/archive/refs/heads/release/$FFMPEG_VERSION.tar.gz" "FFmpeg-release-$FFMPEG_VERSION.tar.gz"
10391055
# shellcheck disable=SC2086
1040-
./configure "${CONFIGURE_OPTIONS[@]}" \
1056+
execute ./configure "${CONFIGURE_OPTIONS[@]}" \
10411057
--disable-debug \
10421058
--disable-shared \
10431059
--enable-pthreads \

full-static.dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM ubuntu:22.04 AS build
22

3-
ENV DEBIAN_FRONTEND noninteractive
4-
ENV NVIDIA_VISIBLE_DEVICES all
5-
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV NVIDIA_VISIBLE_DEVICES=all
5+
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
66

77
RUN apt-get update \
88
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates python3 python-is-python3 ninja-build meson \
@@ -21,8 +21,8 @@ RUN ! ldd /app/workspace/bin/ffplay
2121

2222
FROM scratch
2323

24-
ENV NVIDIA_VISIBLE_DEVICES all
25-
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
24+
ENV NVIDIA_VISIBLE_DEVICES=all
25+
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
2626

2727
# Copy ffmpeg
2828
COPY --from=build /app/workspace/bin/ffmpeg /ffmpeg

0 commit comments

Comments
 (0)