Last active
December 11, 2024 13:34
-
-
Save kerkenit/26fb00abb7cc58636d63a59fbe813fe7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Compile and install (or install via Apt) FFmpeg Codecs | |
# Compile and install FFmpeg suite | |
echo "Begining Installation of FFmpeg Suite" | |
#Update APT Repository | |
echo "Updating the APT repository information" | |
apt update | |
#Create Working Directories | |
echo "Setting up working directories to be used during the installation and build process" | |
cd ~ | |
rm -rf ~/ffmpeg_build ~/ffmpeg_sources | |
mkdir ~/ffmpeg_sources | |
mkdir ~/ffmpeg_build | |
#Build Tools | |
echo "Installing various tools and packages, including audio-video codecs, required for building FFmpeg" | |
apt -y install autoconf automake build-essential libass-dev libfreetype6-dev \ | |
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \ | |
libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev ubuntu-restricted-extras libfdk-aac-dev libmp3lame-dev \ | |
libopus-dev yasm nasm gnutls-bin libvpx-dev libx264-dev libx265-dev libnuma-dev libfdk-aac-dev libmp3lame-dev \ | |
libvpx9 libvorbis-dev libopus-dev libtheora-dev libxvidcore-dev libass-dev libwebp-dev librtmp-dev \ | |
x264 x265 ffmpeg | |
echo "Compiling and Installing FFmpeg Codecs" | |
#x264 Codec | |
echo "X264 Codec" | |
cd ~/ffmpeg_sources | |
git clone git://git.videolan.org/x264 | |
cd x264 | |
./configure --host=arm-unknown-linux-gnueabi --enable-shared --disable-opencl | |
make -j$(nproc) | |
make install | |
make clean | |
make distclean | |
echo "Libfdk-aac Codec" | |
cd ~/ffmpeg_sources | |
wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master | |
tar xzvf fdk-aac.tar.gz | |
cd mstorsjo-fdk-aac* | |
autoreconf -fiv | |
./configure --enable-shared | |
make -j$(nproc) | |
make install | |
make clean | |
make distclean | |
#Libvpx Codec | |
echo "Libvpx Codec" | |
cd ~/ffmpeg_sources | |
wget https://github.com/webmproject/libvpx/archive/v1.15.0/libvpx-1.15.0.tar.gz | |
tar xjvf libvpx-1.15.0.tar.gz | |
cd libvpx-1.15.0 | |
PATH="$HOME/bin:$PATH" ./configure --enable-shared --disable-examples --disable-unit-tests | |
PATH="$HOME/bin:$PATH" make -j$(nproc) | |
make install | |
make clean | |
make distclean | |
# FFmpeg Suite | |
echo "Compiling and installing the FFmpeg Suite" | |
cd ~/ffmpeg_sources | |
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 | |
tar xjvf ffmpeg-snapshot.tar.bz2 | |
cd ffmpeg | |
PATH="$HOME/bin:$PATH" ./configure \ | |
--pkg-config-flags="--static" \ | |
--extra-cflags="-fPIC -I$HOME/ffmpeg_build/include" \ | |
--extra-ldflags="-L$HOME/ffmpeg_build/lib" \ | |
--enable-gpl \ | |
--enable-libass \ | |
--enable-libfdk-aac \ | |
--enable-libfreetype \ | |
--enable-libmp3lame \ | |
--enable-libopus \ | |
--enable-libtheora \ | |
--enable-libvorbis \ | |
--enable-libvpx \ | |
--enable-libx264 \ | |
--enable-nonfree \ | |
--enable-pic \ | |
--extra-ldexeflags=-pie \ | |
--enable-shared | |
PATH="$HOME/bin:$PATH" make -j$(nproc) | |
make install | |
make distclean | |
hash -r | |
#Update Shared Library Cache | |
echo "Updating Shared Library Cache" | |
ldconfig | |
echo "FFmpeg and Codec Installation Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment