X-Git-Url: https://code.delx.au/transcoding/blobdiff_plain/d0f9f681128690bd70b4db38291686250ec50a79..b0c2d4418346c184c767022c5d7eb3573c83f621:/hencode diff --git a/hencode b/hencode index efe68aa..234608d 100755 --- a/hencode +++ b/hencode @@ -5,23 +5,33 @@ set -eu THIS_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" PAL24FPS=0 +AUDIO_SELECT="--audio-lang-list eng" +QUALITY="--quality 20" ARGS=( "$@" ) for i in $(seq 0 "$(($# - 1))"); do case "${ARGS[$i]}" in --output|-o) OUTPUTFILE="${ARGS[$i+1]}" - continue + ;; + --audio|--audio-lang-list) + AUDIO_SELECT="" ;; --pal24fps) PAL24FPS=1 AENCODER="copy" - ARGS+=("--rate" "25") + ARGS+=("--cfr" "--rate" "25") + unset "ARGS[$i]" + ;; + --quality) + QUALITY="" + ;; + --vb) + QUALITY="" ;; *) - continue + ;; esac - unset "ARGS[$i]" done set -- "${ARGS[@]}" @@ -29,14 +39,18 @@ set -x HandBrakeCLI \ - --encoder x264 --x264-preset slow --quality 20 --loose-anamorphic \ + --encoder x264 --x264-preset slow \ + $QUALITY \ + --loose-anamorphic \ --aencoder "${AENCODER:-fdk_aac}" --mixdown 7point1 --aq 3 \ + $AUDIO_SELECT \ --subtitle scan --subtitle-forced \ --markers \ "$@" -if [ -n "$PAL24FPS" ]; then +if [ "$PAL24FPS" -eq 1 ]; then mv "$OUTPUTFILE" "pal25fps $OUTPUTFILE" "${THIS_DIR}/fix-pal-speedup" "pal25fps $OUTPUTFILE" "$OUTPUTFILE" + rm "pal25fps $OUTPUTFILE" fi