Automate DVD burning process

So anyway...i have a junky machine and it may take awhile to burn stuff out onto DVD especially movies. I decided to write a script to do it from anywhere (i can ssh into my home machine and just run the script). It converts AVI files you downloaded / ripped into mpg format for DVD players.
Figured i'd share and see if it helps anyone.
#!/bin/bash
# This script is for automagically burning your DVDs after converting
# them into mpg format from .avi format for viewing on most normal DVD
# players. If you have a DVD player that plays AVI then you don't need
# this script. This supports widescreen / full screen conversion
# and optional 5.1 audio IF the .avi file supports this
# An example of a dvdauthor.xml file is provided, please edit
# as required.
#
# General Syntax: ./DVDburn (Path to AVI file) (2/3 flag for
# widescreen/fullscreen) (0/1 flag for 5.1 audio) (DVD auth file)
#
# flag for Widescreen/FullScreen:
# 2=widescreen
# 3=fullscreen
#
# flag for 5.1 audio
# 0=test for 5.1 and convert with 5.1 support if available
# 1=don't bother with 5.1
#
#Required Tools:
# transcode
# mplayer
# Mjpegtools
# ffmpeg
# dvd+rw-tools
# Dvdauthor
# Tested on Fedora Core 6
# Written by Serinth
MOVIE=$1
FLAG1=$2
FLAG2=$3
DVDAUTHFILE=$4
test()
{
if [[ $? != 0 ]]
then
echo "DVD conversion has failed, exiting."
exit 1
fi
}
transcode -i $MOVIE -y ffmpeg --export_prof dvd-ntsc --export_asr $FLAG1 -o movie -D0 -s2 -m movie.ac3 -J modfps=clonetype=3 --export_fps 29.97
test
if [ $FLAG2 = 0 ]
then
mplayer -vo dummy -identify movie.avi 2> /dev/null | grep "5.1 ("
fi
if [ $? = 0 ]
then
tcextract -d2 -i $MOVIE -a0 -x ac3 | tcextract -d2 -x ac3 -t raw > movie.ac3
test
fi
mplex -f 8 -o dvd_movie.mpg movie.m2v movie.ac3
test
dvdauthor -x $DVDAUTHFILE
test
echo "You should now test the movie to see if it works."
echo ""
echo "Continue with Burning?[y/n] "
read a
if [[ $a = "n" ]]
then
exit 1
fi
growisofs -Z /dev/dvd -dvd-video DVD/
test
echo "Done Burning "$MOVIE""
echo ""
exit 0
Of course in DVD Auth you can customize your own timeframes for the skip section button on your remote ie. << & >>
Sample dvdauthor.xml file:
<dvdauthor dest="DVD">
<vmgm />
<titleset>
<titles>
<pgc>
<vob file="dvd_movie.mpg"
chapters="0,15:00,30:00,45:00,1:00:00"/>
</pgc>
</titles>
</titleset>
</dvdauthor>
Btw my code does have indenting it's just this forum ignores it.
- Login to post comments
