Ubuntu22.04 FFmpeg + AviSynth + JoinLogoScp + delogo でSVT-AV1対応自動CMカットエンコード環境構築
avisynth+ のインストール
# apt update # apt install build-essential cmake git ninja-build checkinstall # cd /usr/local/src # git clone --depth 1 -b v3.7.2 https://github.com/AviSynth/AviSynthPlus.git # cd AviSynthPlus # mkdir avisynth-build # cd avisynth-build # cmake ../ -G Ninja # ninja # checkinstall --pkgname=avisynth --pkgversion="$(grep -r \ Version avs_core/avisynth.pc | cut -f2 -d " ")-$(date --rfc-3339=date | \ sed 's/-//g')-git" --backup=no --deldoc=yes --delspec=yes --deldesc=yes \ --strip=yes --stripso=yes --addso=yes --fstrans=no --default ninja install # ldconfig
## libsvtav1のインストール
# cd /usr/local/src # git clone --depth 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git # cd SVT-AV1/Build # cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release # make -j $(nproc) # make install
ffmpeg のインストール
# apt install nasm libfdk-aac-dev libx264-dev libx265-dev # cd /usr/local/src # git clone --depth 1 -b n4.4.2 git://git.ffmpeg.org/ffmpeg.git # cd ffmpeg # ./configure \ --enable-gpl \ --enable-version3 \ --disable-doc \ --disable-debug \ --enable-avisynth \ --enable-libfdk-aac \ --enable-libx264 \ --enable-libx265 \ --enable-libsvtav1 \ --enable-nonfree # make # make install
l-smash のインストール
# cd /usr/local/src # git clone --depth 1 https://github.com/l-smash/l-smash.git # cd l-smash # ./configure --enable-shared # make # make install # ldconfig
l-smash-works のインストール(avisynth で l-smash を使用するためのプラグイン)
# apt install python3-pip # pip3 install meson==0.62.0 # cd /usr/local/src # git clone --depth 1 -b 20210423 https://github.com/HolyWu/L-SMASH-Works.git # cd L-SMASH-Works/AviSynth # LDFLAGS="-Wl,-Bsymbolic" meson build # cd build # ninja -v # ninja install # ldconfig
JoinLogoScpTrialSet for Linux and Avisynth+3.5.x のインストール
https://github.com/tobitti0/JoinLogoScpTrialSetLinux
# cd /usr/local/src # git clone --depth 1 --recursive https://github.com/tobitti0/JoinLogoScpTrialSetLinux.git # cd JoinLogoScpTrialSetLinux/modules/chapter_exe/src/ # make # cp -a chapter_exe /usr/local/bin/. # cd ../../logoframe/src/ # make # cp -a logoframe /usr/local/bin/. # cd ../../join_logo_scp/src/ # make # cp -a join_logo_scp /usr/local/bin/.
join_logo_scp の動作確認
# cd ~ # vi join_temp.avs TSFilePath="GR27_test.ts" LWLibavVideoSource(TSFilePath, repeat=true, dominance=1) AudioDub(last,LWLibavAudioSource(TSFilePath, av_sync=true)) # chapter_exe -v join_temp.avs -oa temp_inscp.txt # logoframe join_temp.avs -logo GR27.lgd -oa temp_inlogo.txt # join_logo_scp -inlogo temp_inlogo.txt -inscp temp_inscp.txt -incmd JL_標準.txt -o temp_join_logo_scp.txt # cat temp_join_logo_scp.txt ※Trim情報が記載されていること
透過性ロゴ フィルタ for AviSynth+ 3.5.x & Linux のインストール
https://github.com/tobitti0/delogo-AviSynthPlus-Linux
# apt install gcc-9 g++-9 # cd /usr/local/src/ # git clone --depth 1 https://github.com/tobitti0/delogo-AviSynthPlus-Linux.git # cd delogo-AviSynthPlus-Linux/src # make CC=gcc-9 CXX=gcc-9 LD=gcc-9 # make install # ldconfig
delogo の動作確認
# cd ~ # vi delogo_temp.avs TSFilePath="GR27_test.ts" LWLibavVideoSource(TSFilePath, repeat=true, dominance=1) AudioDub(last,LWLibavAudioSource(TSFilePath, av_sync=true)) EraseLOGO(logofile="GR27.lgd", interlaced=true) # ffmpeg -f avisynth -i delogo_temp.avs -c:v libsvtav1 -c:a libfdk_aac GR27_test.mp4