Both the container and codec are important in their own right. The container largely determines the features that the video format is able to support. On the other hand, the codec is what is responsible for the video compression.
When it comes to the most useful formats currently in use, there are five codecs, containers, and pairings of the two that you need to know:
MP4 with H.264
Arguably the most widely-supported format in general, MP4 with H.264 is the ‘safest’ format to use if you want to ensure that you have no issues playing the video on any device or platform. Most online streaming platforms use MP4 with H.264 as their recommended format as well, which makes it doubly useful.
As far as the file size goes, the H.264 codec may no longer be the best out there – but it isn’t bad. The MP4 container does support most features as well, though it is somewhat limited in certain ways.
MKV or MP4 with H.265
If high compression is what you’re after then HEVC is the way to go, and H.265 has started to come into its own recently. It can reduce the file size of H.264 videos by up to 50%, while maintaining the same video quality.
Both MKV and MP4 support H.265, so you can use either container with it. Often it boils down to a question of the types of features that are required, and in some cases the audio codec that will be used.
Overall MKV is more flexible than MP4, and supports practically any codec that you want to throw in with it – but may not be as widely supported. It should be noted that other formats can support H.265 as well, but aren’t as popular.
Make no mistake the MPEG-2 codec is old, but still in use to this very day due to the fact that it is the codec that DVDs utilize. While newer DVD players tend to support a wider range of codecs, the majority still rely on MPEG-2.
While using MPEG-2 in general is inadvisable as other codecs offer much better compression rates, if you’re encoding videos for DVDs then it is still the format that you want to use.
MPEG-4 Part 2 (H.263)
MPEG-4 is a somewhat confusing codec because it has many parts. The MPEG-4 Part 10 is what is commonly known as H.264, but MPEG-4 Part 2 is an entirely different codec in its own right and is regarded as H.263.
At one time MPEG-4 Part 2 was widely used by MOV and AVI containers for online videos. Because of its previous popularity, if you have older devices or set-top boxes you may find it useful as they may not support newer codecs such as H.264.
The AV1 codec was only recently released, and support for it is still limited. However it is created by the AOMedia consortium that includes influential members such as Google, Microsoft, Apple, Mozilla, Amazon, and many others.
In short, this is a codec to keep an eye on in the future as it is being positioned to eventually replace H.265 as the de facto format for online videos.
As you may have noticed most of the entries in the list above consist of codecs – which is mainly because containers are much more situational. Depending on the features that you need you may prefer one container over the others, but for the most part, the popular containers such as MP4 and MKV are decent choices.
Now that you’re aware of the more useful video formats in general, however, it should make it easier to choose which one to use when you’re converting your videos. If you still have difficulty, you may want to try using a user-friendly converter such as Movavi Video Converter.
Based on the list above you should be able to figure out which format would be best, depending on the devices or platforms you’re going to play it on. As mentioned MP4 with H.264 is the ‘safe’ option – and it should be a good place to start.