View Full Version : What are the core advantages of using MKV over AVI?
JimmyBarnes
3rd July 2010, 03:34
Looking for tangible advantages, not theoretical elegance..
TIA
Guest
3rd July 2010, 03:40
See the second question here:
http://matroska.org/technical/guides/faq/index.html
And this:
http://matroska.org/technical/whatis/index.html
And then read all the other information at that site.
Then this:
http://mod16.org/hurfdurf/?p=8
All clear now? :)
Let's put AVI in perspective... It doesn't even have timestamps to guarantee AV sync. It doesn't even have a flag to specify that the content is interlaced. Getting the picture?
You need to use search:
http://forum.doom9.org/showthread.php?t=119377
Finally, AVI being married to VfW is unable to take advantage of the entire DirectShow story.
Midzuki
3rd July 2010, 05:17
Matroska:
pros:
--- supports VFR video and audio ;
--- no filesize issues ;
--- accepts various lossless-audio formats ; :cool:
cons:
--- a "perfect" DirectShow Matroska splitter needs to be written; :devil:
JimmyBarnes
3rd July 2010, 14:23
I can see that for the technology or the "power-user", MKV offers the way forward whereas AVI is a dead-end.
For myself, tho, I am mostly interested in backing-up DVDs or BDs to a more compact format, in a quality which closely matches the original, with a minimum of fuss.
If one were to use H.264 video rather than Xvid, is not interested in VFR/menus/chapters/multiple video streams, is quite happy with AC3 (CBR) audio (or CBR VBR MP3 even!) and idx/sub or srt subtitles and filesizes up to the capacity of a DVD DL (7.92 GB), what essential advantages does MKV offer that AVI does not ?
Gavino
3rd July 2010, 14:37
If one were to use H.264 video rather than Xvid, is not interested in VFR/menus/chapters/multiple video streams, is quite happy with AC3 (CBR) audio (or CBR VBR MP3 even!) and idx/sub or srt subtitles and filesizes up to the capacity of a DVD DL (7.92 GB), what essential advantages does MKV offer that AVI does not ?
I can't help thinking of that scene in Monty Python's Life of Brian (http://en.wikipedia.org/wiki/Monty_Python%27s_Life_of_Brian):
"... apart from better sanitation and medicine and education and irrigation and public health and roads and a freshwater system and baths and public order... what have the Romans done for us? "
:D
Guest
3rd July 2010, 14:50
If one were to use H.264 video rather than Xvid, is not interested in VFR/menus/chapters/multiple video streams, is quite happy with AC3 (CBR) audio (or CBR VBR MP3 even!) and idx/sub or srt subtitles and filesizes up to the capacity of a DVD DL (7.92 GB), what essential advantages does MKV offer that AVI does not ? What is "essential" depends on your goals. Given what you describe, if you are willing to accept the limitations of your AVC encoding required to place it into AVI, then there is no essential advantage to using MKV over AVI (leaving aside the ridicule you'll have to endure). If there was you would have been asking how to overcome the problems of using AVI! But yours is a very limited goal set and not everyone is willing to handcuff AVC to kludge it into an ancient and obsolete container.
If you want to use AVI, go ahead; nobody is holding a gun to your head.
JimmyBarnes
3rd July 2010, 15:53
I can't help thinking of that scene in Monty Python's Life of Brian (http://en.wikipedia.org/wiki/Monty_Python%27s_Life_of_Brian):
"... apart from better sanitation and medicine and education and irrigation and public health and roads and a freshwater system and baths and public order... what have the Romans done for us? "
:D
Doom9 Team Member foxyshadis' 2006 comment is interesting:
http://forum.doom9.org/showpost.php?p=917897&postcount=10
JimmyBarnes
3rd July 2010, 16:00
What is "essential" depends on your goals. Given what you describe, if you are willing to accept the limitations of your AVC encoding required to place it into AVI, then there is no essential advantage to using MKV over AVI (leaving aside the ridicule you'll have to endure). If there was you would have been asking how to overcome the problems of using AVI!
That's what I suspected but I wanted to heard it from a guru (Ridicule? Bro, let's just keep it "our little secret", right? :))
But yours is a very limited goal set and not everyone is willing to handcuff AVC to kludge it into an ancient and obsolete container.
I presume there is nothing to stop an H.264 AVI being loaded into a suitable editor and remuxed as MKV at some future time?
Guest
3rd July 2010, 16:07
I presume there is nothing to stop an H.264 AVI being loaded into a suitable editor and remuxed as MKV at some future time? The handcuffs are still in place.
Let's turn this around. Why are you so determined to stick with AVI? What is the "essential" reason you can't use MKV?
JimmyBarnes
3rd July 2010, 16:24
The handcuffs are still in place.
Let's turn this around. Why are you so determined to stick with AVI? What is the "essential" reason you can't use MKV?
I am needs driven, so given the constraints that I have outlined "there is no essential advantage to using MKV over AVI" as you put it.
If there was something that I required of it that AVI did not do well or couldn't do, I'd be looking for a better replacement. And of course I am comfortable and familiar with AVI, to date it has served me well (hundreds of rips).
foxyshadis' comments are interesting and impinge on my own feelings in this matter.
Guest
3rd July 2010, 16:32
foxyshadis' comments are interesting and impinge on my own feelings in this matter. They're also 4 years old.
Did you ever consider that when you try out something new you may discover some useful new features and things that you can take advantage of?
nurbs
3rd July 2010, 18:21
If you are looking for hardware player support then H.264, AC3 or AAC and sub/idx in MKV has probably better support than with AVI.
7ekno
3rd July 2010, 23:32
Also a few comments from somebody that tried AVI for H.264/AC3 DVD backups along time ago:
- Ensure your preferred media splitter / player work with it (at the time I tried, only VLC would play the AVI)
- Larger file size overheads (in the order of 5-10%, which seemed a waste of space to me)
- Major "seek" issues on playback, far far slower than MKV and would often go out of sync post seek
- Any conversion of the AVI back to DVD (I tried 5 freeware & comercial products at the time) would cause sync issues
- The AVI file crashed Windows Explorer in Windows XP if any type of "previewing" was enabled
So if you are willing to accept "pro" AVI comments from 4 years ago, you can accept my "con" comments from 5 years ago :P
7ek
JimmyBarnes
4th July 2010, 01:15
They're also 4 years old.
Did you ever consider that when you try out something new you may discover some useful new features and things that you can take advantage of?
Of course, that's one reason I asked this question, not because I am "determined to stick with AVI".
MKV clearly has a good deal to offer in general , it's what it can offer me that is at issue here.
I am still grappling with M2TS conversion to H.264, this is what is most likely to tip me to MKV.
What utility or combo of utils will do for MKV what VDubMod does for AVI? I have tinkered with MKVToolnix and so far am not impressed..
Guest
4th July 2010, 01:25
I have tinkered with MKVToolnix and so far am not impressed.. That's too vague to respond to.
JimmyBarnes
4th July 2010, 02:08
That's too vague to respond to.
Does that mean MKVToolnix is it, there's nothing better?
Guest
4th July 2010, 02:23
Does that mean MKVToolnix is it, there's nothing better? No, it means you are too vague to respond to.
JimmyBarnes
4th July 2010, 02:32
No, it means you are too vague to respond to.
My specific question again:
"What utility or combo of utils will do for MKV what VDubMod does for AVI?"
Guest
4th July 2010, 02:49
Specifically, what are you looking for?
Blue_MiSfit
4th July 2010, 02:52
MKVtoolnix is just a muxer. It doesn't do any transcoding.
If you want a VirtualDub workalike, take a look at AviDemux, but I'm not a big fan of it.
There are tons of competent encoding GUIs out there, ripbot264, MeGUI, etc.. most of these use MKV or MP4 as their native container formats, since again most of these are tailed around x264 (and rightfully so!)
Derek
Sharktooth
4th July 2010, 04:03
If you want to use AVI, go ahead; nobody is holding a gun to your head.
i am... ;)
@JimmyBarnes: the AVI overhead is something to take into consideration. at the same file size a .MKV will look better than .AVI just coz of the overhead.
also AVI has size restrictions (4GB)... so perfect backup of blu-rays or HD content would require splitting in multiple files.
those are just the first 2 practical reasons i can think of. but it's also very late so tomorrow i can add more...
poisondeathray
4th July 2010, 04:18
...also AVI has size restrictions (4GB)... so perfect backup of blu-rays or HD content would require splitting in multiple files.
Is this true or were you referring to a specific context like FAT32 storage system or something else?
Doesn't current AVI 2.0 spec have no filesize limitation ?
JimmyBarnes
4th July 2010, 04:46
Specifically, what are you looking for?
How does one use MKVGui to split a file into desired sections? In VDM, one gets a frame by frame display and the ability to mark out the desired section, then cut it out, starting from a keyframe.
MKVGui does do splitting, but apparently without any display. It splits the output after a certain point, then into a set number of files.
JimmyBarnes
4th July 2010, 04:48
Is this true or were you referring to a specific context like FAT32 storage system or something else?
Doesn't current AVI 2.0 spec have no filesize limitation ?
I have an 8GB Xvid/AC3 AVI which I have watched throughout and it plays perfectly.
JimmyBarnes
4th July 2010, 04:49
i am... ;)
@JimmyBarnes: the AVI overhead is something to take into consideration. at the same file size a .MKV will look better than .AVI just coz of the overhead.
How much overhead are we talking about here, in terms of MB or relative (in %) for AVI vs MKV?
mariush
4th July 2010, 05:10
AVI v1.0 has 2 GB limitation, AVI 2.0 has no limitation as it uses several "superindex" entries, one for each 2 GB segment.
For example, Virtualdub by default when it creates avi files it reserves room for 256 superindex entries, each with 8192 index entries - this is enough for about 500 GB or around nine hours or video.
PS. The overhead is there, i'd say less than 1% of the final size.
Ex 1 hour 8 minutes of video in avi: 699 MB (733,853,696 bytes) Same video in MKV: 694 MB (728,051,781 bytes) - 99.209 % of AVI file size.
Speaking of savings, you can load any AVI file in Virtualdub, go to Audio > Interleaving and disable interleaving. You won't be able to watch the video as it's being downloaded as now the video is at the beginning of the file and the audio is towards the end but otherwise all optical drives/hard drives have no problems reading and buffering the audio and video parts. With regular 128kbps audio tracks you won't notice much saving but with some other audio tracks (for example 22050 Hz, 48 kbps mono mp3), I found that sometimes you can save about 8 MB out of around 90-95 MB of video. Useful when posting clips to youtube style sites with 100 MB file size limits and you want the highest video quality.
JimmyBarnes
4th July 2010, 05:58
AVI v1.0 has 2 GB limitation, AVI 2.0 has no limitation as it uses several "superindex" entries, one for each 2 GB segment.
For example, Virtualdub by default when it creates avi files it reserves room for 256 superindex entries, each with 8192 index entries - this is enough for about 500 GB or around nine hours or video.
Err... a 500GB AVI, even with today's multi TB HDDs, think I'll pass..
PS. The overhead is there, i'd say less than 1% of the final size.
Ex 1 hour 8 minutes of video in avi: 699 MB (733,853,696 bytes) Same video in MKV: 694 MB (728,051,781 bytes) - 99.209 % of AVI file size.
That's not what I'd really call significant: it wouldn't make a visible difference.
Speaking of savings, you can load any AVI file in Virtualdub, go to Audio > Interleaving and disable interleaving. You won't be able to watch the video as it's being downloaded as now the video is at the beginning of the file and the audio is towards the end but otherwise all optical drives/hard drives have no problems reading and buffering the audio and video parts. With regular 128kbps audio tracks you won't notice much saving but with some other audio tracks (for example 22050 Hz, 48 kbps mono mp3), I found that sometimes you can save about 8 MB out of around 90-95 MB of video. Useful when posting clips to youtube style sites with 100 MB file size limits and you want the highest video quality.
In this case the difference would be slightly significant, but for movie rips as you say it wouldn't make a difference.
According to GKnot 0.35.0, Interleaving & AVI Overhead is 4 MB with no audio streams, what it calls Frame overhead. An AC3 or CBR mp3 stream adds 3 MB overhead, a VBR mp3 6 MB. Even if MKV muxing introduces 0 MB overhead (obviously not true), for a full length movie I would not expect such "savings" to make a visible improvement.
sneaker_ger
4th July 2010, 13:58
Actually matroska overhead can go below 0 byte (mathematically) because of header stripping. (Just a side note)
I personally find nurbs' post most convincing and will stress it more:
With matroska you can get hardware support for the following:
1.) H.264 (big plus compared to XviD)
2.) Embedded Subtitles
3.) lossless audio formats
And the support is constantly growing, now even more so with both DivX and Google supporting matroska. I don't see it happening for avi.
As to a VirtualDub equivalent (preview, simple editing, reeconding) - like Blue_MiSfit already mentioned: AviDemux is the only comparable program I know. But its stability is in no way comparable to VirtualDub in my experiences. The non-existence of a VirtualDub for matroska (I don't count VDubMod...) is the biggest con for matroska, but doesn't outweigh the pros IMHO.
Guest
4th July 2010, 14:18
How does one use MKVGui to split a file into desired sections? You got me! There is currently not a good freeware editor for MKV. There are commercial ones but I have not assessed them. Some people have success with Avidemux but you have to be aware of the limitations.
One might suggest to do your editing before putting the material into the MKV but I accept it is a bit of a cop-out.
That's it, I'm going back to AVI. :)
Sharktooth
4th July 2010, 14:37
Is this true or were you referring to a specific context like FAT32 storage system or something else?
Doesn't current AVI 2.0 spec have no filesize limitation ?
sorry, probably you're right. it's due to FAT32. i always get confused on those 2...
about the overhead, it depends a lot on what you mux in avi however, MP4 and MKV have almost 0 overhead and in some cases may be even negative overhead (the raw stream is bigger than the muxed stream) due to header stripping and other optimizations.
however, there are other reasons to not use avi. one of them is the lack of tools.. yeah... theoretically you can store almost anything in avi but there are no tools nor splitters able to embed/read subtitle streams, chapters or multiple audio sources. MKV tools (muxers, splitters etc), on the other hand, support all that without problems. The same is for MP4...
another reason is the ugly hacks(tm). no one can guarantee something was not meant to be muxed into an unsupported container will work as expected. you may get desynchs or ever worst problems when playing, demuxing, seeking, etc. So using AVI is not a good idea if you would like to change container in the future re-using the muxed-in-avi streams.
reason number... ehrr... dont remember. however, avidemux is a free tool for editing videos. that includes avi, but also mkv and mp4 BUT dont forget editing is best done BEFORE encoding... that means every editor has its own problems, including vdub, but editing should NEVER be done after encoding unless it's extremely necessary.
roozhou
5th July 2010, 09:15
Matroska:
pros:
--- supports VFR video and audio ;
There is a 0-byte chunk hack for AVI to support vfr. The only problem is larger overheads
--- no filesize issues ;
OpenDML was introduced in 1996.
--- accepts various lossless-audio formats ; :cool:
This is the same as vfr audio issue. Most of the lossless-audio formats are vfr.
IMO the "core" advantages of mkv is
1) Smaller overhead. In most cases mkv has smaller overhead than AVI and MP4. Well, TS has much larger overhead than AVI but why does nobody care?
2) AVI supports up to 2 audio streams but MKV has no such restriction.
3) Embedded subtitles in MKV are compressed with Zlib. You can also embed fonts in MKV.
Sharktooth
5th July 2010, 12:41
There is a 0-byte chunk hack for AVI to support vfr. The only problem is larger overheads
yep... an HACK...
This is the same as vfr audio issue. Most of the lossless audio formats are vfr.
so it requires an HACK...
IMO the "core" advantages of mkv is
1) Smaller overhead. In most cases mkv has smaller overhead than AVI and MP4. Well, TS has much larger overhead than AVI but why does nobody care?
coz it's the only container available for TRUE streaming (not just progressive download ala youtube...)
2) AVI supports up to 2 audio streams but MKV has no such restriction.
avi supports more than 2 audio streams but the more you add the more will be the overhead. another problem is there are no splitters that support more than 2 audio streams.
roozhou
5th July 2010, 12:47
yep... an HACK...
MS AVI splitter shipped with windows plays vfr video w/o problem, as well as a lot of native splitters. We should consider this "hack" a widely-supported feature.
coz it's the only container available for TRUE streaming (not just progressive download ala youtube...)
So why does BD use TS?
Ghitulescu
5th July 2010, 12:59
Because it's a transport stream ... presentation streams (eg DVD) are somehow limited in the number of facilities they provide.
JimmyBarnes
5th July 2010, 14:13
IMO the "core" advantages of mkv is
1) Smaller overhead. In most cases mkv has smaller overhead than AVI and MP4.
But if for 700+ MB rips the overhead amount to barely a percent or so more bytes being available for video, what visible improvement will that make - not significant that I can see
2) AVI supports up to 2 audio streams but MKV has no such restriction. Not useful for me as I would rarely even use 2 (one movie soundtrack, one commentary)
3) Embedded subtitles in MKV are compressed with Zlib. You can also embed fonts in MKV.
Embedded subs are one feature which might be useful - it's more "elegant", but I can live with idx/rar or srt, the latter especially are more easily edited if need be.
Anyway this discussion is making people think deeply and that's good :)
Sharktooth
5th July 2010, 14:16
@roozhou: an Hack is different than a "supported feature". an hack is there to get "out of specs" but still making it useable in some ways...
@JimmyBarnes:
1) it higly depends on the streams you mux into avi. the more the streams, expecially if VBR streams, the higher the overhead.
2) IIRC windows default avi splitter (quartz) doesnt support multiple audio streams in avi.
3) subs compression may also make more space available. expecially if subs bitmaps.
Anyway, this discussion is leading nowhere... MKV is vastly superior to AVI and AVI is old and problematic. Everyone already knew that.
roozhou
5th July 2010, 14:43
1) it higly depends on the streams you mux into avi. the more the streams, expecially if VBR streams, the higher the overhead.
Unlike transport stream, overhead for avi is not a percentage stuff but mainly depends on framerate(both video and vbr audio). For a fixed bitrate, the higher fps the larger overhead.
MKV is vastly superior to AVI and AVI is old and problematic. Everyone already knew that.
I am afraid most people on doom9 know little about in what aspect MKV is superior to AVI. The author of AVI-MuxGUI wrote a really good article about this.
http://www.alexander-noe.com/video/amg/en_myths.html
Sharktooth
5th July 2010, 15:01
but still avi is not comparable to newer container formats in both support (yes, as i said even avi splitters do not support all the specs) and versatility.
also new gen encoders are not supported at all and require HACKS in the bitreams to be placed into AVI... those hacks sometimes may prevent to remux those streams in other containers without fixing them...
also AAC like audio streams cause a LOT of overhead and (as alex wrote in the faq) break the decoders... unless you store audio as video... ugly.
...
etc.
...
so, all in all, AVI is vastly inferior and there is NO major reasons to keep using it.
Midzuki
5th July 2010, 15:35
roozhou wrote:
AVI supports up to 2 audio streams but MKV has no such restriction.
Alex Noe's containers.pdf states:
3.2 Multiple Audio Streams
Don’t use Windows MediaPlayer. Also, if you are using AVI files, you have
to use Open-DML (and not AVI 1.0) if there are more than 10 streams in
the file. Otherwise, the flawed Microsoft AVI splitter won’t handle them.
Concerning MKV, don’t use Windows Mediaplayer either. :D
And, FWIW, from the same source:
4.5.1 AVI
In short: The Microsoft libraries for AVI file access are broken, in reading as well as in writing AVI files. Reading and Writing proper AVI files requires that other code is used, or that such code is build from scratch. The documentation available on AVI files is sufficient for that. Just a few examples of what is broken:
• Reading of AVI 1.0 files with more than 10 streams is broken
• Reading of Open-DML files with more than 1 audio stream is sometimes broken (and always broken with at least 4 audio streams) when the standard index blocks are too large
• Reading of Open-DML files with MP3 audio fails when the suggested buffer size for that stream is 0 (this is valid and is supposed to indicate that the reader/player has to determine a reasonable buffer size on its own)
• Playing an AVI file where the first chunk is a video chunk doesn’t work when the audio format is PCM
Ghitulescu
5th July 2010, 15:41
I have an 8GB Xvid/AC3 AVI which I have watched throughout and it plays perfectly.
I had once a ca. 60GB of an AVI holding DV video with LPCM audio :). So yes, for AVI 2.0 sky is the limit.
Sharktooth
5th July 2010, 16:02
i guess that had a lot of overhead... just remuxing to MKV you would have gained almost HALF GIGABYTE or more... plus, no problems with PCM audio ;)
poisondeathray
5th July 2010, 16:16
coz it's the only container available for TRUE streaming (not just progressive download ala youtube...)
FLV supports streaming
Sharktooth
5th July 2010, 16:28
yep but flv is proprietary... also it was meant to be the flash video container.
if it gets open and standardized it may become interesting.
roozhou
5th July 2010, 19:55
those hacks sometimes may prevent to remux those streams in other containers without fixing them...
Well, AVC in AVI uses annexb but AVC in MKV can use both annexb (in VFW compatible mode) or mp4 (in native mode). AVI "stores" re-ordered PTS while MKV stores the true PTS of each frame. If the muxer fails to tell the difference, it is not AVI's fault.
also AAC like audio streams cause a LOT of overhead and (as alex wrote in the faq) break the decoders... unless you store audio as video... ugly.
It adds ~6kbps to 48Khz lc-aac stream for AVI compared to MKV. Do you think 6kbps is a LOT of overhead?
Sharktooth
5th July 2010, 20:31
it IS AVI's fault coz it has crappy and messy specs and no-one implemented them completely/correctly.
also 6Kbps over 48kbps (AAC-HEv2+PS) is A LOT... it's 12.5% on a 32Kbps stream is 20%. as i said it all depends on the streams you're going to mux and the final bitrates.
wasting so much is unacceptable for me and since there are really much BETTER alternatives the problem is non existant. just drop AVI for better containers.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.