
Media containers and their formats (Part 1)

Like any other digital information, video is stored on disk in the form of files, or as they are also called, media containers that contain video, audio, and other streams, as well as metadata. At any time, you can take, for example, video or audio tracks from the container, recode them and put them in another container, that is, change the format of the video file. Multimedia containers can be of different types (formats) and the file extension indicates which type they belong to.

Even though most of the containers are bound to a specific format, some of them can store videos in completely different standards. For example, a file with the AVI extension can contain clips in MPEG-1 and MPEG-2 or MPEG-4 formats. What then influences the type of container?
Of course, to a greater extent, the quality of the movie is determined by the codec and parameters that were set during compression. But a lot also depends on the container. Various types of video files have certain requirements and restrictions regarding the number of audio tracks, subtitle channels, types of codecs used, as well as compatibility with consumer players and players.
Now, let’s take a look at the most popular video file formats and take a quick look at their advantages and disadvantages.
AVI (Audio Video Interleave) is the oldest and most traditional of all types of media containers, first used by Microsoft in 1992. It can contain video and audio information compressed using various combinations of codecs. Therefore, AVI files with external similarity can be very different in their internal “padding”, and to accurately determine their content, you will need to use special programs (for example, VideoToolBox).
Strictly speaking, this container has been outdated for a long time and has a number of serious drawbacks: the impossibility of containing mixed videos (for example, NTSC and PAL) and alternative audio tracks, the lack of timestamps and frame rates, the lack of normal operation with subtitles, poor support for modern codecs, etc.
However, this old man does not want to withdraw in any way, because a large amount of multimedia content on the network is still distributed using this format. The secret of such longevity, most likely, is the versatility of AVI, although on the other hand this is also its disadvantage. Sometimes you have to sweat a lot to open an AVI file created with exotic codecs.



