# Inside DVD-Video/Directory Structure

If you look at a DVD-Video disc on a PC, you will see a common directory structure: at the top level, a directory called VIDEO_TS, and probably also one called AUDIO_TS. The latter will have nothing in it; it is part of the structure of DVD-Audio discs, which never seemed to become very popular, details of which are not publicly-known.
Inside the VIDEO_TS directory, you will see a bunch of files with names ending in .IFO, .BUP and .VOB. The (typically large) .VOB files contain the actual MPEG-format content, while the (much smaller) .IFO (“info”) files contain information about the menu and title structure. The .BUP (“backup”) files are copies of the corresponding .IFO files with the same name, meant to be kept on a physically separate area of the disc, to provide some robustness in the event of physical damage.
Menus and titles in DVD-Video are grouped into domains. There can be one or more titleset domains (VTS), and there will also always be a video manager (VMG) domain. Differences between the two:
* Titlesets can contain both menus and titles, while the VMG can only contain menus.
* VM jump commands in the VMG can directly address menus and titles in any titleset, while those in titlesets can only address menus and titles within the same titleset or the VMG.
The VMG is kept in the files VIDEO_TS.IFO/BUP/VOB, while titleset nn (nn ∊ 01 .. 99) is kept in the files VTS_nn_m.IFO/BUP/VOB. The m part of the name is used to break up long titles to keep each VOB file from becoming too large (it is always 0 for the IFO and BUP files, and for the VOB file containing the menus, if any). If the VMG has no menus or titles, then the file VIDEO_TS.VOB will be absent.

### Example

Example listing of the contents of the VIDEO_TS directory:
Here you can see the VMG and two titlesets (VTS_01_x.xxx and VTS_02_x.xxx). Each titleset has some menu footage (VTS_nn_0.VOB), while the title footage in the second titleset is too big for one VOB file, so it is split into two.

## Physical Layout

Notwithstanding that a DVD has a full filesystem on it, there are still constraints on how files are located in the physical sectors on the disc. This allows players to be simpleminded and be able to play discs without having to decode fully-arbitrary filesystem structures.
First of all, all files must be contiguous. (This is guaranteed by the ISO9660 filesystem.)
Next, their contents must appear in a specific order, with files belonging to the same domain together: VIDEO_TS.xxx first, then (where present) VTS_01_0.IFO, VTS_01_n.VOB, VTS_01_0.BUP, VTS_02_0.IFO, VTS_02_n.VOB, VTS_02_0.BUP ... etc with the n in ascending order. Thus within each domain, the files are ordered thus: first the .IFO, then all the .VOB ones, then the .BUP.
It should be clear from this that the contents of the VIDEO_TS.IFO file will be the physically earliest file data on the disc.
Also, even though there may be multiple VOB files in a titleset, their contents will be physically contiguous and in sequence on the disc. That way, the player can simply determine where the first sector of the first VOB file in a titleset is located, and find the rest of the movie from there, without further reference to the filesystem.
(Ordering information taken from the cdrkit source code, source file genisoimage/udf.c)

## Can a .VOB File Be Played on Its Own?

The question is often asked: can the .VOB files be simply copied out of a DVD-Video disc and played on their own? The answer is “mostly yes”.
A .VOB file is an MPEG file with some additional information. The video is in MPEG format, while the audio might be in MPEG-standard or DVD-Video-specific format. Most video players these days should be able to cope with these just fine.
But there is additional information that doesn’t make sense when the .VOB file is taken on its own out of the containing DVD-Video structure: the menus and other interaction features won’t work, and the colour information for the subtitles comes from the IFO file, so these cannot be displayed in the right colours. But they should still be legible if the player assigns some reasonable default colours (or lets the user choose them). Also the identification of which audio track and/or subtitle track to choose for which language comes from the IFO file, so the player will have to let the user try them all to choose a suitable one.
So, in short, if you just want to treat the .VOB file as an MPEG file and ignore the DVD-Video-specific features, it should mostly work.