Computer movie files
From MeWiki
A computer movie file is a computer file that contains audio and video. Movie files are made up of several components, and these components are largely modular, which means they can be easily swapped for other compatible pieces while leaving the other parts of the file intact. This page explains the different types of components and gives common examples of them.
Important Note: This page (and subpages) contains subjective quality comparisons. The final word in any quality comparison is your eyes (or ears), so take all comparisons with a grain of salt.
Contents |
[edit] Standards and Implementations
Just a quick note about the difference between these two things.
Standards are a set of specifications which are intended to serve as descriptions on how a particular format works.
Encoders (aka codecs) are implementations of a standard.
See the difference? What this means is that, when a standard like MPEG-4 AVC is produced, a number of different groups produce their own encoders to output video which will conform to that standard (i.e. be compatible and be able to be decoded by a conforming decoder), like the x264 project and Apple h.264.
[edit] The Container
The container is the part of the file that holds everything together. You put your video/audio streams and anything else you want (for example a subtitle stream) inside the container, so you have a single file, with the filename usually having the extension relevant to the container used (i.e. if you used Matroska as the container for your video your filename extension should be .mkv). Just think of it as sort of like how you can store multiple files in a zip archive, and your resulting ZIP file will have the extension .zip.
A very common container for videos (but now a little feature-restricted and getting outdated) which you may have heard of is AVI, a video which uses (one of the versions of) avi will have the filename extension '.avi' for example mytestvideo.avi
Containers do a few things:
- Indexing of streams
- Metadata (information about the streams inside)
- Error recovery capabilities
- Chapters and other forms of meta-navigation
- Streaming hint data
The Container subpage has more information on the various types of container.
[edit] The Video Stream
The video stream basically consists of instructions on how to display a sequence of still pictures (i.e. the video frames).
Read about the multitude of video formats on the video subpage.
[edit] The Audio Stream(s)
The audio stream (or streams) contains the data for the audio component of the video file (i.e. the sound).
The audio subpage has extra information on some of the various audio formats around.
[edit] The Subtitles
In this case, 'the subtitles' refers to "soft" subtitles. "Soft" subtitles are overlaid onto the video during playback, as opposed to "hard" subtitles which are encoded directly as part of the video stream. Soft subs have a few advantages:
- You can have multiple subtitle streams (i.e. different languages)
- You can turn subtitles on and off
- The video is easier to compress (which means higher quality)
- The subtitles are editable (i.e. you can fix errors, translate them, etc.)
Read more on different subtitle formats on the subtitle subpage.
[edit] Additional Information
Some of the more advanced containers can store extra stuff, such as chapter files, embedded fonts and the like. Read on to learn about some of these.
[edit] Attachments
Matroska, being the cool little container it is, lets you include arbitrary files as attachments. Want to include a text file with information about the release? A zip file of the soundtrack? DVD cover? Sure! With Haali's splitter installed (the de facto Matroska splitter for DirectShow) you can view attachments in the explorer properties window for the relevant file and extract them from there.
- Embedded Fonts
- Only available in Matroska files. When muxing in SSA/ASS format subtitles, sometimes you want to use whacky fonts the target computer is not guaranteed to have. If you add fonts in as an attachment to a Matroska file, VSFilter (the de facto subtitle renderer for DirectShow) will be able to make use of these fonts when playing back the subtitles.
[edit] Chapters
Pretty self explanatory. Different formats use different chapter styles: Here's an example of Matroska's:
<Chapters>
<EditionEntry>
<EditionUID>1</EditionUID>
<EditionFlagHidden>1</EditionFlagHidden>
<EditionFlagDefault>0</EditionFlagDefault>
<ChapterAtom>
<ChapterUID>1</ChapterUID>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
<ChapterDisplay>
<ChapterString>Part A</ChapterString>
<ChapterLanguage>eng</ChapterLanguage>
</ChapterDisplay>
<ChapterTimeStart>00:00:00.000000000</ChapterTimeStart>
</ChapterAtom>
<ChapterAtom>
<ChapterUID>2</ChapterUID>
<ChapterFlagHidden>0</ChapterFlagHidden>
<ChapterFlagEnabled>1</ChapterFlagEnabled>
<ChapterDisplay>
<ChapterString>Part B</ChapterString>
<ChapterLanguage>eng</ChapterLanguage>
</ChapterDisplay>
<ChapterTimeStart>00:09:48.000000000</ChapterTimeStart>
</ChapterAtom>
</EditionEntry>
Complex hey? Here's an example of OGG format chapters:
CHAPTER01=00:00:00.000 CHAPTER01NAME=Chapter 1
Much nicer. Of course, you can do a lot more with Matroska chapters, far too much more to go into detail here, apart from a brief explanation of ordered chapters.
- Ordered Chapters
- These are pretty much chapters that also refer to other matroska files for portions of the playback. For example, say you are encoding a TV series. You can cut the opening and ending out of every episode and encode them into two independent files. Then you can use ordered chapters in the main episode files to have them automatically and transparently loaded back in again. Nifty.
[edit] Anamorphic Flags
The ability to store a value that will reflect the Aspect Ratio of the file on playback, in other words, to have anamorphic playback (a version of 'widescreen/letterbox'). Say you have a 16:9 movie that's encoded in 4:3 aspect ratio. Well, when you mux the video you can specify the playback ratio as 16/9 and your media player will automatically resize to this ratio on playback.

