From 0e4c12594f1c747ae382d6f711d45529b75af909 Mon Sep 17 00:00:00 2001 From: rbeck4 Date: Mon, 22 Mar 2021 19:53:48 -0700 Subject: [PATCH] Logic for determine foreign audio now actually will work when foreign audio present, and doesn't just pass all through. --- transcode.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/transcode.sh b/transcode.sh index f45b343..bd53838 100644 --- a/transcode.sh +++ b/transcode.sh @@ -178,16 +178,17 @@ do done unset SUBTITLEINDEX SUBTITLEINDEX=$(expr $minINDEX - ${streamNUMBERS[0]}) - #TEST FRAMES IN SUB TRACK, IF < 50% MAX MOST LIKELY ISN'T FOR. AUD. + #TEST FRAMES IN SUB TRACK, IF < 15% MAX MOST LIKELY ISN'T FOR. AUD. + #15% as LOTR dir. comm included, blows up the max number for them... currFrames=$( ffprobe -loglevel error -select_streams s:$SUBTITLEINDEX \ -show_entries stream_tags=NUMBER_OF_FRAMES-eng -of csv=p=0 \ "$tmpDIR/$fileNAME") - if [ $( echo "($currFrames / $maxFrames) < 0.50"|bc -l ) ] + if [ $( echo "($currFrames / $maxFrames) < 0.15"|bc -l ) -gt 0 ] then echo "BURNING STREAM $SUBTITLEINDEX (STREAM $minINDEX) from $fileNAME" burnSubs "$tmpDIR/$fileNAME" "$tmpDIR/TMP$fileNAME" "$workDIR/$fileNAME" $SUBTITLEINDEX else - echo "MIN. SUB TRACK ($SUBTITLEINDEX [$minINDEX])) DUR. > 50% FILM, NOT BURNING" + echo "MIN. SUB TRACK ($SUBTITLEINDEX [$minINDEX])) DUR. > 15% FILM, NOT BURNING" encode "$tmpDIR/$fileNAME" "$workDIR/$fileNAME" fi