-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_ffmpeg.sh
More file actions
41 lines (31 loc) · 1.07 KB
/
install_ffmpeg.sh
File metadata and controls
41 lines (31 loc) · 1.07 KB
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
40
41
#!/bin/bash
VERSION=7.1
FFMPEG_URL="https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n$VERSION-latest-linux64-gpl-$VERSION.tar.xz"
INSTALL_PATH="/usr/lib/ffmpeg-btbn/"
if [ ! -d $INSTALL_PATH ]; then
mkdir $INSTALL_PATH
fi
# Download FFmpeg build
curl -L -o /tmp/ffmpeg.tar.xz $FFMPEG_URL
# Extract the archive
tar -xvf /tmp/ffmpeg.tar.xz -C /tmp
# Copy binaries to installation path
cp /tmp/ffmpeg-n$VERSION-latest-linux64-gpl-$VERSION/bin/* $INSTALL_PATH
# Clean up temporary files
rm -rf /tmp/ffmpeg-n$VERSION-latest-linux64-gpl-$VERSION
rm /tmp/ffmpeg.tar.xz
# Remove existing symlinks if they exist
if [ -L "/usr/local/bin/ffmpeg" ]; then
rm "/usr/local/bin/ffmpeg"
echo "Symlink /usr/local/bin/ffmpeg removed."
fi
if [ -L "/usr/local/bin/ffprobe" ]; then
rm "/usr/local/bin/ffprobe"
echo "Symlink /usr/local/bin/ffprobe removed."
fi
# Create new symlinks
ln -s $INSTALL_PATH/ffmpeg /usr/local/bin/ffmpeg \
&& ln -s $INSTALL_PATH/ffprobe /usr/local/bin/ffprobe
# Verify installation
ffmpeg -version
echo "FFmpeg installation completed."