The MOD Video File Format

The MOD video file format is used by many standard definition hard-drive and solid-state camcorders. These camcorders create several files, but the actual video and audio streams are stored in files which have the filename suffix ‘.MOD’ – hence the name of the file format.

The MOD file format has been in use for several years, but there is still a certain amount of confusion about what the file format actually is, and whether you need to convert it to another format before it can be imported into some video editing programs. There is also a general misunderstanding about how the video’s display aspect ratio (4:3 or 16:9 widescreen) is stored in the MOD file. This is hopefully all explained in this article.

The MOD file format is not a special format at all. It is an MPEG-2 Program Stream file which complies with the MPEG-2 specification. It also seems to be compliant with the DVD specification. The only thing ‘special’ about MOD files is their filename suffix ‘.MOD’ – in most other respects it is the same as other MPEG-2 Program Stream files.

Some video editing programs may refuse to open or import MOD files just because they do not recognise files with a filename suffix of ‘.MOD’. But if the program supports MPEG-2 Program Stream files, then there should be no reason why it can not also support MOD files. You may just have to rename the filename suffix from .MOD to .MPG which is a more widely recognised file name suffix for MPEG-2 files. In most cases that’s all you have to do to persuade the program that this really is just a standard MPEG-2 file.

There are more details about MOD files in this Wikipedia article.

Display Aspect Ratio Problems in MOD Files

Camcorders that record to MOD files can either record with a display aspect ratio of 4:3 or 16:9 (widescreen). A frequent complaint is that when widescreen MOD files are played on a computer, the video frames are displayed horizontally squashed with a 4:3 aspect ratio when they should really appear as 16:9 widescreen.

The reason often given for this behaviour is that the camcorder stores the wrong aspect ratio information in the MOD file – it stores a ‘widescreen flag’ which is set to 4:3 instead of the correct value which would mark the file as being 16:9. It’s also believed that the correct aspect ratio is stored in a separate file which has the filename suffix ‘.MOI’.

But this is not strictly correct. The MOD file does in fact contain the correct aspect ratio information, but we just have to dig a little deeper into the MPEG-2 specification.

The video stream in an MPEG-2 file (and this includes MOD files) contains a ‘sequence header’ that contains the horizontal and vertical size of the encoded video frames. For standard definition video, these values will be 720x480 or 704x480 (or in areas which use the PAL video system 720x576 or 704x576). The sequence header also contains an item of ‘aspect ratio information’ which says whether the aspect ratio is 4:3 or 16:9.

When widescreen MOD files are displayed horizontally squashed as 4:3, the assumption is that this ‘aspect ratio information’ field has simply been created by the camcorder with the wrong value. But this isn’t the case.

A closer look at the MPEG-2 specification shows that there is an optional ‘sequence display extension’ which may also be present in the video stream. This contains information about how the video is to be displayed, in particular the ‘display horizontal size’ and ‘display vertical size’ which can be used to define a windowed area of the full encoded frame size that was stored in the sequence header.

Crucially, the specs also say that when the ‘sequence display extension’ is present in the video stream, then the ‘aspect ratio information’ refers to this display size and NOT the encoded frame size.

Related MPEG-2 specs give more detail. For example the ‘display horizontal size’ and ‘display vertical size’ can be used to define the central 4:3 area of widescreen video which may be of use to pan-and-scan features of a playback device. One set of specs specifically says that when the ‘display horizontal size’ and ‘display vertical size’ are used to define the 4:3 area of widescreen video then the ‘aspect ratio information’ MUST be set to 4:3. In fact, it turns out that MOD files (and other MPEG-2 files) do exactly that.

Here are the values from a typical widescreen MOD file:

Encoded frame size: 720x480
Aspect ratio information: 4:3

This looks as if the aspect ratio value is wrong, doesn’t it? But now let’s look at the ‘sequence display extension’:

Display size: 540x480

This display size, together with the aspect ratio information says that the central 540x480 pixels correspond to a 4:3 display. So the encoded dimensions of 720x480 are obviously going to be wider than 4:3. If we do the calculations based on 540x480 being 4:3, it turns out that 720x480 corresponds to a 16:9 aspect ratio. This calculation can therefore be used to work out if the full-size encoded frame is really 4:3 or 16:9. In the example above it is 16:9 even though the aspect ratio info is set to 4:3.

When playing this file on a computer the video player software will usually be interested in displaying the whole encoded frame, so this calculation can be used by the video decoder that is used in the player software to display widescreen MOD files at their correct 16:9 aspect ratio.

At the time of writing, the current versions of some video decoders, including Mainconcept and Microsoft’s MPEG-2 Video Decoder that ships with Windows 7 (and some versions of Vista) do display MOD files with their correct aspect ratio. But there are still many video decoders that do not seem to take the ‘sequence display extension’ into account or interpret the ‘aspect ratio information’ incorrectly, and end up displaying widescreen MPEG-2 files as 4:3.

One solution to this problem is a tool called SDCOPY. This can be used to ‘set the widescreen flag’ in MOD files. This changes the Aspect Ratio Information to 16:9, and either deletes the ‘sequence display extension’ or changes its display horizontal and vertical size values to match the encoded frame size. This effectively satisfies the video decoders that can’t interpret the ‘sequence display extension’ values correctly, but the definition of the central 4:3 area is lost in the process.

Note that there are also some MPEG-2 encoders that create widescreen MPEG-2 files as described above, but which mistakenly set the aspect ratio information to 16:9, thus:

Encoded frame size: 720x480
Aspect Ratio Info: 16:9
Display Size: 540x480

This means that 540x480 corresponds to a 16:9 widescreen display. So the full encoded size of 720x480 must be much wider than 16:9 !  Similar files can also be created by SDCOPY if you set its options incorrectly.

When these files are played via a video decoder that behaves correctly they will display horizontally stretched, and when played via other video decoders will display as 16:9.

Another solution to all of this is to play MOD files in DVMP Pro 8 which always displays them with the correct display aspect ratio. It also has a tool similar to SDCOPY which changes the display aspect ratio flags in MOD files, so that other software and decoders should always interpret the display aspect ratio correctly.


<< Back to “Articles”


Download Demo
Time Stamping Tutorial
Related Articles
Supported File Types
List of Tools

©2024 Code Station Ltd. All rights reserved.