Created
December 6, 2013 22:11
-
-
Save deckerego/7833016 to your computer and use it in GitHub Desktop.
Transcode a DVD to a movie format suitable for an Nokia n770, splitting the chapters into multiple files.
This file contains hidden or 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/sh | |
OUTPUT_DIRECTORY="$1" | |
if [[ -z "$OUTPUT_DIRECTORY" ]]; then | |
echo "Usage: $0 OUTPUT_DIRECTORY" | |
exit -1 | |
fi | |
mkdir -p "$OUTPUT_DIRECTORY" | |
if [[ ! -d "$OUTPUT_DIRECTORY" ]]; then | |
echo "Could not create directory $OUTPUT_DIRECTORY" | |
exit -2 | |
fi | |
TABLET_ENCODE="/usr/local/tablet-encode/tablet-encode" | |
declare -i CHAPTER=0 | |
EXIT_STATUS=0 | |
while [[ "$EXIT_STATUS" -ne 1 ]]; do | |
$TABLET_ENCODE --mencoder=-chapter --mencoder="$((++CHAPTER))-$CHAPTER" --preset=good dvd:// "$OUTPUT_DIRECTORY/Chapter $CHAPTER.avi" | |
EXIT_STATUS="$?" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment