How to create a video DVD from the command line
It is very easy to create a video DVD out of your existing video files, using only command line tools.
Universal solution using ffmpeg
The original video files can be in any format that ffmpeg supports, so that includes just about everything.
The tools you will need for this are ffmpeg and dvdauthor, so make sure you have them first (run as root):
slapt-get -i ffmpeg dvdauthor
Using ffmpeg you can convert any video file to an mpg file, that dvdauthor can use later:
ffmpeg -i video.avi -aspect 16:9 -target pal-dvd dvd.mpg
You might want to change the aspect ratio to 4:3 or the target to ntsc-dvd, depending on your preferences and region.
Now add the mpg file to your project using dvdauthor:
dvdauthor -o dvd/ -t dvd.mpg
You can convert and add any number of files this way. After you've added all of them, run:
VIDEO_FORMAT=PAL dvdauthor -o dvd/ -T
You might want to set VIDEO_FORMAT=NTSC instead.
And then you can create an iso with mkisofs:
mkisofs -dvd-video -o dvd.iso dvd/
which you can burn to a DVD disc with any DVD burning software. cdrecord from the command line will do just fine.
Advanced usage of dvdauthor
One can generate an XML file in order to define loops, pauses or create chapters, once the file is ready the usage is as follows:
dvdauthor -x dvd.xml -o dvd/
Mencoder as alternative to ffmpeg
If ffmpeg fails to convert properly one can use mencoder (PAL version)
mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd \ -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \ -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=2400:keyint=15:aspect=16/9:acodec=ac3:abitrate=192 \ -ofps 25 -o output-filename source-filename
What can be adjusted here is:
- vbitrate - up to 9800
- aspect - 16/9 or 4/3
Detailed description of DVD authoring with mencoder
one can use all filters available for mplayer, i.e. deinterlace (several methods for this):
-vf pullup,softskip,scale=720:576,harddup
or
-vf pp=fd,scale=720:576,harddup
or crop the image by modifying the line
-vf crop=720:470:0:50,scale=720:576,harddup