VVCEasy/libvvdecffmpeg.sh

74 lines
4.1 KiB
Bash
Raw Normal View History

2023-04-04 12:17:38 +02:00
#!/bin/bash
PREFIX=/usr/local
echo Building FFmpeg VVCEasy Linux version...
sudo apt update && sudo apt upgrade -y && \
sudo apt install build-essential cmake nasm autoconf pkg-config \
python3-setuptools ninja-build python3-pip libtool git wget xxd -y && \
sudo pip3 install meson
clonepull() {
if [ ! -d "$1" ]; then
git clone --depth=1 "$2" "$1"
else
git -C "$1" pull
fi
}
2023-04-04 12:17:38 +02:00
clonepull FFmpeg-VVC https://github.com/MartinEesmaa/FFmpeg-VVC
clonepull vvenc https://github.com/fraunhoferhhi/vvenc
clonepull vvdec https://github.com/fraunhoferhhi/vvdec
clonepull fdk-aac https://github.com/mstorsjo/fdk-aac
clonepull SDL https://github.com/libsdl-org/SDL -b SDL2
clonepull libxml2 https://github.com/gnome/libxml2
clonepull opus https://github.com/xiph/opus
clonepull libjxl https://github.com/libjxl/libjxl
clonepull zimg https://github.com/sekrit-twc/zimg
clonepull soxr https://github.com/chirlu/soxr
clonepull dav1d https://code.videolan.org/videolan/dav1d
clonepull codec2 https://github.com/drowe67/codec2
clonepull vmaf https://github.com/netflix/vmaf
2023-04-04 12:17:38 +02:00
if [ ! -d libjxl ]; then
sed -i 's/-lm/-lm -lstdc++/g' libjxl/lib/jxl/libjxl.pc.in libjxl/lib/threads/libjxl_threads.pc.in
git -C libjxl submodule update --init --recursive --depth 1 --recommend-shallow
fi
if [ ! -d zimg ]; then
git -C zimg submodule update --init --recursive --depth 1
wget https://raw.githubusercontent.com/m-ab-s/mabs-patches/master/zimg/0001-libm_wrapper-define-__CRT__NO_INLINE-before-math.h.patch
git -C zimg apply 0001-libm_wrapper-define-__CRT__NO_INLINE-before-math.h.patch
rm 0001-libm_wrapper-define-__CRT__NO_INLINE-before-math.h.patch
2023-04-04 12:17:38 +02:00
fi
cd vvenc && sudo make install-release install-prefix=$PREFIX disable-lto=1 && \
cd .. && \
cd vvdec && sudo make install-release install-prefix=$PREFIX disable-lto=1 && \
cd .. && \
cd fdk-aac && ./autogen.sh && ./configure --prefix=$PREFIX --enable-static --disable-shared && sudo make install -j $nproc && \
2023-04-04 12:17:38 +02:00
cd .. && \
cd libxml2 && ./autogen.sh && ./configure --prefix=$PREFIX --enable-static --disable-shared && sudo make install -j $nproc && \
2023-04-04 12:17:38 +02:00
cd .. && \
cd opus && ./autogen.sh && CFLAGS="-O2 -D_FORTIFY_SOURCE=0" LDFLAGS="-flto -s" ./configure --prefix=$PREFIX --enable-static --disable-shared && sudo make install -j $nproc && \
2023-04-04 12:17:38 +02:00
cd .. && \
mkdir -p libjxl/build && cd libjxl/build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_ENABLE_PLUGINS=ON -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_FORCE_SYSTEM_BROTLI=ON -DJPEGXL_FORCE_SYSTEM_GTEST=ON -DCMAKE_INSTALL_PREFIX=$PREFIX .. -G Ninja && sudo ninja install && \
2023-04-04 12:17:38 +02:00
cd ../../ && \
mkdir -p vmaf/libvmaf/build && cd vmaf/libvmaf/build && CFLAGS="-msse2 -mfpmath=sse -mstackrealign" meson -Denable_docs=false -Ddefault_library=static -Denable_float=true -Dbuilt_in_models=true -Dprefix=$PREFIX .. && sudo ninja install && \
2023-04-04 12:17:38 +02:00
cd ../../../ && \
sudo sed -i 's/-lm/-lm -lstdc++/g' $PREFIX/lib/x86_64-linux-gnu/pkgconfig/libvmaf.pc && \
cd SDL && mkdir build && cd build && cmake -DCMAKE_EXE_LINKER_FLAGS="-static" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .. && sudo make install -j $nproc && \
cd ../../ && \
cd zimg && ./autogen.sh && ./configure --disable-shared --prefix=$PREFIX && sudo make install -j $nproc && \
cd .. && \
mkdir -p soxr/build && cd soxr/build && cmake -D{WITH_LSR_BINDINGS,BUILD_TESTS,WITH_OPENMP}=off -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -Wno-dev .. && \
sudo cmake --build . -j $nproc --target install && \
cd ../../ && \
mkdir -p dav1d/build && cd dav1d/build && meson -Denable_docs=false -Ddefault_library=static -Dprefix=$PREFIX .. && sudo ninja install && \
2023-04-04 12:17:38 +02:00
cd ../../ && \
cd FFmpeg-VVC && \
./configure --enable-static --pkg-config-flags="--static" --extra-ldexeflags="-static" \
--enable-libfdk-aac --enable-libvvenc --enable-libvvdec --enable-pic \
--enable-libxml2 --enable-libopus --enable-libdav1d --enable-libjxl --enable-libzimg --enable-libvmaf --enable-libsoxr --enable-sdl2 && \
2023-04-04 12:17:38 +02:00
make -j
echo You are ready to preview VVC, view VVC information or convert from VVC using ffmpeg, ffplay and ffprobe.
echo - Martin Eesmaa