Changed FFMPEG default verbosity. Only shows progress now.

This commit is contained in:
Luke Renaud 2020-07-19 12:25:26 -07:00
parent 4dff106fdb
commit fa6b057fa4

View file

@ -5,7 +5,7 @@ set -o errexit
################################################################################ ################################################################################
# burnSubs # burnSubs
# version 0.11.3 # version 0.12.0
################# #################
# Wishlist: # Wishlist:
# queue encodes # queue encodes
@ -428,17 +428,21 @@ function extractSubs() {
function doTranscode() { function doTranscode() {
echo "=> Starting transcode:" echo "=> Starting transcode:"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
echo "$FFMPEG" ${FF_HW} -i "${INPUT_VIDEO}" -sn ${LIM_TIME} \ echo "$FFMPEG" ${FF_VERBOSITY} ${FF_HW} -i "${INPUT_VIDEO}" \
-sn ${LIM_TIME} \
-filter:v "${FILT_PFX}ass=${SUBTITLE_FILE}${FILT_SFX}" \ -filter:v "${FILT_PFX}ass=${SUBTITLE_FILE}${FILT_SFX}" \
${FILT_AUDIO} -c:v "${FF_ENC}" ${FF_STD} ${FF_EXT} ${FF_AUDIO} \ ${FILT_AUDIO} \
-c:v "${FF_ENC}" ${FF_STD} ${FF_EXT} ${FF_AUDIO} \
"${OUTPUT_VIDEO}" "${OUTPUT_VIDEO}"
if [[ "$OPTS_DRYRUN" == true ]]; then if [[ "$OPTS_DRYRUN" == true ]]; then
return return
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
"$FFMPEG" ${FF_HW} -i "${INPUT_VIDEO}" -sn ${LIM_TIME} \ "$FFMPEG" ${FF_VERBOSITY} ${FF_HW} -i "${INPUT_VIDEO}" \
-sn ${LIM_TIME} \
-filter:v "${FILT_PFX}ass=${SUBTITLE_FILE}${FILT_SFX}" \ -filter:v "${FILT_PFX}ass=${SUBTITLE_FILE}${FILT_SFX}" \
${FILT_AUDIO} -c:v "${FF_ENC}" ${FF_STD} ${FF_EXT} ${FF_AUDIO} \ ${FILT_AUDIO} \
-c:v "${FF_ENC}" ${FF_STD} ${FF_EXT} ${FF_AUDIO} \
"${OUTPUT_VIDEO}" "${OUTPUT_VIDEO}"
export FINAL_STATUS=$? export FINAL_STATUS=$?
} }
@ -496,6 +500,7 @@ OPTS_DEBUG=false
OPTS_LPF_AUDIO=false OPTS_LPF_AUDIO=false
OPTS_TRANS_AUDIO=false OPTS_TRANS_AUDIO=false
OPTS_derived_NO_OUTPUT=false OPTS_derived_NO_OUTPUT=false
OPTS_VERBOSITY=1
unset OPT_CRF unset OPT_CRF
# this is the --icon flag passed to notify-send at the end of the transcode # this is the --icon flag passed to notify-send at the end of the transcode
NOTIFY_ICON="face-tired" NOTIFY_ICON="face-tired"
@ -515,7 +520,8 @@ FINAL_STATUS=1
###### ######
# Reformat and organize the input strings # Reformat and organize the input strings
OPT_STRING=$(getopt -o 'hkls:a:dt:' --long 'help,psoft,soft,dry,crf:,audio,audiofix,alocale:,slocale:' -- "$@") OPT_STRING=$(getopt -o 'hkls:a:dt:vq' \
--long 'help,psoft,soft,dry,crf:,audio,audiofix,alocale:,slocale:,verbose,quiet' -- "$@")
# reassign them as positional arguments # reassign them as positional arguments
eval set -- "$OPT_STRING" eval set -- "$OPT_STRING"
@ -616,6 +622,22 @@ while true; do
shift shift
continue continue
;; ;;
"--verbose"|"-v")
if [[ ${OPTS_VERBOSITY} -ne 0 ]]; then
OPTS_VERBOSITY=2
echo ">> !! print ffmpeg header."
else
echo ">> !! Ignoring verbosity flag. Quiet takes precidence."
fi
shift
continue
;;
"--quiet"|"-q")
OPTS_VERBOSITY=0
echo ">> !! print ffmpeg header."
shift
continue
;;
"--") "--")
shift # all arguments parsed shift # all arguments parsed
break break
@ -649,6 +671,8 @@ while true; do
-d debug (no cleanup) -d debug (no cleanup)
--dry dry run (no encoding) --dry dry run (no encoding)
-q, --quiet make ffmpeg shutup
-v, --verbose show all FFMPEG details (except that ruddy header)
_EOT _EOT
exit exit
;; ;;
@ -674,6 +698,14 @@ else
exit exit
fi fi
# Actual verbosity parsing
if [[ ${OPTS_VERBOSITY} -le 0 ]]; then
FF_VERBOSITY="-hide_banner -loglevel error"
elif [[ ${OPTS_VERBOSITY} -eq 1 ]]; then
FF_VERBOSITY="-hide_banner -loglevel error -stats"
else # ie [[ ${OPTS_VERBOSITY} -ge 2 ]]; then
FF_VERBOSITY="-hide_banner"
fi
############### ###############
# Configure the encoder based upon the hostname # Configure the encoder based upon the hostname
machineSetup machineSetup