From 11adb1de87bb5e0bf82158be675e2b86fffc5126 Mon Sep 17 00:00:00 2001 From: use Date: Mon, 20 Nov 2023 00:20:40 -0800 Subject: [PATCH] Update to av1 --- findVideos.sh | 6 ++++-- transcode.sh | 11 +++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/findVideos.sh b/findVideos.sh index b43ddbc..a32a0b2 100644 --- a/findVideos.sh +++ b/findVideos.sh @@ -4,12 +4,14 @@ ffBin="/usr/bin/" parentDir=$1 +destDir="/tmp/transcode/" +mkdir -p "$destDir" while read -r line; do codec="$( $ffBin/ffprobe -loglevel error -select_streams v:0 -show_entries \ stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$line" )" - if [[ $codec == *"264"* ]] + if ! [[ $codec == *"av1"* ]] then - echo "$line" >>/tmp/transcode/list.txt + echo "$line" >>"$destDir/list.txt" fi done<<<"$( find "$parentDir" -name "*.mkv" -print )" diff --git a/transcode.sh b/transcode.sh index 34268a2..9e1e045 100644 --- a/transcode.sh +++ b/transcode.sh @@ -21,9 +21,11 @@ function encode { local outFL=$2 $FFBIN/ffmpeg -hide_banner -loglevel error -stats -re -i "$tmpFL" -map 0 \ -map_metadata 0 -c copy \ - -c:v libx265 -preset slow -x265-params crf=23 \ + -c:v libsvtav1 -crf 28 -g 240 -preset 6 -svtav1-params \ + "enable-overlays=1:\ + tune=0" \ -use_wallclock_as_timestamps 1 \ - -map_chapters 0 -max_muxing_queue_size 9999 "$outFL" + -map_chapters 0 -max_muxing_queue_size 9999 -y "$outFL" } function burnSubs { @@ -38,9 +40,10 @@ function burnSubs { $FFBIN/ffmpeg -hide_banner -loglevel error -stats -i "$inFL" \ -filter_complex "[0:v][0:s:$track]overlay[v]" -map "[v]" \ + -filter_complex_threads 1 \ -map 0:a -c:a copy -map 0:s -map -0:s:$track -c:s copy \ - -map_metadata 0 -map_chapters 0 -max_muxing_queue_size 9999 \ - -t $DURATION "$tmpFL" + -map_metadata 0 -map_chapters 0 -max_muxing_queue_size 4096 \ + -t $DURATION -threads 1 -y "$tmpFL" rm "$inFL" #SAVE SPACE