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
답글 남기기