mkv vs mp4 vs avi vs flv ?
These are not video formats, the correct terminology is movie containers
These files contain
* at least one or several video streams compressed using various video codecs
* at least one but can be several audio streams compressed with various audio codecs (to reduce file size) - think standard 5.1 audio, second track stereo audio in case the hardware player can't play 5.1 content , then maybe an audio track with director's commentary and so on, then maybe movie dubbed in some foreign language for those who have difficulties reading subtitles
* none, or some number of subtitles (normal or for hearing impaired people, with or without additional stuff like embedded fonts for japanese characters and so on)
* chapter information (to make it possible to jump in the video at the beginning of certain scenes)
These file formats pack the above information in such a way that it makes it possible for movie players to just jump at a random position in the file and start splitting the content read from file into the essential elements and play only those essential elements. It makes it possible to play incomplete downloads, it makes it possible to quickly jump somewhere in a movie and so on.
AVI is one of the oldest movie containers and as such has some limitations .. it can only hold one video track and as far as I know it can only have two audio tracks. You can't add subtitles in an AVI file and because it's so old, there are also some limitations about how data is stored inside the file and what video and audio codecs can do to compress the content more efficiently.
The AVI format wasn't really designed to account for modern compression techniques that were implemented in video codecs like XVID or h264 for example, or audio codecs like MP3 or AAC - programmers were smart enough to make workarounds and clever hacks to make these codecs work with the limitations of the AVI format but basically, this file container is outdated and not recommended to be used anymore.
FLV is short for Flash Video, it was a container format invented by Apple where you could mix video and audio compressed using a limited number of codecs. The Flash designers needed this because at that time, there was no alternative for what they wanted to do - one of their video codecs could compress transparency as well, allowing for designers to easily record movies and define some portions of the movies as transparent and then overlay these movies over some parts of the Flash presentation (think people talking in front of green screen and then when compressing, you told the video codec to ignore the green color and make that portion transparent)
They also needed a simple container format that would allow them to connect to a web cam and a microphone and record camera and microphone, combine them quickly into a format they know and upload that data to a website that had the Flash object on it. This would have been very difficult to do with AVI or MPG , which were the containers that were available back then.
Nowadays, most FLV files you'd see are basically just MP4 files that have the video part compressed with h264 video codec and the audio part either MP3 or AAC. Basically, they just rename a MP4 file and change the extension to FLV. Technically, these FLV files are not true FLV files but the Flash player checks inside the file for specific signatures and recognizes what format the file actually is and plays them right.
MP4 is a file container that's much better for streaming, it's organized into "atoms" which are basically chunks of data, so if by some accident a chunk is corrupted during download the video player can always just continue to download data until the start of a new chunk is found and then resume decoding.
It's better than AVI in the sense that video and audio codecs aren't so restricted, but on the downside only a few video codecs and audio codecs are permitted inside MP4 containers. The majority of mp4 files will have the video compressed using h264 and the audio part compressed with AAC or AC3.
It has limited support for subtitles, only a limited number of subtitle formats is supported.
MKV is the most modern and versatile container, it can bundle several video tracks, lots of audio tracks, subtitles, chapters, and was designed from the start to be extendable easily when new video codecs or audio codecs are designed.
WEBM is basically a subset of MKV, a MKV container with a few restrictions to simplify it.
You can read more here about various containers : https://en.wikipedia.org/wiki/Comparison_of_video_container_formats
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now