Last active
February 14, 2018 19:32
-
-
Save colinwilson/db77c82536721f6ea70309b6d601f19e to your computer and use it in GitHub Desktop.
HandBrakeCLI Batch Conversion Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script uses HandBrakeCLI to automatically convert a folder containing video files to H.265 (HEVC). | |
# You need to substitute SRC -- Source folder, DEST -- Destination folder, | |
# PRESET -- Preset name, & PRESET_FILE -- Preset file (json) for your own values | |
SRC="/root/video_in" | |
DEST="/root/video_out" | |
DEST_EXT=mkv | |
HANDBRAKE_CLI=HandBrakeCLI | |
PRESET="HEVC AP" | |
PRESET_FILE="/root/hbap.json" | |
for FILE in "$SRC"/* | |
do | |
filename=$(basename "$FILE") | |
extension=${filename##*.} | |
filename=${filename%.*} | |
$HANDBRAKE_CLI --preset-import-file $PRESET_FILE -Z "$PRESET" -i "$FILE" -o "$DEST"/"$filename".$DEST_EXT | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment