Step 1 - Files and Directories

If you want your DVD to be playable in a normal DVD player you need to make sure that you have all the files and directories it is going to look for. In particular you need to have an "AUDIO_TS" and a "VIDEO_TS" directory. This is true even if you are only burning video and therefore have an empty AUDIO_TS directory as some DVD players will not read the disk if either directory is missing. Under the VIDEO_TS directory you need to have valid IFO, VOB and BUP files. A directory listing of the VIDEO_TS directory should look something like this:

ll -a
total 4432968
dr-x------  2 someone group       4096 Aug 11 21:45 .
drwxr-xr-x  4 someone group       4096 Aug 14 18:14 ..
-r--------  1 someone group       8192 Aug 12 02:50 VIDEO_TS.BUP
-r--------  1 someone group       8192 Aug 12 02:50 VIDEO_TS.IFO
-r--------  1 someone group      81920 Aug 12 02:51 VTS_01_0.BUP
-r--------  1 someone group      81920 Aug 12 04:41 VTS_01_0.IFO
-r--------  1 someone group      88064 Aug 12 04:42 VTS_01_0.VOB
-r--------  1 someone group 1073401856 Aug 13 14:07 VTS_01_1.VOB
-r--------  1 someone group 1073467392 Aug 13 13:48 VTS_01_2.VOB
-r--------  1 someone group 1073444864 Aug 13 14:03 VTS_01_3.VOB
-r--------  1 someone group 1073623040 Aug 13 14:07 VTS_01_4.VOB
-r--------  1 someone group  193714176 Aug 13 14:07 VTS_01_5.VOB
-r--------  1 someone group      12288 Aug 13 13:47 VTS_02_0.BUP
-r--------  1 someone group      12288 Aug 13 13:47 VTS_02_0.IFO
-r--------  1 someone group   46927872 Aug 13 14:07 VTS_02_1.VOB

Step 2 - Set File Permissions

I am not sure how important this is but it only takes a moment to do. Make sure all directories have permissions 500 (read and enter for owner) and all files permissions of 400 (read only for owner).

Step 3 - Ordering The Disk

In order to produce a disk that will work in a DVD player you have to make sure the files are physically in the correct order on the written disk. If you just write a disk as you would a data disk it almost certainly wont play in a DVD player but may play on a computer. The reason for this is quite simple. When you insert a disk into a DVD player it scans the first few sectors looking for the file "VIDEO_TS.IFO". This file contains a list of sector offsets to find the title sets on the DVD. Unfortunatly, alphabetically the file "VIDEO_TS.BUP" comes first and therefore most DVD writer software will burn this file first if they are writting a plain data disk. If the DVD player can't find the IFO file or finds another file first it generally gives up.

A computer DVD player on the other hand understands the file system on the disk and can therefore find any file it wants with out having to know the offset values. It is also important that the VOB files are in the correct order as a DVD player just plays the data it finds, ignoring file boundaries, untill it reaches the end. In fact a DVD player doesn't even understand files and only uses sector offsets to find data. The only reason there are multiple VOB files for each title because of a size limitation with the file system. There is quite a good guide to DVD Video data formats here

A correct file order is as follows:

VIDEO_TS.IFO
VIDEO_TS.VOB
VIDEO_TS.BUP
VTS_01_0.IFO
VTS_01_0.VOB
VTS_01_1.VOB
VTS_01_2.VOB
VTS_01_0.BUP
VTS_02_0.IFO
VTS_02_0.VOB
VTS_02_1.VOB
VTS_02_0.BUP

Note the order of the VOB files, the fact that the VIDEO_TS.IFO file comes first and the fact that the BUP files come after the VOB files. This is the layout for a disk that contains two title sets. The number of title sets on a DVD is the same as the highest first number in any of the VTS files. All VTS files follow this naming format VTS_mm_n.<IFO|VOB|BUP> where mm is the title set number, n is a simple sequence number and <IFO|VOB|BUP> is one of the three extensions. You may or may not have a VIDEO_TS.VOB file or VTS_mm_0.VOB files. They are menu video files and are optional.

Controlling the layout of the disk is actually childs play really. Using mkisofs you just give it the -dvd-video flag and it will create the image with the files in the correct order for you. Use a command looking something like this:

mkisofs -dvd-video -o /somewhere/big/myfilm.iso .

I generally navigate to the directory the contains the VIDEO_TS and AUDIO_TS directories hence the . path at the end. Once the image has been made you can check it with this command:

isoinfo -i ep4.iso -l
Directory listing of /
d---------   0    0    0            2048 Aug 14 2004 [    282 02]  .
d---------   0    0    0            2048 Aug 14 2004 [    282 02]  ..
d---------   0    0    0            2048 Aug 14 2004 [    284 02]  AUDIO_TS
d---------   0    0    0            2048 Aug 11 2004 [    283 02]  VIDEO_TS
Directory listing of /AUDIO_TS/
d---------   0    0    0            2048 Aug 14 2004 [    284 02]  .
d---------   0    0    0            2048 Aug 14 2004 [    282 02]  ..
Directory listing of /VIDEO_TS/
d---------   0    0    0            2048 Aug 11 2004 [    283 02]  .
d---------   0    0    0            2048 Aug 14 2004 [    282 02]  ..
----------   0    0    0            8192 Aug 12 2004 [    289 00]  VIDEO_TS.BUP;1
----------   0    0    0            8192 Aug 12 2004 [    285 00]  VIDEO_TS.IFO;1
----------   0    0    0           81920 Aug 12 2004 [2191612 00]  VTS_01_0.BUP;1
----------   0    0    0           81920 Aug 12 2004 [    293 00]  VTS_01_0.IFO;1
----------   0    0    0           88064 Aug 12 2004 [    333 00]  VTS_01_0.VOB;1
----------   0    0    0      1073401856 Aug 13 2004 [    376 00]  VTS_01_1.VOB;1
----------   0    0    0      1073467392 Aug 13 2004 [ 524498 00]  VTS_01_2.VOB;1
----------   0    0    0      1073444864 Aug 13 2004 [1048652 00]  VTS_01_3.VOB;1
----------   0    0    0      1073623040 Aug 13 2004 [1572795 00]  VTS_01_4.VOB;1
----------   0    0    0       193714176 Aug 13 2004 [2097025 00]  VTS_01_5.VOB;1
----------   0    0    0           12288 Aug 13 2004 [2214572 00]  VTS_02_0.BUP;1
----------   0    0    0           12288 Aug 13 2004 [2191652 00]  VTS_02_0.IFO;1
----------   0    0    0        46927872 Aug 13 2004 [2191658 00]  VTS_02_1.VOB;1

At first glace it looks like it has all gone wrong and the files are still in the wrong order but you actually need to look at the numbers in square brackets. Check that the VIDEO_TS.IFO file has the lowest sector number (ignoring directories) and that all the files seem to be in the correct order.

Step 4 - Buring the Image

This is the easiest step. Just fire up k3b and burn the image. When its complete test it in a DVD player.

Notes

Files ending with .img extensions are, the the best of my knowledge, fully ISO9660 compatable.