till using XviDs and AVIs? While it’s true that they’re still the most widely used and supported video codec and container out there today, it’d be prudent for you to change because the last few years has seen real contenders to the throne emerge in the form of x264 and MKVs. And I’m here to tell you why they are better than the old guard, what you need to play them and how to get the best out of them.
Before we start though, I’d like to get something out of the way – the difference between a format and a container. Codecs are compressors-decompressors or (the more familiar) coders-decoders - devices or programs that encode or decode signals and data streams for storage or playback in a particular format. AVI and MKV are neither video codecs nor formats, something that is a common misconception. XVID and H264 are, however.
AVI and MKV are containers, or wrappers – file formats that describe how the data inside the file is stored. In case of video, containers contain (heh) the video and audio streams along with other data and the sync data that is required so the file plays back properly. Most containers are not format exclusive, so an AVI file can house DivX, XviD, WMV, H264 or one of the many other formats, all the while supporting different resolutions and qualities. In a similar vein, an MKV file could have an extremely low-resolution DivX video with all the extra features the MKV container provides. However, an XviD video in AVI and an H264 video in MKV are the most common combinations around, so it’s not hard to see where the misinformation and misconceptions arise from.
Now that we’re done with that, let’s get a move on.
What are H264 and MKV?
H264, or its alternate names MPEG-4 Part 10 and AVC, is a video compression standard – a block-oriented motion-compensation-based codec that was jointly developed by the Moving Picture Experts Group (MPEG) and the Video Coding Experts Group. It was developed as a successor to H263 (or MPEG2) with an aim to provide good quality video at substantially lower bitrates.
ffdshow knows what to prioritize
The Matroska Multimedia Container is an open standard free container file format that is owned by CoreCodec, but the specifications are open to everybody. It was developed with an aim to serve as a universal format – one that will store nearly every common multimedia content, like TV shows or movies or even the home video you took with your camcorder. The file extension of the Matroska video container is called MKV.
Why are they awesome?
I just told you that H264 was developed with an aim to halve or more the bitrates required to encode good quality video. H264 isn’t just quality-oriented though, as it can actually be seen as an entire family of standards – one that supports low resolution mobile videos, medium quality streaming and broadcoasting and high definition, high-bitrate Blu-Ray discs. The whole hog basically, so let’s get it out of our heads that H264 is a high-definition or Blu-ray only format, because every video, regardless of resolution or quality, can be encoded with H264 and it will deliver significant bitrate, and consequently filesize, reductions.
H264 video quality is stunning
Today, H264 is used in Blu-Ray disks and players, internet streaming sites such as Youtube, web software such as Adobe Flash and even in TV broadcasting. Of course, most of the video files that can be found on the internet are also slowly moving to H264. Which is pretty predictable, really, because the format offers much higher quality at the same or lower bitrates and filesizes than the previous solutions. It shouldn’t even have taken this long, but H264 places significantly more load on the hardware than the previous standards, so the wait for the majority of the world to catch up with technology is what caused this delay.
MKV is awesome simply because it can house an unlimited number of video, audio, picture and subtitle tracks in virtually every format known to mankind. So it has immense customizability, and not to mention it’s an open standard, which means it is free to use and the technical specifications are available for private and commercial use.
An MKV file can have multiple audio streams, so it’s a popular container for many dual-audio videos. It also supports soft-subtitles, subtitles that are drawn onto the video image in real-time, so they can be removed at any time. Oh, it can have multiple subtitle tracks too, so the same MKV file could have subtitles that will translate a video into 100s of languages. Another cool feature is bookmarking, which allows the user to save bookmarks for their favourite scenes in a video and access it anytime with a couple of clicks. To top it all off it even supports file linking, which means if a TV show has an intro or ending sequence that never changes, people can just use one file and insert it into every episode instead of encoding it separately for each and increasing the file size as a result.
What you need to play them
In order to play H264 videos and MKV files, you can proceed in one of two directions – a codec pack solution that’ll let you play them on any video player software, or video player software that support them internally. I’ll list out the options for you.
Codec Pack Solution
All you actually need for H264 and MKV is ffdshow or CoreAVC to decode the video and Haali Media Splitter or Gabest’s Media Splitter to open the MKV container. You can also install a codec pack that will include the decoders and file splitters you need to play virtually every media file. Most codec packs I’ve used haven’t really been very good, but I can recommend two that caught my interest - the Combined Community Codec Pack (CCCP) and Shark007’s codec packs. They both rely heavily on FFDshow and its codec library to decode the majority of the videos, but I found Shark007’s packs slightly better because they allow for more customization and have x64 versions, which with the marked increase in 64-bit machines is a real plus.
Shark007 codec pack's setting application
You can use these codec packs with any video player software, but I’d recommend The KMPlayer, or SMPlayer.
Integrated video player software solution
These video player software do not require any external codecs to play media files as they have them integrated in their library. The most popular one is, as you guessed it, VLC Player but my recommendation would have to be Media Player Classic Home Cinema. It is very customizable, is pretty much faultless at playing most media files and is the least CPU-heavy because it supports DXVA, something I’ll get to next.
Looks plain, but is powerful
Some of the newest Media Centre solutions also support H264 and MKV now, so if you’ve gotten yourself a Western Digital Media Player or an Iomega or ASUS O’Play, you’re in good hands.
How to get the best out of them
The best way to increase playback quality is to change the video renderer you use. The better your computer, the better the chances are you’ll be able to use renderers like VMR9 Renderless or Enhanced Video Renderer (Windows Vista and 7 only) which will improve video quality substantially.
Renderer Selection on KMPlayer
You can also offload some parts of the video processing to your graphics card (if supported). This video acceleration is provided in Windows under DirectX Video Acceleration (DXVA) which results in a dramatic reduction of CPU load. The CoreAVC codec also allows for CUDA-assisted acceleration for NVIDIA graphics cards, but the codec itself is paid software so I wouldn’t recommend it.
CoreAVC has CUDA-assisted acceleration
So there you have it – the idiot’s guide to H264 and MKV. Hopefully you’ve gotten a lot more information about the format and the container than you previously had, which might convince you to switch to storing your files in H264 and MKV. There’s no reason not to, most of the world is doing it now because it is quite simply better than XviD and AVI.
I haven't touched upon the application of H264 on portable devices at all, but we'll leave that for another day - one that will come by very soon.