Re: [Cellar] Bug in Matroska spec?

Steve Lhomme <slhomme@matroska.org> Sun, 09 May 2021 07:24 UTC

Return-Path: <slhomme@matroska.org>
X-Original-To: cellar@ietfa.amsl.com
Delivered-To: cellar@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 98E323A1EB1 for <cellar@ietfa.amsl.com>; Sun, 9 May 2021 00:24:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.002
X-Spam-Level:
X-Spam-Status: No, score=0.002 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=matroska-org.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3hGRXvj6n6m2 for <cellar@ietfa.amsl.com>; Sun, 9 May 2021 00:24:43 -0700 (PDT)
Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CBA293A1EAE for <cellar@ietf.org>; Sun, 9 May 2021 00:24:42 -0700 (PDT)
Received: by mail-wm1-x336.google.com with SMTP id l24-20020a7bc4580000b029014ac3b80020so9396792wmi.1 for <cellar@ietf.org>; Sun, 09 May 2021 00:24:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=matroska-org.20150623.gappssmtp.com; s=20150623; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=54HG7K6KAOodbYUGKPDr7wwO3kOPoLhbVVWrQmqCuEE=; b=JQK/mY/eSkd5wWf8Rq4CJ7LtIDpRxoCytNYDwmp4KPZ4JC2WmTnd8qJVHYxQMSFv2x RNokxcvQHRjLehSkRm+hCS6bpM6cttzK1qJrR1bhYa5ovYFi3uJacUJWanpBwG6LTq5v sa84b44h4ZP5YZtyZD2wkDoc19L5ND26UU6LGdOTBoWavnY8YMjI/YyrJKepr0hHSu3z BLXetdI59wbAm1V212juEpsiDsQobeQHI3WM/kfej4aL3JgPbeX5m0eF9DF/gEzGaVf0 sbYrv47yOl9XXI5Lo9SePMLZoVRIdjs4AApTQ7fXCxt/KLo+FVKA62dMp8iwG8d1rbyB hkaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=54HG7K6KAOodbYUGKPDr7wwO3kOPoLhbVVWrQmqCuEE=; b=d4czqSETi9lDl0GySQWGQk2a5SBWFZ42RuzHJaRYVmL9TrF35X/G7Wsk0vwR/XpB8M RNGLkzz0lrL7+zOixxymNC78Rt5g5VAbgvAUGfr07TrObRoN4blu5ehGTg/oIO7V/K7c MOZRfiCO77DGfxFEdUd5lHa3kaXasaX94gjMP2K1OQXC3Bau7JLffJ5G3Z6QL7myqbLs jCZ53D8zAl3PJ2LrVqkgmeJ9FRy7fM3+nixjrQnzQuhJJe4WeS+BYkfDsH9JCSrnTIN6 wy2jtJ8AL9ABm3PRIFuNZ5HuXxZ45LO9qfdxvpF7dBlHjPrmkN/Na/V221x5FBMiJSH5 d3eQ==
X-Gm-Message-State: AOAM530o+RwBA/1P4BykkL72ndj9bZlF9hEr26yOIl2wXwZ/cKfBoHu9 8pTpZhJpVgnlqELoOhNxMeOVmZb8fJ1S7jXP
X-Google-Smtp-Source: ABdhPJwaC+BdmwF/1bTsjHIprmCnCvOcYnlFirC0r3Pv/jmhlsr8DnBgyzDyYlCXYeG7kmmkg4hTqA==
X-Received: by 2002:a05:600c:2f17:: with SMTP id r23mr30429692wmn.28.1620545075890; Sun, 09 May 2021 00:24:35 -0700 (PDT)
Received: from ?IPv6:2a01:cb0c:20:e900:d434:b5fa:81d:ef4d? (2a01cb0c0020e900d434b5fa081def4d.ipv6.abo.wanadoo.fr. [2a01:cb0c:20:e900:d434:b5fa:81d:ef4d]) by smtp.gmail.com with ESMTPSA id z66sm23375143wmc.4.2021.05.09.00.24.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 May 2021 00:24:35 -0700 (PDT)
From: Steve Lhomme <slhomme@matroska.org>
To: Paul Foley <paul@foley.gen.nz>, Codec Encoding for LossLess Archiving and Realtime transmission <cellar@ietf.org>
References: <e18ea8f5-3ae6-a709-a343-fc56e07c5e33@foley.gen.nz> <2bcf60e1-293c-8b51-d3ce-6ff8fe491336@matroska.org>
Message-ID: <05e0d9ab-8808-48b8-e13c-4bef90decce1@matroska.org>
Date: Sun, 09 May 2021 09:24:34 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1
MIME-Version: 1.0
In-Reply-To: <2bcf60e1-293c-8b51-d3ce-6ff8fe491336@matroska.org>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/eTuRJLFZurCk1ilYNpKR7t6I-PE>
Subject: Re: [Cellar] Bug in Matroska spec?
X-BeenThere: cellar@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Codec Encoding for LossLess Archiving and Realtime transmission <cellar.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cellar>, <mailto:cellar-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cellar/>
List-Post: <mailto:cellar@ietf.org>
List-Help: <mailto:cellar-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cellar>, <mailto:cellar-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 09 May 2021 07:24:48 -0000

On 2021-05-09 8:46, Steve Lhomme wrote:
> Hi Paul,
> 
> For discussions on the format, you should email the IETF mailing list 
> [1] which is still very active for Matroska, FFv1, etc.
> You can also raise issues on GitHub [2] [3].
> 
> I'm posting this reply to the CELLAR mailing list as we will need to 
> discuss your points further in the community.
> 
> On 2021-05-02 14:56, Paul Foley wrote:
>> EBML RFC 8794, Section 5 states that
>>
>>     The bits of the VINT_DATA component of the Element ID MUST NOT be all
>>     "0" values
>>
>> however, Matroska defines the ChapterDisplay element with id 0x80,
>> which, unless I'm very confused, has all "0" values in the VINT_DATA
>> component(!)
> 
> You are correct. That's a very good catch !
> Not sure yet how we can get around this issue. ChapterDisplay is a 
> widely used element. We should probably issue an errata on the IETF 
> spec. Even the IANA registry table is bogus in that regard...

Issue https://github.com/ietf-wg-cellar/ebml-specification/issues/407

>> [I wrote code to read and write EBML/Matroska based on the RFC and
>> parsing ebml_matroska.xml from
>> {https://github.com/ietf-wg-cellar/matroska-specification}, but had to
>> ignore the "not zero" rule, and add stuff to the xml file because it's
>> incomplete. Specifically, EditionFlagHidden 0x45DB, ChapterFlagEnabled
>> 0x4598, ChapterTrack 0x8F, ChapterTrackUID 0x89 are missing, and
> 
> These elements have been moved out as they are specific to control track 
> which are unused right now. See [4]
> This is not ideal for code generators though. The 2 XML files should be 
> concatenated before being processed.

Issue https://github.com/ietf-wg-cellar/matroska-specification/issues/509

>> TagDefault's element id was obviously changed from 0x44B4 to 0x4484
>> (typo?) at some point; I have many files written before the change ...
>> should there be there with maxver set?]
> 
> 0x44B4 is a bug in old versions of libavcodec. Or maybe that's not where 
> it originates but it's referenced there:
> #define MATROSKA_ID_TAGDEFAULT          0x4484
> #define MATROSKA_ID_TAGDEFAULT_BUG      0x44B4
> 
> Since we are putting in the RFC what is currently used, we should 
> probably add it in the XML as you suggest. Probably with a maxver="0" 
> making the element invalid in any case (it should have never been used). 
> But as for other such elements, it will be listed in the RFC with some 
> explanation on how to interpret it if it's found. [5]

Issue https://github.com/ietf-wg-cellar/matroska-specification/issues/508

> This value is not present in libmatroska so VLC and mkvmerge won't even 
> read the element when found.
> 
>> I also note that
>> {https://www.iana.org/assignments/ebml/ebml.xhtml#ebml-doctype} has no
>> registrations: surely "matroska" and "webm" ought to be registered.
> 
> They are mentioned in RFC text [6] but not in the IANA registry. This 
> issue was raised during the RFC editor phase but I can't find any answer 
> to this. My understanding was that the "matroska" would be added to the 
> registry once the RFC for Matroska is ready. And the "webm" one should 
> be done by WebM people.
> I think the word RESERVED would mean something else. But maybe I'm 
> wrong. Ultimately we will add the "matroska" one for sure.
> 
> Thanks a lot for your very useful feedback!
> 
> [1] https://www.ietf.org/mailman/listinfo/cellar
> [2] https://github.com/ietf-wg-cellar/ebml-specification/issues
> [3] https://github.com/ietf-wg-cellar/matroska-specification/issues
> [4] https://github.com/ietf-wg-cellar/matroska-specification/pull/461
> [5] https://github.com/ietf-wg-cellar/matroska-specification/pull/487
> [6] https://datatracker.ietf.org/doc/html/rfc8794#section-17.2