Is Your Container Bigger Than Mine?

by Damian on August 21, 2009 · 9 comments

in Guides

Mad_scientist_svgAs a WHS user, I am always looking for ways to be as efficient as possible with the amount of hard disk drive space I use. I came across a few posts online that discussed the difference between .mkv, .ts, .m2ts (the three most commonly used containers for HD content). Which one of these three containers you choose will have zero affect on video quality, but I read that each container has slightly different overhead which will result in a different file size given all other factors remain constant. An mkv would be the most efficient, followed by ts, and lastly m2ts. I decided I would put this to the test, but before I go any further, here is a quick primer on each container:

  • mkv- Also known as Matroska, mkv is an open standard free container format, a file format that can hold an unlimited number of video, audio, picture or subtitle tracks inside a single file [1]
  • ts – Also known as MPEG transport stream, ts is a standard container for digital broadcasting and for transportation over unreliable media, typically contains multiple video and audio stream [2]
  • m2ts- A type of MPEG transport stream used  is media such as Blu-ray disks [2]

For my experiment I have decided to use a Blu-ray disk that comes in at 38.4GB. The main movie (including all audio tracks and subtitles) alone is 31.5GB, with the remaining space going to trailers, advertisements, etc. I am going to use MakeMKVto create the .mkv file and Clown_BD to create a .ts and .m2ts file, only including the main movie and main audio track.

EDIT 2-Sep- MakeMKV only extracts the core audio from TrueHD and DTS-MA audio tracks whereas with Clown_BD I can retain the original lossless audio track. To make sure I was comparing apples to apples I ended up using MKVMerge to create the MKV which allowed me to keep the lossless audio track in tact and on par with the ts/m2ts file created with Clown_BD. Thanks to Puycheval for questioning me on this as I was not clear originally.

Test #1 (mkv):

27.1 GB (29,137,454,238 bytes)MKV Result

Test #2 (ts):

27.8 GB (29,951,371,340 bytes)

TS Result

Test #3 (m2ts):

28.4 GB (33,588,628,992 bytes)

M2TS Result

Conclusion:

So my test results confirm my readings online, keeping all other factors constant the mkv container took up the least amount of space, with a savings of 4.5% over m2ts and 2.5% over ts. More importantly, I experienced a space savings of approx 26-30% just by only keeping the main movie and main audio track versus keeping the entire disk, and an approx 10-14% space savings over keeping just the main movie (with included audio tracks and subtitles). With duplication enabled in my WHS the final results are even greater. This doesn’t mean you should drop everything right now and move all your video files over to mkv as there are other factors to consider such as device support, etc. If you are very conscious about using hard disk space as efficiently as possible, this is some food for thought. So what do you think, does this surprise you that different containers come with a different amount of “overhead”?

(Comparison of all three test files):

result summary

(Comparison of all three test files vs. Full Disc/Main Movie):

result summary a





Article by

Hi, my name is Damian, and I'm tech gadget addict! Although I always had some interest in technology, it wasn't until I got my EX470 and more importantly found Mediasmartserver.net, that my interest became an addiction. My goal, aside from world domination and to see the Mets/Broncos win another championship, is to set up the perfect digital home where all my media is available at the click of a button. When I am not writing for Mediasmartserver.net you can find me over at my blog at http://www.adigitalhomeblog.com or follow me on twitter


{ 8 comments }

Atamido August 22, 2009 at 7:32 am

There are also a few other space saving methods that can be used. MKV supports text subtitles and other audio formats. You can convert the subtitles from pictures to text. And you could include other audio tracks like the director’s commentary reencoded to low-bitrate Vorbis audio.

mr_skinny August 24, 2009 at 5:50 am

I use MP4 containers with video encoded using h.264 (AVC) and soundtracks in AAC 5.1

I stream my MP4 collection to a PlayStation 3 using TownyMedia (supports artwork and ID tags) and the sound is handled by my Sony Home Theatre amp which accepts uncompressed LPCM 5.1 audio from the PS3. It’s tricky getting an amp to decode AAC audio, which is why I opted for the PS3 decoding the audio and sending the uncompressed audio via HDMI. h.264 is a very efficient (but memory/processor hungry) video codec with regards to compression. I dabbled with MKV, m2ts and TS files prior to deciding upon MP4. I use MeGUI for encoding duties.

Puycheval September 2, 2009 at 2:29 am

Did you notice MakeMKV extracts the core sound (ie dts for dts-ma and dd for dolby truehd) because mkv can’t handle hd sound (unless you transcode it to flac)? I’d like to know if you did the same with clown_bd for m2ts and ts files. If not, the size difference is easy to understand.

Damian September 2, 2009 at 5:43 am

@ Puycheval – currently no players will play back TrueHD in mkv which is why MakeMKV extracts only the core AC3 track. As for DTS my understanding is that mkvs can handle dta-ma. The reason why MakeMKV only extracts the core DTS audio track is because, according to the author, is because DTS HD is a single audio track is represented by two streams – core audio and extension. Core audio contains 5.1 audio and extension brings it to 7.1 or lossless. MakeMKV skips extension stream (second audio) but not the core audio. Clown_BD does not extract the core, it takes the full lossless audio track.

HOWEVER, for the test I did I ended up not using MakeMKV for this exact reason as it would give inaccruate results since it only extracts the core audio. What I did was use Clown_BD to demux the video/audio. I then took the demuxed video/lossless audio files and muxed back into mkv with MKVMerge. If you look at the MediaInfo screenshots you will see that the mkv screenshot does in fact have the lossless audio track and not the core, which then makes for a fair comparison against the ts/m2ts files created with Clown_BD.

Puycheval September 2, 2009 at 10:11 am

Glad to hear your test is relevant. However you should edit your test to avoid confusion on MakeMKV.

“…If you look at the MediaInfo screenshots…”
I did my best before my first post but your screenshots don’t take up too much place on hard disk :)

Damian September 2, 2009 at 10:27 am

@ Puycheval – ah, I see. When I started writing the post I had mentioned MakeMKV, but once I realized it wouldn’t work correctly I changed directions but never edited the post. I will do that right now (and increase the size of the screenshots). Thanks for pointing this out.

David May 28, 2010 at 9:27 pm

The links for the screenshots are broken.

Alex Kuretz May 28, 2010 at 9:46 pm

Thanks David, I’ve fixed them.

Comments are closed, visit the forums to continue the discussion.

{ 1 trackback }

Previous post:

Next post: