X-Git-Url: https://code.delx.au/transcoding/blobdiff_plain/d079b4da21343f746fa7102c6b7f39732fd8afd4..HEAD:/hencode diff --git a/hencode b/hencode index 7b1fa87..a91ae6b 100755 --- a/hencode +++ b/hencode @@ -4,22 +4,38 @@ 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+=("--rate" "25") + ARGS+=("--cfr" "--rate" "25") + unset "ARGS[$i]" + ;; + --quality) + QUALITY="" + ;; + --vb) + QUALITY="" ;; *) - continue + ;; esac - unset "ARGS[$i]" done set -- "${ARGS[@]}" @@ -27,14 +43,18 @@ 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 \ - --subtitle scan --subtitle-forced \ + $AUDIO_SELECT \ + --all-subtitles \ --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