What does Matroska have which WebM doesn't, that made the differentiation necessary?

61

13

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.

einpoklum

Posted 2018-01-02T14:29:42.613

Reputation: 5 032

Answers

118

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.

user1686

Posted 2018-01-02T14:29:42.613

Reputation: 283 655

9FYI, MP4 containers are actually quicktime .moov files with restricted set of allowable codecs – slebetman – 2018-01-03T01:58:13.877

@slebetman: Isn't it the other way around? – einpoklum – 2018-01-03T21:54:37.083

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 – 2018-01-04T02:44:41.430

11

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.

szatmary

Posted 2018-01-02T14:29:42.613

Reputation: 2 181

3But 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 – 2018-01-02T16:56:47.173

That was an option. Somebody at google chose a different option. I don’t think it’s more complex than that. – szatmary – 2018-01-02T17:01:31.477

1There is more now: VP8 and VP8 for video and Vorbis and Opus for audio. – Vi. – 2018-01-03T22:42:22.067

2@Vi.: I'm guessing you meant VP8 and VP9? – einpoklum – 2018-01-03T22:54:37.387

1Yes. – Vi. – 2018-01-03T22:57:03.110

And now AV1 as well. So VP8, VP9, AV1, Vorbis, and Opus. – Yay295 – 2019-03-18T13:21:20.180