generated from me/template-mit
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f13c6624b | ||
|
|
13c542b888 |
+48
-50
@@ -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
|
||||
@@ -934,32 +933,32 @@ function pv-test {
|
||||
echo -e " * Testing with 'pv2' complete! * \n"
|
||||
fi
|
||||
|
||||
# TBD - Do multiplication with `wc` rather than a loop here.
|
||||
count=0
|
||||
typeset -i guess
|
||||
guess=$(( \
|
||||
`wc -w <<< $vcodecs` * `wc -w <<< $vpresets` * `wc -w <<< $crfs` \
|
||||
* `wc -w <<< $vbrs` * `wc -w <<< $overs` * `wc -w <<< $unders` \
|
||||
* `wc -w <<< $acodecs` * `wc -w <<< $abrs` \
|
||||
* `wc -w <<< $achannels` * `wc -w <<< $afreqs` \
|
||||
))
|
||||
if (( $guess > 0 )); then
|
||||
plural=""
|
||||
if (( $guess != 1 )); then
|
||||
plural="s"
|
||||
fi
|
||||
echo -e "Expecting ${guess} loop${plural}, please be patient.\n"
|
||||
else
|
||||
echo "ERROR: Something went wrong, got 0 loops, exiting."
|
||||
return 1
|
||||
fi
|
||||
|
||||
typeset -i count
|
||||
unset vcodec vpreset crf vbr acodec abr ext
|
||||
for vcodec in $vcodecs; do for vpreset in $vpresets; do for crf in $crfs; do
|
||||
for vbr in $vbrs; do for over in $overs; do for under in $under; do
|
||||
for vbr in $vbrs; do for over in $overs; do for under in $unders; do
|
||||
for acodec in $acodecs; do for abr in $abrs;
|
||||
do for achannel in $achannels; do for afreq in $afreqs; do
|
||||
for ext in $exts; do
|
||||
(( count++ ))
|
||||
done
|
||||
done done
|
||||
done done
|
||||
done done done
|
||||
done done done
|
||||
plural=""
|
||||
if (( $count != 1 )); then
|
||||
plural="s"
|
||||
fi
|
||||
echo -e "Expecting ${count} loop${plural}, please be patient.\n"
|
||||
|
||||
count=0
|
||||
unset vcodec vpreset crf vbr acodec abr ext
|
||||
for vcodec in $vcodecs; do for vpreset in $vpresets; do for crf in $crfs; do
|
||||
for vbr in $vbrs; do for over in $overs; do for under in $under; do
|
||||
for acodec in $acodecs; do for abr in $abrs;
|
||||
do for achannel in $achannels; do for afreq in $afreqs; do
|
||||
for ext in $exts; do
|
||||
|
||||
preset=""
|
||||
if [[ "$vpreset" != "default" ]]; 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
|
||||
@@ -1048,7 +1047,7 @@ function pv-test {
|
||||
fi
|
||||
|
||||
newfile="_${size_in}p_${vcodec}-${vpreset}-${crf}-${vbr}${ofn}${ufn}_${acodec}-${abr}-${achannel}-${afreq}.${ext}"
|
||||
echo -e " * Parameters for this test: $newfile * \n"
|
||||
echo -e " * [Loop $count/$guess] Parameters for this test: $newfile * \n"
|
||||
|
||||
if [[ -e "$newfile" ]]; then
|
||||
mv -v "$newfile" ~/TRASH/
|
||||
@@ -1092,7 +1091,6 @@ function pv-test {
|
||||
fi
|
||||
|
||||
echo -e "\n * Finished in ${minutes}m${seconds}s! * \n"
|
||||
(( count++ ))
|
||||
done
|
||||
done done
|
||||
done done
|
||||
|
||||
Reference in new issue
Block a user