From 5f13c6624bc5ce46a1c9c9dac2db150d7d5001fa Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 15 Sep 2026 15:57:58 -0700 Subject: [PATCH] pv-test, refactor some and change default recommended codecs. --- rc_shared.sh | 53 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/rc_shared.sh b/rc_shared.sh index fa94631..09a6719 100644 --- a/rc_shared.sh +++ b/rc_shared.sh @@ -782,38 +782,21 @@ function pv-test { read -p "Please provide the filename: " filename_in done - # Persistent Data # - - normalize="" - typeset -u normalize_in - read -p "Would you like to normalize the audio? (Y/n) " normalize_in - if [[ $normalize_in != "N"* && $normalize_in != "F"* ]]; then - normalize="-filter:a dynaudnorm=f=33:g=65:p=0.66:m=33.3" - fi - echo -e " normalize: '$normalize'\n" - - typeset -i size_in - read -p "What display ratio would you like to use? (720) " size_in - if (( $size_in == 0 )); then - size_in=720 - fi - echo -e " size: '$size_in'\n" - # Existing Functions # declare -l pv{,2}="n" typeset -l test_pv{,2} - read -p "Create a test with current 'pv' function? (Y/n) " test_pv - if [[ -z "$test_pv" || "$test_pv" == "y"* ]]; then + read -p "Create a test with current 'pv' function? (y/N) " test_pv + if [[ "$test_pv" == "y"* ]]; then pv="y" echo " great, will run pv" else echo " skipping" fi echo " " - read -p "Create a test with current 'pv2' function? (Y/n) " test_pv2 - if [[ -z "$test_pv2" || "$test_pv2" == "y"* ]]; then + read -p "Create a test with current 'pv2' function? (y/N) " test_pv2 + if [[ "$test_pv2" == "y"* ]]; then pv2="y" echo " great, will run pv2" else @@ -827,13 +810,21 @@ function pv-test { echo -e " * * Loop Settings * * \n" - vcodecs="libx264 libsvtav1 libx265" + typeset -i size_in + read -p "What display ratio would you like to use? (720) " size_in + if (( $size_in == 0 )); then + size_in=720 + fi + echo -e " size: '$size_in'\n" + + vcodecs="libx264 libsvtav1" read -p "Please provide the video codecs to test: [$vcodecs] " test_vcodecs if [[ -n "$test_vcodecs" ]]; then vcodecs="$test_vcodecs" fi echo -e " video codecs: '$vcodecs'\n" + echo "" read -p "Test the video codec's slowest, medium, and fastest presets? (y/N) " test_vpresets if [[ "$test_vpresets" == "y"* ]]; then vpresets="slw med fst" @@ -866,7 +857,7 @@ function pv-test { echo -e " under percentages: '$unders'\n" fi - acodecs="aac libopus" + acodecs="libopus" read -p "Please provide the audio codecs to test: [$acodecs] " test_acodecs if [[ -n "$test_acodecs" ]]; then acodecs="$test_acodecs" @@ -891,6 +882,14 @@ function pv-test { fi echo -e " audio frequencies: '$afreqs'\n" + normalize="" + typeset -u normalize_in + read -p "Would you like to normalize the audio? (Y/n) " normalize_in + if [[ $normalize_in != "N"* && $normalize_in != "F"* ]]; then + normalize="-filter:a dynaudnorm=f=33:g=65:p=0.66:m=33.3" + fi + echo -e " normalize: '$normalize'\n" + exts="mkv" read -p "Please provide the containers to test with: [$exts] " test_exts if [[ -n "$test_exts" ]]; then @@ -994,12 +993,12 @@ function pv-test { declare {o,u}="" if [[ "$over" != "default" ]]; then - o=":overshoot-pct=$over" - ofn="-o$over" + o=":overshoot-pct=${over}" + ofn="-o${over}" fi if [[ "$under" != "default" ]]; then - u=":undershoot-pct=$under" - ufn="-u$under" + u=":undershoot-pct=${under}" + ufn="-u${under}" fi if [[ "$crf" == "default" ]]; then