Log in

View Full Version : Why one container vs another?


aiannar974
6th May 2008, 01:07
why would someone pick mkv container vs avi or mp4 or any other container? Do all containers handle all formats?

thank you

anthony

Dark Shikari
6th May 2008, 01:15
Do all containers handle all formats?Nope, which answers your question ;)

unskinnyboy
6th May 2008, 01:57
You choosing a container should be based on your preference and needs, and not someone else's.

It depends on your platform, what you intend to put in it (video, audio and subtitle formats) and if the container supports it, and if there are enough tools available to work with the container on your platform. Also, be known that different containers have different overheads. See an overhead comparison here (http://www.alexander-noe.com/video/amg/en_overhead_comparison.html). If you are using Windows, and not looking for standalone playback, then Matroska is an excellent choice.

My personal order of preference would be MKV > MP4 > AVI > OGM, and I've used them all.

GIR
6th May 2008, 02:39
why would someone pick mkv container vs avi or mp4 or any other container?

I'm not sure I understand what you are saying, video data needs to be put in a container are you saying we should just let software randomly choose a container to put it in? Or are you saying we shouldn't put video/audio etc in containers at all? :confused:

aiannar974
6th May 2008, 02:47
no i am not saying anything should be random. but a container sounded just like a holder for other things (audio / video). so if it is a container what does the container have to do with format?

fibbingbear
6th May 2008, 04:30
one thing to note is that some containers cannot hold all types of data. For example, I believe that AVI cannot support variable bit rate sounds, so you're stuck with constant bit rates, which are less efficient. Some formats are supported on standalone players while others are not like unskinnyboy mentioned. I like MP4 because it seems to have just about everything that MKV offers, and works on some standalone players.

Dark Shikari
6th May 2008, 04:38
one thing to note is that some containers cannot hold all types of data. For example, I believe that AVI cannot support variable bit rate sounds, so you're stuck with constant bit rates, which are less efficient. Some formats are supported on standalone players while others are not like unskinnyboy mentioned. I like MP4 because it seems to have just about everything that MKV offers, and works on some standalone players."Just about everything" is a bit of an overstatement; it only supports two types of audio (no AC3, DTS, Vorbis, LPCM, DTS-HD, etc, etc), no notable subtitle formats, and only MPEG video formats.

Wilbert
6th May 2008, 07:50
For example, I believe that AVI cannot support variable bit rate sounds, so you're stuck with constant bit rates, which are less efficient.
Sure it does. Perhaps you are confused with variable framerate video?

Dark Shikari
6th May 2008, 08:02
Sure it does. Perhaps you are confused with variable framerate video?AVI doesn't support variable framerate audio (Vorbis) or variable bitrate audio. Both can be compensated for using ugly hacks; the hack for VBR is slightly less ugly than the hack for VFR audio though.

Sharktooth
6th May 2008, 14:11
another reason to choose MKV or MP4 over avi is OVERHEAD.
also MKV and MP4 supports other kind of streams (menues, subtitles, etc) while AVI is stuck to audio and video.
MP4 has even support for x3d objects, PIP, and other stuff...

SeeMoreDigital
6th May 2008, 15:59
AVI doesn't support variable framerate audio (Vorbis) or variable bitrate audio. Both can be compensated for using ugly hacks; the hack for VBR is slightly less ugly than the hack for VFR audio though.Indeed...

Plus VBR audio is poorly supported in hardware players :eek:

Shinigami-Sama
6th May 2008, 21:08
not to mention containers like ogg and mkv are open source and very flexible

Wilbert
6th May 2008, 21:31
AVI doesn't support variable framerate audio (Vorbis) or variable bitrate audio. Both can be compensated for using ugly hacks; the hack for VBR is slightly less ugly than the hack for VFR audio though.
According to Myths about AVI (http://www.alexander-noe.com/video/amg/en_myths.html) VBR audio in AVI is not a hack. I'm also very curious about what "variable framerate audio" means?

Dark Shikari
6th May 2008, 21:36
According to Myths about AVI (http://www.alexander-noe.com/video/amg/en_myths.html) VBR audio in AVI is not a hack. I'm also very curious about what "variable framerate audio" means?Storing audio as a video stream is a hack. It doesn't matter if its guaranteed to work; its using a feature in a way it wasn't designed for to bypass an inherent limitation, therefore its a hack.

Now, back to VFR audio. Because of the way Vorbis works, it not only has variable chunk size, but variable chunk placement in the stream. This is roughly the audio equivalent of video VFR.

GodofaGap
6th May 2008, 22:54
Storing audio as a video stream is a hack. It doesn't matter if its guaranteed to work; its using a feature in a way it wasn't designed for to bypass an inherent limitation, therefore its a hack.
This is a bit of a misinterpretation. Audio is only stored as a VBR video stream in the sense that a frame boundary is also a chunk boundary. That's not something that is disallowed, you can do that with CBR streams as well.

The problem with VBR audio in AVI comes with nBlockAlign and what it really means for non-PCM streams. More specifically, if chunks smaller than it should simply be disregarded, or treated as a complete block of data anyway. I don't know if there is a standardized way to interpret nBlockAlign for MP3.

But even if it is a hack, it's really a minor one. Whether you round up or down, you are going to have to deal with the situation one way or another.

fibbingbear
7th May 2008, 00:16
"Just about everything" is a bit of an overstatement; it only supports two types of audio (no AC3, DTS, Vorbis, LPCM, DTS-HD, etc, etc), no notable subtitle formats, and only MPEG video formats.

You're right Dark Shikari --- I should have said, "just about everything that I use."

Although I'm confused about the subtitle thing. I thought MP4 had a non-hack mechanism to format subtitles.

Dark Shikari
7th May 2008, 00:27
You're right Dark Shikari --- I should have said, "just about everything that I use."

Although I'm confused about the subtitle thing. I thought MP4 had a non-hack mechanism to format subtitles.MP4 has its own subtitle format, MPEG-4 Timed Text. Too bad nobody uses it.

Shinigami-Sama
7th May 2008, 03:18
This is a bit of a misinterpretation. Audio is only stored as a VBR video stream in the sense that a frame boundary is also a chunk boundary. That's not something that is disallowed, you can do that with CBR streams as well.

The problem with VBR audio in AVI comes with nBlockAlign and what it really means for non-PCM streams. More specifically, if chunks smaller than it should simply be disregarded, or treated as a complete block of data anyway. I don't know if there is a standardized way to interpret nBlockAlign for MP3.

But even if it is a hack, it's really a minor one. Whether you round up or down, you are going to have to deal with the situation one way or another.

its a hack like the same way using tables for design purposes is a hack in HTML
sure it works
but its meant to do that

GodofaGap
7th May 2008, 08:02
its a hack like the same way using tables for design purposes is a hack in HTML
sure it works
but its meant to do that
If both stem from poor documentation then the comparison holds yes. Kinda.

The thing is we don't really know if it's a hack, only that it can cause incompatibility as, not surprisingly, MS's parsers (AVIFile (VFW) and the DirectShow splitter) show opposing behavior. Limiting audio to do CBR only seems at least to be inconsistent though. Reading VBR audio is not more difficult than VBR video, and the way to store and signal VBR streams is defined.