Better Media Container Formats?
altaic asks: "Today I was looking for a container format to store my anime collection (multi-language audio and subs), and I discovered popular media containers actually suck. AVIs are a hacked mess and don't even support multiple audio tracks. OGMs are catching on, but they don't have an index, nor do they support variable framerates (the fps value is stored in the header). I found some info on the Matroska container, which looks really cool (it supports multiple subtitle streams, multiple audio streams, a slew of other nice features), as well as the very young MPCF (mplayer container format). I'd really like to hear about other people's experiences with newer, more useful media containers."
Now, I understand the value in variable bit rates for efficency's sake. Unless I am wrong OGM supports supports VBR just fine. Now what would the use of variable frame rate be? Virtuall all video I can think of operates at a set frame rate for given display formats. (Mabye I'm just ignorant but hey, that seems useless)
I don't really mind double posts on
Multiple audio tracks AND multiple subtitle tracks can be muxed into AVI and play very well.
You'll need only these 2 tools to achieve this:
VobSub and MMSwitch
VobSub package contains the SubMux utility for muxing an AVI video, multiple audio tracks and subtitle files (in SRT, SUB, SSA and other formats) into AVI. MMSwitch will allow separate playback and easy selection of multiple audio tracks in any media player based upon DirectShow graphs, WMP for example.
In WMP, audio tracks and subtitle tracks can be then easily selected via context menu.
Well, if they are CDs you don't really care about, you can store them on a CD spindle. Otherwise, the old 5 1/4" floppy containers work fairly well.
You can also get some fairly nifty CD storage racks, like This one.
Oh, wait... You were talking about... Never mind.
Karma: Marginal (mostly due to the border around the website)
Please, just give me a file format that doesn't require me to do -aspect x:y whenever I launch mplayer... I'm trying to stick my dvd collection onto HDD (easier for moving between home and university) and it's driving me insane...
It was first raised in Feb2003 here.
The conversation died for a while, and then it was brought up again in March. (Although the conversation seemed to get bogged down on selecting a name for the format).
The format description is now included in the DOCS/tech directory of the mplayer tarball. Not sure whether any of it's actually implemented in the mplayer code.
Cool, but useless.
It may be that most media players can't deal with it, but the AVI format certainly supports multiple audio tracks, and it always has, as Google confirms. BTW, have you looked at MOV (QuickTime)? It's better than AVI, and it is better known than the other formats you list.
- It's well documented.
- Subtitles are easy with text atoms.
- It supports variable bit and frame rates.
- It can be hinted for rtsp streaming via the Open Source Darwin Streaming Server.
- They have an Index for fast seeking in large VBR files.
- They support as many audio and video tracks as you want.
Seriously - I don't know why more projects don't use it, it seems perfect to me...A lot of Animes are made with a philosophy of minimal cell count, so they will drop the frame rate at which the film is made in spots where they can get away with it. For stuff like this you could probably save a lot of space using variable frame rates.
Take a look at mpeg4. On my machine (OS-X) I use a program called OpenShiiva (http://openshiiva.sourceforge.net/) to dump DVD's. It uses mpeg4 for the container and Xvid or 3vix/AC3 for the audio-video stream. As far as changing frame-rates on the fly I don't know if that type of thing is in the spec or not. As far as subtitles and multiple audio streams I think it will work just fine. However I'm not an expert so feel free to correct me on this. Nice thing about mpeg4 is the mpeg standard. Hopefully you will be able to encode with either Xvid,Divx,3vix,Apple or M$ and playback on any mpeg4 complaint player. Once again your millage may vary, i've read in the 3vix forum that Xvid isn't quite mpeg4 complaint and I would imagine most of the other codecs have similar idiosyncrasies.
On the other hand there is Mov or Quicktime. This format is very mature and will play on most anything that Quicktime supports. It does allow for subtitles and multiple audio streams.
Although I think ogm is the container of choice for anime lovers....
Zorton
The quick-'n'-dirty answer is that, as long as you've got muxers and demuxers for the formats you're working with, converting from one container format to another is generally lossless, so you don't really need to worry about losing data to an obsolete format. In this layman's opinion (I'm not an A/V software programmer, but I play one on Slashdot), Matroska looks like a good choice here, since you can mux practically everything under the sun into a Matroska file. But be warned that practically-speaking not all of the existing Matroska filters recognize data like chapters; in contrast, formats like OGM may not support as much metadata, but the existing filters generally recognize all of it.
What about QuickTime? The format seems to be open, or at least known in various Free software libraries so that working with it is doable. You can use any number of codecs within a QT file, though.
And no, QT isn't one codec. There have been issues in the past about QT support on OSes like Linux- but that was because of a lack of support for the Sorensen codec that QT can use.
What are the limitations of QT? What does it do better or worse than AVI or the others? Myself, I've no clue, but would be intersted in finding out...
Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
They're practically the same thing in terms of container formats, and they're so extensible it isn't even funny.
Want multiple overlapping video tracks, various text tracks (perhaps one for each language, with the machine auto selecting, or asking the user if you want), SMIL support for web integration, sprite tracks, static picture tracks, built-in realtime effects, user interaction, chapter markers, searchable subtitles, etc?
It's all there, and *MUCH* more. most of people don't have a clue how absurdly versatile that format is, it's done everything you've asked for 'since the '90s.
"The worst tyrannies were the ones where a governance required its own logic on every embedded node." - Vernor Vinge
Yes, and that is what Variable Bit Rate / Variable Frame Rate is all about. Without VBR, the encoder knows "I have 192 Kbits (or whatever) to fill for this second of video." At some point where there is a lot of motion, the encoder has to cut the quality to make it all fit in 192 Kbits. Another time, where it is just 10 seconds of a single cel of some character pondering why girls are the way they are (or whatever), the encoder has 1920 Kbits that it doesn't know what to do with -- perhaps make that one frame look really really nice?
This is a good thing in some situations. Rationing the bandwidth allows you to make fairly good predictions about how much space the file will take on disk, or to properly get the data streamed in real time over the network. Predictability is a nice thing.
So VBR says that you're willing to trade a little bit of predictability in data rate for improved allocation of that bandwidth. More bandwidth is used for parts of the video that are hard to compress well. Less is used where less is going on. Overall, the result is usually somewhat better than you would have gotten if you were limited to a single bitrate. The disadvantages are: it is a bit harder to encode quickly when you add the task of figuring out how to allocate the bandwidth; sometimes the accuracy of your requested file size goes down (I asked for 192Kbits, but got more like 213Kbits), or the video bogs down during the action scenes when you're viewing it over the net.
Time flies like an arrow. Fruit flies like a banana.
(Not a comprehensive list ;)
You CAN do 2 audio streams in AVI, just like you CAN do VBR MP3 in AVI, but it's not a good idea. By default, most media players will render both audio streams simulatenously, which is not what you want, unless the user has a filter like Morgan's Stream Switcher installed or uses an advanced player like BSPlayer or ZoomPlayer.
Using VBR MP3 in AVI requires the well-known "Nandub hack" now available in a few other programs as well. AVI is NOT designed to handle VBR audio formats, and it's time to let the format die.
If you mux subtitles into an AVI, I don't know that you can, for instance, move them into the area of the display below the video when running fullscreen if you have a widescreen movie.
MKV (Matroska) and Ogg (they don't officially recognize OGM) are good options because they support multiple audio streams easily and their filters are designed for it. VBR isn't a problem either... try seeking in a file using MKV or OGM and you can see that the audio and video stay right in synch from the moment you jump. With AVI, you're usually waiting until the next keyframe for them to get it in step. Furthermore, when you do mix multiple languages (audio or subtitle), you can encode a description with them, so you know which track is which language, a nice bonus. Lastly, both formats have less overhead than AVI, about 5-8 MB in 90 minutes or so, I forget the exact numbers, but that's more space you can use for your video if encoding yourself.
Don't forget they're all backwards compatible too... it's easy to pull the streams OUT of an MKV into their component parts and mux them back into AVI if you want (but you will take up more space, and I've never heard of AVI with 3+ audio streams).
"Recta non toleranda futuaris nisi irrisus ridebis"
But it's a shit codec! In fact it's second on my list of codecs I despise.
Think I despise it because it's MS and therefore evil? Guess again. My most despised codec is XVID, an open source project. XVID is a total mess. There's god knows how many versions floating around, it's impossible to do a straight MPEG conversion in TMPEG without first re-encoding the video (a problem which has never occured for me with ANY OTHER codec), the quality isn't that great...
OGM isn't bad, though the conversion process is increased due to the lack of programs that actually support converting OGG to other formats.
Sadly, DIVX is the best around right now, and with various people in Hollywood making ovations toward them, DIVX will, I think, become the standard.
I have many, many AVIs with multiple audio tracks. You just need to install the Morgan StreamSwitcher plugin. It's great for dvd rips with audiocommentary.
-Clio
Karma: Bad (mostly from not giving a fuck)
Blog: http://clintjcl.wordpress.com
I don't know how good an ASF file is overall, but I know it supports multiple frame rates.
XML!
Yes, the Windows Media Video family of codecs are rather crocky (although I think it's more due to the decoders than to the nature of the encoding; the decoders tend to make everything look blotchy and posterised), but you can store most any sort of video stream in a WMV (that is, ASF) stream that you like.
Quick rundown of WMVs I have lying around:
MP43, wmav2
VDOM, mp3
WMV1, wmav2
WMV2, wmav2
WMV3, wmav2
So while the different flavours of the Windows Media Video codecs are common, they aren't universal. As for that VDOM codec, I've never been able to get it to play so I don't know what in the world that one is.
... and we are already working on this, together with a very well respected company doing MPEG4 players. Dont expect it in the near future though, current decoder chips like the SIGMA EM 8550 are not powerful enough to decode MPEG4 video and Vorbis audio at the same time, and this is the most used profile in matroska files, followed by MPEG4 video and AAC audio ( together with SRT or SSA subs ) and RealVideo9 and Vorbis audio. Soon we will launch the latest features for matroska files, that will be the ability to store DVD subtitles ( vobsub's ) in MKV without the need to OCR them, and then MPEG2 video is the next on the list, so you can mix your SVCD video with Vorbis audio tracks :P ...
You are invited to visit us on irc.corecodec.com #matroska for more information
Christian
matroska project admin
http://www.matroska.org