X-Git-Url: https://code.delx.au/transcoding/blobdiff_plain/27f8d8a21a62bae3af60a3d8372d923540cff6e4..HEAD:/hencode diff --git a/hencode b/hencode index c085ead..a91ae6b 100755 --- a/hencode +++ b/hencode @@ -5,23 +5,37 @@ set -eu THIS_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" PAL24FPS=0 +AUDIO_SELECT="--audio-lang-list eng" +QUALITY="--quality 20" +ANAMORPHIC="--loose-anamorphic" 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="" + ;; + --*-anamorphic) + ANAMORPHIC="" ;; --pal24fps) PAL24FPS=1 AENCODER="copy" ARGS+=("--cfr" "--rate" "25") + unset "ARGS[$i]" + ;; + --quality) + QUALITY="" + ;; + --vb) + QUALITY="" ;; *) - continue + ;; esac - unset "ARGS[$i]" done set -- "${ARGS[@]}" @@ -29,10 +43,12 @@ set -x HandBrakeCLI \ - --encoder x264 --x264-preset slow --quality 20 --loose-anamorphic \ + --encoder x264 --x264-preset slow \ + $QUALITY \ + $ANAMORPHIC \ --aencoder "${AENCODER:-fdk_aac}" --mixdown 7point1 --aq 3 \ - --audio-lang-list eng \ - --subtitle scan --subtitle-forced \ + $AUDIO_SELECT \ + --all-subtitles \ --markers \ "$@"