HandBrakeCLI – 폴더 내의 동영상 일괄 변환하기

handbrakecli를 이용해서 폴더 내의 동영상을 미리 정의된 preset을 사용해서 일괄 변환하는 shell script이다. 여러 동영상 파일들을 한번에 h265 hevc 형식으로 일괄 변환하고 싶을 때 퍽 유용하다.

#!/bin/bash
#
# This script requires HandBrakeCLI. On macOS, at least, you need to download
# and install it separately from Handbrake.
#
# See: https://handbrake.fr/downloads2.php

if [ -z "$1" ] ; then
    TRANSCODEDIR="."
else
    TRANSCODEDIR="$1"
fi
    # Change the preset if you like (see options: "HandBrakeCLI --preset-list")
    # If you want to transcode ALL movie files, remove the -name option.
    find "$TRANSCODEDIR"/* -type f -name "*.mp4" -exec bash -c 'HandBrakeCLI -i "$1" -o "${1%\.*}".hevc.mp4 --preset-import-file ~/2hevc.json -Z "2hevc"' __ {} \;

https://www.jeffgeerling.com/blog/2022/batch-transcode-folder-videos-handbrakes-cli

Comments

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다