Make a DVD

I decided that I needed to burn some video files to DVD this weekend, but instead of just firing up K3B and getting the job done, I thought that instead i’d take my time with this and build\modify a script so that I can do it from the command line instead. I managed to find one that had potential but didnt work as it was about 4-5 years old, so ill present the finished script that does.

Before you can run this script you will need a few programs to be installed from the command line first.

Debian/Ubuntu:
apt-get install ffmpeg dvdauthor
Arch:
pacman -Ss ffmpeg dvdauthor

Once that is done you can then create the script file in the folder with the video you want to convert:
touch makeDVD.sh

You can edit this with your editor of choice, but I like nano:
nano makeDVD.sh

then you can cut and paste this into the file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
TEMPFILE=movietemp.mpg
ISONAME=$2
export VIDEO_FORMAT=PAL
ffmpeg -i "$1" -target pal-dvd -qscale 0 $TEMPFILE
mkdir DVD
dvdauthor --title -f $TEMPFILE -o DVD
dvdauthor -T -o DVD
# Navigate to folder containing VIDEO_TS
cd DVD
mkisofs -v -dvd-video -o $ISONAME .
echo 'Burn disc now, 1 for true 0 for false? '
read boole
if [ $boole -eq 1 ]; then
growisofs -dvd-compat -Z /dev/sr0=$ISONAME
else
exit
fi

Environment Variable

Above you will notice the line stating
export VIDEO_FORMAT=PAL

This is here because mkisofs will fail if it is not set to either PAL or NSTC

Running the script

Before you can run the script you will want to make it executable, you can do this by entering the following command:
chmod +x makeDVD.sh

Download

You can downoad the script here

Usage

To use this script you will use the following format:
./makeDVD.sh sourceVideo.avi resultingISO.iso