Skip to content

Commit

Permalink
Install FFmpeg from package sources
Browse files Browse the repository at this point in the history
The static builds are not compatible w/ Debian 12
  • Loading branch information
andreas-venturini committed Jan 4, 2024
1 parent 30ca939 commit 6ee7b40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 59 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ The latest stable version of wkhtmltopdf is installed from https://github.com/wk

### FFmpeg

We use static builds from https://johnvansickle.com/ffmpeg/. The latest built from git master is installed.
The latest official ffmpeg package for Debian is istalled <https://packages.debian.org/bookworm/ffmpeg>
61 changes: 3 additions & 58 deletions scripts/install-ffmpeg
Original file line number Diff line number Diff line change
@@ -1,59 +1,4 @@
#!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir> <env-dir>
#!/bin/bash
set -xeo pipefail

# adapted from https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest/blob/master/bin/compile

header() {
echo "" || true
echo "-----> $*" || true
}

output() {
while IFS= read -r LINE; do
# do not indent headers that are being piped through the output
if [[ "$LINE" =~ ^-----\>.* ]]; then
echo "$LINE" || true
else
echo " $LINE" || true
fi
done
}

header "Installing ffmpeg"

BUILD_DIR=${1:-}
FFMPEG_ARCHIVE_NAME="ffmpeg.tar.xz"

cd $BUILD_DIR
mkdir -p ffmpeg
cd ffmpeg

# if [[ -z $FFMPEG_DOWNLOAD_URL ]]; then
# echo "Variable FFMPEG_DOWNLOAD_URL isn't set, using default value" | output
# FFMPEG_DOWNLOAD_URL="https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
# fi

FFMPEG_DOWNLOAD_URL="https://denkungsart.s3.eu-west-1.amazonaws.com/ffmpeg-git-${TARGETPLATFORM#*/}-static.tar.xz"

echo "Downloading $FFMPEG_DOWNLOAD_URL" | output

code=$(curl "$FFMPEG_DOWNLOAD_URL" -L --silent --fail --retry 5 --retry-max-time 15 -o ./$FFMPEG_ARCHIVE_NAME --write-out "%{http_code}")

if [ "$code" != "200" ]; then
echo "Unable to download ffmpeg: $code" | output && exit 1
fi

echo "Unpacking the archive" | output

tar xJf "./$FFMPEG_ARCHIVE_NAME" --strip-components=1

if [ "$?" != "0" ]; then
echo "Failed to unpack" | output && exit 1
fi

rm $FFMPEG_ARCHIVE_NAME

mv ffprobe /usr/local/bin
mv ffmpeg /usr/local/bin

echo "Installation successful" | output
apt-get install -y ffmpeg

0 comments on commit 6ee7b40

Please sign in to comment.