How to create a video DVD with command line tools
Maybe you know this scenario: You’ve been invited to a family get-together and you take some videos of the most memorable events. Afterwards a family member comes to you and says: “I’ve seen you recording this and that. Could you give it to me on DVD?”. As a matter of fact, you can easily create a video DVD of any video you have recorded with just a view command lines.
In this article I will describe the actions to be taken to create a video DVD that contains only a single title with just one video, no menus, no chapters, no extras. If you want to add chapters, menus or more titles please refer to the dvdauthor man page.
Assuming you have recorded the video with your mobile phone, the first step is to transfer the video to your PC. You can do that with a USB cable, via WLAN or Bluetooth, depending on your mobile phone. Let’s say your recorded video is called “my_recorded_video.mp4”. The next step is to transcode the video to DVD conform MPEG2. Lucky for us, ffmpeg has presets to set all important values for us.
To transcode the video to video DVD compatible MPEG2 and AC3, type
$ ffmpeg -i my_recorded_video.mp4 -target pal-dvd -aspect 16:9 my_dvd_video.mpg
If you need NTSC standard, please replace “pal-dvd” with “ntsc-dvd”. Also, if your video is in 4:3 format instead of 16:9, replace the aspect ratio accordingly.
Next you need to add the MPEG2 video to a DVD folder that contains the “VIDEO_TS” and “AUDIO_TS” folders needed for a standard compliant video DVD. There is a tool called dvdauthor which does this job. It is used as the backend tool for many GUI DVD building tools.
$ dvdauthor -o my_dvd/ -t my_dvd_video.mpg
The -o option specifies the output folder and -t adds a title to the DVD in that folder. You can add multiple titles with this command. It might be that dvdauthor outputs some warnings during the authoring process, but you can ignore them.
Before we finalize the DVD we need to set the video format. In this case we will use the PAL standard. If your video and TV standard are NTSC, please replace it accordingly. Since I have found no working way to set the video standard using command line options of dvdauthor we will set an environment variable which will be read by dvdauthor when it finalizes the DVD.
$ export VIDEO_FORMAT=PAL
Now we finalize the DVD with the -T option
$ dvdauthor -o my_dvd/ -T
Congratulations, your video DVD is basically done now. To make backing up and burning the DVD easier, we will now create an ISO image of the DVD folder. Therefore we need a tool called genisoimage which can be installed from your distribution’s software repository.
$ genisoimage -dvd-video -V MY_DVD_NAME -o my_dvd.iso my_dvd/
The -dvd-video option tells the program to create a standard compatible video dvd. The disk’s label can be set with -V. -o specifies the output file, the last option is the folder to create the image from. When genisoimage is done, you can test your video DVD image by opening it directly with VLC media player.
The last step is to burn the ISO image to a DVD. DO NOT ATTEMPT TO dd IT TO A DVD RW DEVICE. I have tried this and failed many times. To burn optical media from the command line use growisofs, a tool that you can also find in your distribution’s software repository.
$ growisofs -dvdcompat -Z /dev/dvdrw=my_dvd.iso
The option -dvdcompat makes the resulting DVD compatible to video DVD standard, -Z specifies the output device, e.g. your optical drive, and input image file. After the DVD is finished, test it with VLC media player and your DVD player, if you have one. If your tests are successful you can give the DVD to the family member who asked for the video.
You can create far more complex video DVDs with menus, multiple titles, chapters and all with dvdauthor. The structure of the DVD is described in an XML file that you can pass to dvdauthor via command line options. Please refer to the man pages for more details.