media-sucker/scripts/video.encode.sh

25 lines
435 B
Bash
Executable File

#! /bin/sh -e
. $(dirname $0)/common.sh
title=$(getenv title)
HandBrakeCLI \
--json \
-i DVD/VIDEO_TS \
--main-feature \
--native-language eng \
-Z "Chromecast 1080p30 Surround" \
-o "${title}.mkv" \
2>/dev/null \
| sed 's/^[A-Za-z]*: //' \
| sed '/^[A-Z]/ d' \
| jq --unbuffered '(.Working.Progress // 0) * 100' \
| while read pct; do
setenv complete "$pct"
done
mv "${title}.mkv" "$OUTDIR"
# vi: sw=2 ts=2 et ai