pv-test, fixes and small enhancements via web.

pv-test, fix pv and pv2 outfile location if path in filename, test defaults for each option by keeping the skip, fix some spacing issues.
This commit is contained in:
me
2026-09-14 10:46:23 -07:00
parent f0e8125109
commit c8b0684433
+12 -12
View File
@@ -771,7 +771,7 @@ alias vta="v2a"
alias pull-audio="v2a" alias pull-audio="v2a"
alias pa="v2a" alias pa="v2a"
# Run all the different codecs, wrappers, bitrates, etc on a file. # Run all the different codecs, wrappers, bitrates, etc on a file.
function pv-test { function pv-test {
## Input ## ## Input ##
@@ -809,25 +809,25 @@ function pv-test {
read -p "Test presets? (y/N) " test_vpresets read -p "Test presets? (y/N) " test_vpresets
if [[ "$test_vpresets" == "y"* ]]; then if [[ "$test_vpresets" == "y"* ]]; then
vpresets="slo fst def" # med vpresets="$vpresets slo fst med"
fi fi
echo " presets: '$vpresets'" echo " presets: '$vpresets'"
read -p "Test CRFs? (y/N) " test_crfs read -p "Test CRFs? (y/N) " test_crfs
if [[ "$test_crfs" == "y"* ]]; then if [[ "$test_crfs" == "y"* ]]; then
crfs="24 26 28 30 32" crfs="$crfs 24 26 28 30 32"
fi fi
echo " CRFs: '$crfs'" echo " CRFs: '$crfs'"
read -p "Test video bitrates? (y/N) " test_vbrs read -p "Test video bitrates? (y/N) " test_vbrs
if [[ "$test_vbrs" == "y"* ]]; then if [[ "$test_vbrs" == "y"* ]]; then
vbrs="1500k 2000k 2500k" vbrs="$vbrs 1500k 2000k 2500k"
fi fi
echo " video bitrates: '$vbrs'" echo " video bitrates: '$vbrs'"
read -p "Test audio bitrates? (y/N) " test_abrs read -p "Test audio bitrates? (y/N) " test_abrs
if [[ "$test_abrs" == "y"* ]]; then if [[ "$test_abrs" == "y"* ]]; then
abrs="128k 192k" abrs="$abrs 128k 192k"
fi fi
echo " audio bitrates: '$abrs'" echo " audio bitrates: '$abrs'"
@@ -839,14 +839,14 @@ function pv-test {
read -p "Create a test with current 'pv' function? (Y/n) " test_pv read -p "Create a test with current 'pv' function? (Y/n) " test_pv
if [[ -z "$test_pv" || "$test_pv" == "y"* ]]; then if [[ -z "$test_pv" || "$test_pv" == "y"* ]]; then
pv="y" pv="y"
echo " great, will do!" echo " great, will run pv"
else else
echo " skipping" echo " skipping"
fi fi
read -p "Create a test with current 'pv2' function? (Y/n) " test_pv2 read -p "Create a test with current 'pv2' function? (Y/n) " test_pv2
if [[ -z "$test_pv2" || "$test_pv2" == "y"* ]]; then if [[ -z "$test_pv2" || "$test_pv2" == "y"* ]]; then
pv2="y" pv2="y"
echo " great, will do!" echo " great, will run pv2"
else else
echo " skipping" echo " skipping"
fi fi
@@ -854,7 +854,7 @@ function pv-test {
# Final Check # # Final Check #
typeset -u okay typeset -u okay
echo " Testing all this with '$filename_in'" echo "Testing all this with '$filename_in'"
read -p "Look okay? (Y/n) " okay read -p "Look okay? (Y/n) " okay
if [[ "$okay" == "N" || "$okay" == "F"* ]]; then if [[ "$okay" == "N" || "$okay" == "F"* ]]; then
echo "* Not okay, aborting." echo "* Not okay, aborting."
@@ -863,11 +863,11 @@ function pv-test {
## Main ## ## Main ##
echo -e "\nHere we go!\n" echo -e "Here we go!\n"
if [[ "$pv" == "y" ]]; then if [[ "$pv" == "y" ]]; then
echo "Starting pv..." echo "Starting pv..."
filename_pv="${filename_in}-pv.mkv" filename_pv="$(basename "${filename_in}-pv.mkv")"
if [[ -e "$filename_pv" ]]; then if [[ -e "$filename_pv" ]]; then
mv -v "$filename_pv" ~/TRASH mv -v "$filename_pv" ~/TRASH
fi fi
@@ -876,7 +876,7 @@ function pv-test {
fi fi
if [[ "$pv2" == "y" ]]; then if [[ "$pv2" == "y" ]]; then
echo "Starting pv2..." echo "Starting pv2..."
filename_pv2="${filename_in}-pv2.mkv" filename_pv2="$(basename "${filename_in}-pv2.mkv")"
if [[ -e "$filename_pv2" ]]; then if [[ -e "$filename_pv2" ]]; then
mv -v "$filename_pv2" ~/TRASH mv -v "$filename_pv2" ~/TRASH
fi fi
@@ -896,7 +896,7 @@ function pv-test {
for ext in $exts; do for ext in $exts; do
preset="" preset=""
if [[ "$vpreset" != "skip" && "$vpreset" != "def" ]]; then if [[ "$vpreset" != "skip" ]]; then
if [[ "$vcodec" == "libsvtav1" ]]; then if [[ "$vcodec" == "libsvtav1" ]]; then
case $vpreset in case $vpreset in
slo) preset="0" ;; slo) preset="0" ;;