generated from me/template-mit
Compare commits
2
Commits
694767abd5
...
5f13c6624b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f13c6624b | ||
|
|
13c542b888 |
+48
-50
@@ -782,38 +782,21 @@ function pv-test {
|
|||||||
read -p "Please provide the filename: " filename_in
|
read -p "Please provide the filename: " filename_in
|
||||||
done
|
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 #
|
# Existing Functions #
|
||||||
|
|
||||||
declare -l pv{,2}="n"
|
declare -l pv{,2}="n"
|
||||||
typeset -l test_pv{,2}
|
typeset -l test_pv{,2}
|
||||||
|
|
||||||
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 [[ "$test_pv" == "y"* ]]; then
|
||||||
pv="y"
|
pv="y"
|
||||||
echo " great, will run pv"
|
echo " great, will run pv"
|
||||||
else
|
else
|
||||||
echo " skipping"
|
echo " skipping"
|
||||||
fi
|
fi
|
||||||
echo " "
|
echo " "
|
||||||
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 [[ "$test_pv2" == "y"* ]]; then
|
||||||
pv2="y"
|
pv2="y"
|
||||||
echo " great, will run pv2"
|
echo " great, will run pv2"
|
||||||
else
|
else
|
||||||
@@ -827,13 +810,21 @@ function pv-test {
|
|||||||
|
|
||||||
echo -e " * * Loop Settings * * \n"
|
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
|
read -p "Please provide the video codecs to test: [$vcodecs] " test_vcodecs
|
||||||
if [[ -n "$test_vcodecs" ]]; then
|
if [[ -n "$test_vcodecs" ]]; then
|
||||||
vcodecs="$test_vcodecs"
|
vcodecs="$test_vcodecs"
|
||||||
fi
|
fi
|
||||||
echo -e " video codecs: '$vcodecs'\n"
|
echo -e " video codecs: '$vcodecs'\n"
|
||||||
|
|
||||||
|
echo ""
|
||||||
read -p "Test the video codec's slowest, medium, and fastest presets? (y/N) " test_vpresets
|
read -p "Test the video codec's slowest, medium, and fastest presets? (y/N) " test_vpresets
|
||||||
if [[ "$test_vpresets" == "y"* ]]; then
|
if [[ "$test_vpresets" == "y"* ]]; then
|
||||||
vpresets="slw med fst"
|
vpresets="slw med fst"
|
||||||
@@ -866,7 +857,7 @@ function pv-test {
|
|||||||
echo -e " under percentages: '$unders'\n"
|
echo -e " under percentages: '$unders'\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
acodecs="aac libopus"
|
acodecs="libopus"
|
||||||
read -p "Please provide the audio codecs to test: [$acodecs] " test_acodecs
|
read -p "Please provide the audio codecs to test: [$acodecs] " test_acodecs
|
||||||
if [[ -n "$test_acodecs" ]]; then
|
if [[ -n "$test_acodecs" ]]; then
|
||||||
acodecs="$test_acodecs"
|
acodecs="$test_acodecs"
|
||||||
@@ -891,6 +882,14 @@ function pv-test {
|
|||||||
fi
|
fi
|
||||||
echo -e " audio frequencies: '$afreqs'\n"
|
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"
|
exts="mkv"
|
||||||
read -p "Please provide the containers to test with: [$exts] " test_exts
|
read -p "Please provide the containers to test with: [$exts] " test_exts
|
||||||
if [[ -n "$test_exts" ]]; then
|
if [[ -n "$test_exts" ]]; then
|
||||||
@@ -934,32 +933,32 @@ function pv-test {
|
|||||||
echo -e " * Testing with 'pv2' complete! * \n"
|
echo -e " * Testing with 'pv2' complete! * \n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TBD - Do multiplication with `wc` rather than a loop here.
|
typeset -i guess
|
||||||
count=0
|
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 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;
|
for acodec in $acodecs; do for abr in $abrs;
|
||||||
do for achannel in $achannels; do for afreq in $afreqs; do
|
do for achannel in $achannels; do for afreq in $afreqs; do
|
||||||
for ext in $exts; do
|
for ext in $exts; do
|
||||||
(( count++ ))
|
(( 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=""
|
preset=""
|
||||||
if [[ "$vpreset" != "default" ]]; then
|
if [[ "$vpreset" != "default" ]]; then
|
||||||
@@ -994,12 +993,12 @@ function pv-test {
|
|||||||
|
|
||||||
declare {o,u}=""
|
declare {o,u}=""
|
||||||
if [[ "$over" != "default" ]]; then
|
if [[ "$over" != "default" ]]; then
|
||||||
o=":overshoot-pct=$over"
|
o=":overshoot-pct=${over}"
|
||||||
ofn="-o$over"
|
ofn="-o${over}"
|
||||||
fi
|
fi
|
||||||
if [[ "$under" != "default" ]]; then
|
if [[ "$under" != "default" ]]; then
|
||||||
u=":undershoot-pct=$under"
|
u=":undershoot-pct=${under}"
|
||||||
ufn="-u$under"
|
ufn="-u${under}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$crf" == "default" ]]; then
|
if [[ "$crf" == "default" ]]; then
|
||||||
@@ -1048,7 +1047,7 @@ function pv-test {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
newfile="_${size_in}p_${vcodec}-${vpreset}-${crf}-${vbr}${ofn}${ufn}_${acodec}-${abr}-${achannel}-${afreq}.${ext}"
|
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
|
if [[ -e "$newfile" ]]; then
|
||||||
mv -v "$newfile" ~/TRASH/
|
mv -v "$newfile" ~/TRASH/
|
||||||
@@ -1092,7 +1091,6 @@ function pv-test {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n * Finished in ${minutes}m${seconds}s! * \n"
|
echo -e "\n * Finished in ${minutes}m${seconds}s! * \n"
|
||||||
(( count++ ))
|
|
||||||
done
|
done
|
||||||
done done
|
done done
|
||||||
done done
|
done done
|
||||||
|
|||||||
Reference in new issue
Block a user