Slashdot Mirror


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."

36 of 54 comments (clear)

  1. Variable frame rate? by snubber1 · · Score: 1

    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 //..
    1. Re:Variable frame rate? by Drantin · · Score: 1

      Look again, he said variable BIT rate, XVID allows you to set a different bit rate for credits at the beginning and end of a video, it also allows you to set the color to black and white for those periods...

      --
      Actio personalis moritur cum persona. (Dead men don't sue)
    2. Re:Variable frame rate? by Drantin · · Score: 1

      Never mind...

      --
      Actio personalis moritur cum persona. (Dead men don't sue)
    3. Re:Variable frame rate? by NanoGator · · Score: 1

      So you can merge two videos together from different sources without having to recompress them.

      --
      "Derp de derp."
  2. I must disagree by DemoLiter3 · · Score: 3, Informative

    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.

    1. Re:I must disagree by Alereon · · Score: 1

      AVI doesn't support VBR audio. AVI doesn't support seeking within the file well. AVI is bloated. AVI isn't very extensible. AVI isn't fault tolerant. AVI doesn't support very large files.

    2. Re:I must disagree by DemoLiter3 · · Score: 1

      I can only agree about B-frames and VBR audio - AVI container format is only designed to support keyframed/deltaframed video and constant bitrate (or rather byterate) audio.

      But support for multiple audio tracks and subtitle tracks is not in any way a hack! AVI header and index table support description of multiple streams, not just 1 (video only) or 2 (video+sound). Subtitle tracks ( '00tx' ) are also defined in the standard.

      The fact that only few tools were supporting these features, or didn't do it right doesn't mean these container features did never exist.

    3. Re:I must disagree by DA-MAN · · Score: 1

      > AVI doesn't support VBR audio. AVI doesn't support seeking within the file well. AVI is bloated. AVI isn't very extensible. AVI isn't fault tolerant. AVI doesn't support very large files.

      Sounds like everything else Microsoft put out!

      --
      Can I get an eye poke?
      Dog House Forum
    4. Re:I must disagree by Alereon · · Score: 1

      AVI DOES support VBR audio. I have and have made AVI files with VBR.

      It most certainly does NOT. By exploiting a bug in the Microsoft video renderer, it is possible to play an AVI file with VBR audio straight through without loss of synch. However, you CANNOT seek within this file, it will not play in synch on other platforms, and is not a standards-compliant AVI.

      As for the rest of your nonsensical points, fault tolerance is a function of how robust the format is. The Ogg container format has significantly lower overhead than AVI, and is MUCH more fault tolerant. Multiple audio streams have been covered elsewhere. So no, AVI won't do what he want, and it is pretty damn crappy. Nice troll, though.

  3. Media Containers... by phraktyl · · Score: 2, Funny

    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)
  4. Aspect ratio by keesh · · Score: 1

    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...

    1. Re:Aspect ratio by ChristianHJW · · Score: 1

      matroska can do that fine, just compile mplayer with matroska suport and tag the display AR of your files in mkvmerge when muxing them .... works like a charm ...

  5. MPCF = MPlayer Container Format by mikecheng · · Score: 2, Interesting
    I followed the discussion of a "better" universal a/v container format with interest in Feb/Mar 2003 on the mplayer mailing list.

    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.
  6. AVI does support multiple audio tracks by reynaert · · Score: 2, Interesting

    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.

  7. Quicktime. by Pathwalker · · Score: 1
    Seriously - look at the QuickTime .mov format.

    1. It's well documented.
    2. Subtitles are easy with text atoms.
    3. It supports variable bit and frame rates.
    4. It can be hinted for rtsp streaming via the Open Source Darwin Streaming Server.
    5. They have an Index for fast seeking in large VBR files.
    6. 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...
    1. Re:Quicktime. by Anonymous Coward · · Score: 1, Interesting

      Interesting, mov container supports more features than I was aware of. As a guess for why people don't use it more - lack of free, easy to use muxing utilites. I'm not aware of any, if you can link to any for windows or linux platform it'd be nice. As an example of why I like matroska - last week I took an HDTV transport stream, demuxed the video and audio parts, resized and reencoded the mpeg2 video into xvid (didn't feel the need to store 18mbps mpeg2 video that was at a res bigger than my monitor -_-), left the aac audio untouched, made a quick sub script for it, and then muxed it all together into a matroska file with proper audio pre-delay. All fairly easy to do with free video tools I'm already familiar with. If there's tools out there to allow making a mov file with all the same features and an easier to use interface, great ^^

    2. Re:Quicktime. by RalphBNumbers · · Score: 1

      Um... It sounds like the only thing you actually used matroska for was muxing the final file.
      Quicktime is quite capable of taking a Xvid video track, an AAC audio track, and a properly formated text track and rolling them into a movie with nothing more than Quicktime Player, so it can be used for what you just did.

      Of course, it could have been used for much of the rest of the process too.

      Hell, Apple even provides a tool to get the MPEG2 transport stream off your HDTV receiver in their firewire dev tools.

      Unfortunately, the "easier to use interface" isn't guaranteed, apple has never really bothered to put an end-user-UI-polish on alot of the more obscure Quicktime features.

      --
      "The worst tyrannies were the ones where a governance required its own logic on every embedded node." - Vernor Vinge
  8. Re:Anime, for one by Bastian · · Score: 1

    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.

  9. Mpeg4 or perhaps MOV by Zorton · · Score: 2, Informative

    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

  10. Ask Doom9 by DeadMeat+(TM) · · Score: 2, Insightful
    Doom9's "New A/V Formats" forum is a good place to ask; besides the FAQs, there's a ton of technical expertise there (the programmers of OGM and Matroska filters and muxers sometimes hang about to answer technical questions).

    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.

    1. Re:Ask Doom9 by ChristianHJW · · Score: 1

      The current OGM filters have a built in audio stream switcher, but as a result of that you can only use audio streams of the same sampling rate and channel number in it ... no way to mux a 5.1 AC3 and a 2.0 Vorbis in the same file and play it fine .... matroska can do that, but you need mplayer, MPC, BSplayer, TCMP or VLC to be able to switch the streams during playback ...

  11. QuickTime? by RevAaron · · Score: 2, Insightful

    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
    1. Re:QuickTime? by DA-MAN · · Score: 1

      .MOV sounds like a spectacular container for video and audio, however all the problems are in the Quicktime Player. Let's face it, it just sucks. Video doesn't always appear when it should, scanning through videos takes forever, and it's got nagware. The need to use QT Player, in plugin form or otherwise, is what keeps this shit from spreading.

      --
      Can I get an eye poke?
      Dog House Forum
    2. Re:QuickTime? by DA-MAN · · Score: 1

      Why bother, I can do what I want in AVI. I'm not the one who asked this AskSlashdot question. I was replyin' to RevAaron as to why most people don't use .MOV.

      The player sucks, not many tools for .MOV unless your on a Mac. Why would it catch on...

      Like I'm gonna sit down and waste my time writing a better Quicktime player because a lame AC told me to....

      VirtualDub and TMPGenc can do some amazing things with very little knowledge. I'll stick with good ol' AVI/MPG.

      --
      Can I get an eye poke?
      Dog House Forum
    3. Re:QuickTime? by DA-MAN · · Score: 1

      Wrong discussion, but right thread.

      > I'm not the one who asked this AskSlashdot question. I was replyin' to RevAaron as to why most people don't use .MOV.

      This was what I did, answer a question for RevAaron.

      I wasn't participating with a general discussion about much else, but you damn AC's keep bringing me in! Like I said, I don't care. AVI works for me, Quicktime sucks for me. It a naggy piece of shit!

      --
      Can I get an eye poke?
      Dog House Forum
    4. Re:QuickTime? by ChristianHJW · · Score: 1

      In Quicktime you cant store AAC Vorbis RealVideo 9 RealAudio SRT subs SSA subs vobsub subs while matroska does support all fo that fine ...

  12. Try Quicktime or MPEG-4 by RalphBNumbers · · Score: 2, Insightful

    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
  13. Re:Why bother? by cookd · · Score: 1

    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.
  14. Why AVI is bad by InfoCynic · · Score: 1

    (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"

  15. Re:.WMV?? by Goldberg's+Pants · · Score: 1

    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.

  16. Yes AVIs do support multiple audio tracks. by ClioCJS · · Score: 1

    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
  17. ASF by Joe+Tennies · · Score: 1

    I don't know how good an ASF file is overall, but I know it supports multiple frame rates.

  18. One word: by jo42 · · Score: 1

    XML!

    1. Re:One word: by ChristianHJW · · Score: 1

      matroska backbone, EBML, is a binary form of XML ;) http://sf.net/projects/ebml , but we didnt update the CVS for a long time, the latest version of EBML and the specs are to be found on http://www.matroska.org ...

  19. Re:.WMV?? by nutsy · · Score: 1

    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.

  20. Only thing matroska lacks is hardware support .... by ChristianHJW · · Score: 1

    ... 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