69

I've read that WebM is essentially a subset of the Matroska format. What does Matroska support that WebM doesn't, which necessitated "christening" a new format rather than just saying "WebM = Matroska with a restricted set of codecs used"?

I'm wondering whether I should just convert my WebM's to Matroska and be done with it, and due to general curiosity.

0

2 Answers 2

128
+50

necessitated "christening" a new format rather than just saying "WebM = Matroska with a restricted set of codecs used"?

That's really exactly what WebM is – not a new format, just a subset of Matroska. But the name is an important part as well.


Matroska is a container. (A very flexible container at that.) Having a .mkv file tells you nothing about what it contains: it might have VP9 video, or H.264 video, or MPEG-2 video, no video, or indeed multiple kinds of video at once. It can carry many different audio codecs, different subtitle types, links to external chapters, and file attachments (such as fonts for SSA subtitles).

Most MKV files contain the same usual formats, but some people are creative and others will just accidentally make MKV's which half their visitors cannot play. Slides and video from a Vimeo developer's talk about the horrors their users have uploaded.

(In comparison, MP4 containers are somewhat more limited in what audio/video codecs they can carry, and in practice usually have some kind of MPEG-4 video.)

So the point of WebM is to define a few "standard" combinations, which will then have a very good chance of being supported by any web browser (and standalone player).


So back to the name. If you have a .webm file (and if the source claims it's a valid WebM file), you can tell just by looking at its name that it promises to contain something understandable by any WebM player, as required by the WebM spec.

But if it were just a plain old limited Matroska profile, you'd still have a .mkv and you wouldn't know what's in it, nor whether it's usable for <video> tags and such.

You don't need to convert WebM files to Matroska; they are valid Matroska files so it's enough to rename them to .mkv.

4
  • 10
    FYI, MP4 containers are actually quicktime .moov files with restricted set of allowable codecs
    – slebetman
    Commented Jan 3, 2018 at 1:58
  • @slebetman: Isn't it the other way around?
    – einpoklum
    Commented Jan 3, 2018 at 21:54
  • 4
    @einpoklum The quicktime file format is extremely flexible and has been used for non-conventional things like containing multimedia apps (kind of like Flash). MP4 added extensions to the quicktime format but quicktime has always been extendable anyway
    – slebetman
    Commented Jan 4, 2018 at 2:44
  • "...[you can simply] rename [a .webm file] to .mkv..." Maybe that was obvious to most people, but somehow in all my wanderings I never managed to figure that out. +50 Commented Jun 3, 2021 at 5:29
12

For clarity, simplicity and standardization. Matroska supports hundreds of codecs. WebM supports 1 video and 1 audio (or is there more now?). So if I (or a computer program) ask “can you play webm” you can give a yes or no answer. If I ask “can you play matroska” you can’t give an easy answer that is useful. So saying webm is a sub set, yes you are correct. But its usage communicates way more information and can guarantee support.

6
  • 3
    But the answer to "can you play Matroska?" is never "yes", it's at best "yes, if I know the codecs"; so why can't we just say "webm = matroska with vp8 and vorbis"?
    – einpoklum
    Commented Jan 2, 2018 at 16:56
  • That was an option. Somebody at google chose a different option. I don’t think it’s more complex than that.
    – szatmary
    Commented Jan 2, 2018 at 17:01
  • 1
    There is more now: VP8 and VP8 for video and Vorbis and Opus for audio.
    – Vi.
    Commented Jan 3, 2018 at 22:42
  • 2
    @Vi.: I'm guessing you meant VP8 and VP9?
    – einpoklum
    Commented Jan 3, 2018 at 22:54
  • 1
    Yes.󠀠󠀠󠀠󠀠󠀠󠀠
    – Vi.
    Commented Jan 3, 2018 at 22:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .