-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
39 lines (31 loc) · 943 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -eu -o pipefail
# Get essential tools from apt repo
apt -y update
apt install -y --no-install-recommends curl xz-utils
dir_name=ffmpeg
mkdir $dir_name
pushd $dir_name
# Download compiled binaries and perform filehash checking
# TODO: Build a static FFMPEG instead of downloading
xz_name=$(
curl -JOL https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz \
-w "%{filename_effective}" --retry 3 --retry-all-errors
)
md5_name=$(
curl -JOL https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz.md5 \
-w "%{filename_effective}" --retry 3 --retry-all-errors
)
md5sum -c "$md5_name"
# Extract the archive
mkdir $dir_name
tar xvf "$xz_name" -C "$dir_name" --strip-components 1
cd $dir_name
# Move it to PATH
mv ffmpeg /bin/ffmpeg
popd
# Install Python dependencies
python -m venv /opt/venv
PATH=/opt/venv/bin:$PATH
pip install -r requirements.txt --no-cache-dir
exit 0