Finalize the new pv2 code including improvements to log output and simpler aliases.

This commit is contained in:
2026-06-30 20:44:36 -07:00
parent 0473f784ce
commit 35d21e4b7a
+44 -22
View File
@@ -431,14 +431,15 @@ function process-video {
passes=1 passes=1
fi fi
pass="" pass=""
if [[ $passes != 1 ]]; then if [[ $passes != 1 || ! -z "$PV_2PASS" ]]; then
passes=2 passes=2
pass="-pass 2" pass="-pass 2"
fi fi
v2="" v2=""
if [[ ! -z "$PV_V2" ]]; then if [[ ! -z "$PV_V2" ]]; then
v2="-preset veryslow -c:a aac -ar 48000" # -profile:v high v2="-crf 18 -preset veryslow -c:a aac -ar 48000"
#-profile:v high - Letting ffmpeg use the default profile.
fi fi
time="" time=""
@@ -446,13 +447,12 @@ function process-video {
time="`which time`" time="`which time`"
fi fi
quiet="-hide_banner -loglevel quiet" quiet="-hide_banner -loglevel warning"
if [[ ! -z "$PV_TIME" && -z "$time" ]]; then if [[ ! -z "$PV_PROGRESS" ]]; then
quiet="" quiet="-hide_banner -loglevel level+info"
fi fi
if [[ ! -z "$PV_VERBOSE" ]]; then
if [[ ! -z "$PV_CBR" ]]; then quiet="-loglevel level+verbose"
video="-crf 18 -preset veryslow"
fi fi
## Main ## ## Main ##
@@ -506,7 +506,9 @@ function process-video {
unset PV_VERTICAL_ASPECT_RATIO unset PV_VERTICAL_ASPECT_RATIO
unset PV_V2 unset PV_V2
unset PV_TIME unset PV_TIME
unset PV_CBR unset PV_PROGRESS
unset PV_VERBOSE
unset PV_2PASS
echo -e "\n`date` - Finished with status '$status'." echo -e "\n`date` - Finished with status '$status'."
return $status return $status
@@ -515,21 +517,41 @@ alias pv="process-video"
alias fn='basename `pwd`' # Folder Name alias fn='basename `pwd`' # Folder Name
alias qpv='pv ./raw/YouCut*.mp4 `fn`.mp4' # Quick Process Video alias qpv='pv ./raw/YouCut*.mp4 `fn`.mp4' # Quick Process Video
alias set-pv-short='export PV_VERTICAL_ASPECT_RATIO="y" ' alias set-pv-vertical='export PV_VERTICAL_ASPECT_RATIO="y" '
alias pvs='set-pv-short; pv '
alias set-pv2='export PV_V2="y" '
alias pv2='set-pv2; pv '
alias pvs2='set-pv-short; set-pv2; pv '
alias set-pv-time='export PV_TIME="y" ' alias set-pv-time='export PV_TIME="y" '
alias tpv='set-tpv; pv ' alias set-pv-progress='export PV_PROGRESS="y" '
alias tpv2='set-tpv; set-pv2; pv '
alias tpvs='set-tpv; set-pv-short; pv '
alias tpvs2='set-tpv; set-pv-short; set-pv2; pv '
alias set-pv-verbose='export PV_VERBOSE="y" ' alias set-pv-verbose='export PV_VERBOSE="y" '
alias set-pv-all="" alias set-pv-2pass='export PV_2PASS="y" '
alias set-pv-v2='export PV_V2="y"; set-pv-2pass '
alias set-pv-vert='set-pv-vertical '
alias set-pv2='set-pv-v2; set-pv-2pass; set-pv-progress '
alias pvs='set-pv-vert; pv '
alias pv2='set-pv2; pv '
alias pv2s='set-pv2; set-pv-vert; pv '
alias pvs2='pv2s '
function set-pv-all {
#export PV_VERTICAL_ASPECT_RATIO="y"
export PV_V2="y"
export PV_TIME="y"
export PV_PROGRESS="y"
export PV_VERBOSE="y"
export PV_2PASS="y"
}
alias set-pv-everything='set-pv-all '
function unset-pv-all {
unset PV_VERTICAL_ASPECT_RATIO
unset PV_V2
unset PV_TIME
unset PV_PROGRESS
unset PV_VERBOSE
unset PV_2PASS
}
alias unset-pv-everything='unset-pv-all '
# Allow converting video to audio and other smaller # Allow converting video to audio and other smaller
# tasks than what process-video is intended to do. # tasks than what process-video is intended to do.