#!/bin/bash
#
# Create a file SONGS and put song names in order of chapters
# on DVD. Then, run script, it will create mp4 files for each
# songs.

IFS=$'\n'

i=1
for title in $(cat SONGS);
do
	filename=`printf "%02d-$title.mp4" $i`
	HandBrakeCLI -Z "High Profile" -i /dev/dvd -o "$filename" -c $i
	let "i += 1"
done

