X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=mkv2dvd;fp=mkv2dvd;h=cc07c43d613fa0317d1ed2c1e7a5052f44c864a3;hb=aea4af9869a2086c5085afb34a1bd790940c8b7d;hp=0000000000000000000000000000000000000000;hpb=2675e038e4a9ef7bf5cee7ff32a77a6f31799965;p=videoscripts%2F.git diff --git a/mkv2dvd b/mkv2dvd new file mode 100755 index 0000000..cc07c43 --- /dev/null +++ b/mkv2dvd @@ -0,0 +1,39 @@ +#!/bin/bash + +SRC=$1 +NAME="${SRC%.*}" +MPG="${NAME}.mpg" +DVD="${NAME}.dvd" +ISO="${NAME}.iso" + +export VIDEO_FORMAT=NTSC + +if [[ -z $SRC ]] || [[ ! -r $SRC ]]; then + echo "-E- You need to specify a valid src video file as an argument" + exit 1 +fi + +if [[ ! -e "$MPG" ]]; then + echo "-> Converting \"$SRC\" -> \"$MPG\"" + # Convert the SRC video into a DVD compatible mpg2 file + ffmpeg -i "$SRC" -target ntsc-dvd -aspect 16:9 "$MPG" + if [[ $? != 0 ]]; then + echo "-> ffmpeg encountered an error. aborting..." + rm "$MPG" + exit 1; + fi +fi + +echo "-> Creating DVD ISO: $ISO" +# Create an intermediate DVD dir +mkdir -p "$DVD" +# Define the title file +dvdauthor -o "$DVD" -t "$MPG" +# Create a table of contents +dvdauthor -o "$DVD" -T +# Convert the DVD dir into an ISO image +genisoimage -dvd-video -o "$ISO" "$DVD" +# Remove the intermediate DVD dir +rm -rf "$DVD" +# Remove the intermediate MPG file +rm "$MPG"