MakeDVD Script for turning your Movies into DVD's.
Posted: Mon Jul 18, 2022 9:08 am
Here is my makedvd.sh script for all you film buffs out there who want to
transfer your digital media to dvd.
You can start with downloaded a few essentials:
1. sudo apt-get install ffmpeg
ffmpeg is crucial for transcoding to an mpeg2 format of video suitable to a dvd.
2. sudo apt-get install dvdauthor or find, download, compile and install from src - better
dvdauthor version 7.0 onwards is buggy (This script works with version 6.1)
3. sudo apt-get install mkisofs
mkisofs is used for making a dvd image file iso.
4. sudo apt-get install growisofs
growisofs is like cdrecord and will do the dvd burning
Here is the script:
The script starts by deleting any previously made files.
The first command is ffmpeg:
You can play around with different quality settings using -cr or -q:v but its easier just to
set the scale (here is set to 480p) however depending on how long the movie is you can set it higher
it just needs to be small enough to fit on dvd (usually 4.7 Gb) but has the highest res.
setting
Next we are writing an xml file for dvdauthor to use when creating the dvd. This script produces a minimal xml file to produces a dvd without chapters or a menu. You can edit it to do all of this just
examine the man page for dvdauthor or read the online docs.
The xml has its destination folder - dvd, its video format - PAL and the name of the mpeg video file you just created with ffmpeg.
Finally the two all important dvdauthor commands that will create the dvd file structure are:
The first command creates the DVD in dvd/ folder using the dvdauthor.xml config. Then it fixes the DVD as a title - this makes it ready for making an iso file which we will write to the blank DVD.
Note you need to establish the location of your dvd burner usually its /dev/dvdrw.
And thats it you should now have a DVD in the correct format with a single chapter ready to play on your TV!
transfer your digital media to dvd.
You can start with downloaded a few essentials:
1. sudo apt-get install ffmpeg
ffmpeg is crucial for transcoding to an mpeg2 format of video suitable to a dvd.
2. sudo apt-get install dvdauthor or find, download, compile and install from src - better
dvdauthor version 7.0 onwards is buggy (This script works with version 6.1)
3. sudo apt-get install mkisofs
mkisofs is used for making a dvd image file iso.
4. sudo apt-get install growisofs
growisofs is like cdrecord and will do the dvd burning
Here is the script:
- Code: Select all
#!/bin/bash
rm -rf dvd dvd.iso mydvd.mpg
ffmpeg -i $1 -vf scale=-1:480 -target pal-dvd mydvd.mpg
read -p "Press any key to makedvd ..."
echo "<dvdauthor dest=\"dvd/\">
<vmgm />
<titleset>
<titles>
<video format=\"PAL\" />
<audio lang=\"en\" />
<pgc>
<vob file=\"mydvd.mpg\" />
</pgc>
</titles>
</titleset>
</dvdauthor>" > dvdauthor.xml
dvdauthor -o dvd/ -x dvdauthor.xml
dvdauthor -o dvd/ -T
read -p "Press any key to burn dvd ..."
mkisofs -dvd-video -v -o dvd.iso dvd
growisofs -dvd-compat -speed=4 -use-the-force-luke=bufsize:32m -Z /dev/dvdrw=dvd.iso
The script starts by deleting any previously made files.
The first command is ffmpeg:
- Code: Select all
ffmpeg -i $1 -vf scale=-1:480 -target pal-dvd mydvd.mpg
You can play around with different quality settings using -cr or -q:v but its easier just to
set the scale (here is set to 480p) however depending on how long the movie is you can set it higher
it just needs to be small enough to fit on dvd (usually 4.7 Gb) but has the highest res.
setting
- Code: Select all
-target pal-dvd
- Code: Select all
-target ntsc-dvd
Next we are writing an xml file for dvdauthor to use when creating the dvd. This script produces a minimal xml file to produces a dvd without chapters or a menu. You can edit it to do all of this just
examine the man page for dvdauthor or read the online docs.
- Code: Select all
echo "<dvdauthor dest=\"dvd/\">
<vmgm />
<titleset>
<titles>
<video format=\"PAL\" />
<audio lang=\"en\" />
<pgc>
<vob file=\"mydvd.mpg\" />
</pgc>
</titles>
</titleset>
</dvdauthor>" > dvdauthor.xml
The xml has its destination folder - dvd, its video format - PAL and the name of the mpeg video file you just created with ffmpeg.
Finally the two all important dvdauthor commands that will create the dvd file structure are:
- Code: Select all
dvdauthor -o dvd/ -x dvdauthor.xml
dvdauthor -o dvd/ -T
The first command creates the DVD in dvd/ folder using the dvdauthor.xml config. Then it fixes the DVD as a title - this makes it ready for making an iso file which we will write to the blank DVD.
- Code: Select all
mkisofs -dvd-video -v -o dvd.iso dvd
growisofs -dvd-compat -speed=4 -use-the-force-luke=bufsize:32m -Z /dev/dvdrw=dvd.iso
Note you need to establish the location of your dvd burner usually its /dev/dvdrw.
And thats it you should now have a DVD in the correct format with a single chapter ready to play on your TV!