Re: [Cellar] matroska and side data vs timecode

Steve Lhomme <slhomme@matroska.org> Sun, 24 November 2019 16:43 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 33C19120052 for <cellar@ietfa.amsl.com>; Sun, 24 Nov 2019 08:43:58 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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 GFr651PGDDd0 for <cellar@ietfa.amsl.com>; Sun, 24 Nov 2019 08:43:56 -0800 (PST)
Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (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 51BEC120043 for <cellar@ietf.org>; Sun, 24 Nov 2019 08:43:56 -0800 (PST)
Received: by mail-pj1-x1032.google.com with SMTP id m71so5322613pjb.12 for <cellar@ietf.org>; Sun, 24 Nov 2019 08:43:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=matroska-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rf+5yuWr0+wJ+p35Hn+BFtqWrhkSJPgofoXy89wxqQM=; b=JpUb7eZLYL3MEFBcPLGKax5ish1Knn+8GpQe363UpJrgXLwsyPzO5Gyq+r7fWf2RH7 22YZFf9XNEAvo7lhUuy6O2OVCgj8Hc2kC64matP3Cp+uA+/mXI3+vR/FU9Icn1Ryw+qe 8xpWQnBuo4V8QokjrYUGXdSiIjbp0lm3CQgOuHKtkna73ZdXJ+N02G6pAsGyuaWnAbyr x41xPvPW0ZtmQ05DttbEmtBjEqfAjsa5LYdh9n6X2UqvAySwlAW20lMLFCX9eglFg1Ja Mov38xAHzv6b62fsx/tdwLSsRGMhoJ92g5uB/Gw9C9Umi3ehj31o4bP1XjxN3Bg5hvG5 wFjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=rf+5yuWr0+wJ+p35Hn+BFtqWrhkSJPgofoXy89wxqQM=; b=FTgGitzUWAjKDaCQtn7SudMP4SFvbgqp94zQGG/1vs9/PnfjdxZZKOg/EdjHODZ5c1 sumcGY8pDSoFsmlabJ969Z7vn0kt6YSoiIzRyGTFYmnvBf9GaO1CAaGQ/yK0UTg0VpPC PCWzIJylZESajn/ZSw8+sw/xFHTOAbHMY35x/VRVdOB2GCX75mRrwfUzULUysNKB/WC4 GNt/xQHiFBAHDel+Ten6MJK0An57c9XsEc1avrnyGY3Z8SWkrM3+rin5/k7gaDfc7bS8 G+VPbBxUFuOhkCu+E+668bg01bINw5pym/uiyATNTZXtsrnMdr82IzwHrPjEoUj9BuO4 PSvA==
X-Gm-Message-State: APjAAAXAsM8jB0PjXZ808dKEwZDQ0ZVK55Hf7fcwRr7u1tc5c78ekuUt u2jN6MlB2rIN1IhOSIRS3uIm0QfPnp09SI3jr4grXA==
X-Google-Smtp-Source: APXvYqzFRXWKv3vZbsfkeDjlsrjogdCIfUPVKEZ7YMvRwKlE1wl/FdNsNplyGHxnlT/zbWeN79+3x9TxZSIgd+Zw61A=
X-Received: by 2002:a17:902:8c84:: with SMTP id t4mr24336973plo.269.1574613835308; Sun, 24 Nov 2019 08:43:55 -0800 (PST)
MIME-Version: 1.0
References: <00F6A0BF-2922-4BAC-AC73-EB888767886F@dericed.com> <CAOXsMF+_zZjKS9GRjBhpQMQ5dbQK04hph5x5o8UJjj5ngkaaMA@mail.gmail.com> <03b98f95-f426-24a9-be2b-d8cc4ab4ef65@noa-archive.com> <7B1163E2-FCD5-446C-8430-34F94E165101@dericed.com>
In-Reply-To: <7B1163E2-FCD5-446C-8430-34F94E165101@dericed.com>
From: Steve Lhomme <slhomme@matroska.org>
Date: Sun, 24 Nov 2019 17:43:44 +0100
Message-ID: <CAOXsMFLFkKB20tdVkC+bH+692q4LT8Wg4SeOOWA-vfAhLtZ9Qg@mail.gmail.com>
To: Dave Rice <dave@dericed.com>
Cc: Tobias Rapp <t.rapp@noa-archive.com>, Codec Encoding for LossLess Archiving and Realtime transmission <cellar@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/3KHVSSo5kA_vTXkRwyTgnik9Xu4>
Subject: Re: [Cellar] matroska and side data vs timecode
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, 24 Nov 2019 16:43:58 -0000

Le jeu. 21 nov. 2019 à 16:03, Dave Rice <dave@dericed.com> a écrit :
>
> Hi all,
>
> > On Nov 5, 2019, at 2:51 AM, Tobias Rapp <t.rapp@noa-archive.com> wrote:
> >
> > On 03.11.2019 11:29, Steve Lhomme wrote:
> >> [...]
> >> If you want something that will survive this scenario you have to tie
> >> this value to the first timestamp. When remuxing, if timestamps are
> >> altered of portions at the beginning of the file are removed, you need
> >> to edit the first timecode. It may be better to store in the TrackInfo
> >> with both the first timestamp and timecode values. It may not work
> >> when stripping the audio (as Tobias pointed out). So it may even be
> >> put in the SegmentInfo instead of the TrackInfo.
> >
> > It looks tempting to put timecode information inside the video track as they share the framerate as a common property. But in my opinion it would be cleaner to just copy that framerate info into the timecode value structure. For storing a single TC offset using an element in SegmentInfo sounds good.
>
> From the discussion, there seems to be three approaches for timecode in Matroska:
>
> 1. a single TC offset
> I proposed having this as a metadata tag, but you’re suggestion to have the value in Segment Info is interesting. I think the advantage of having it as a metadata tag is that ffmpeg’s current handling of (ffmpeg -i timecode.mov output.mkv) would be retroactively valid, whereas a single offset in SegmentInfo would require implementation work.

But usually tags are not considered/parse in most playback systems. If
you need information to playback things correctly (ie display the
proper TC) it should be either in Segment Info, Track Info or
Clusters. The Timecode may fall in the metadata category and may not
be included in there. Also using tags would only work if we adopt
exactly the solution already in use by ffmpeg. What tag does it write
exactly ? (name, kind of value, target for the tag)

> 2. frame side-data
> This allow the timecode (and any other side data) to be stored with the frame in the Block structure.
>
> 3. a timecode track
> I imagine this would be a track of Clusters where each block contains an encoded timecode value where the block structure associates the timecode to a timestamp.
>
> Each of these have advantages and disadvantages in terms of simplicity, implementation, seekability, and resilience; however we do not necessarily have to select only one. All three approaches could be defined if we document how these options supersede one another.
>
> I’m curious if other would consider it important to favor limiting the number of approaches listed above. I would prefer to proceed with refinement to options 1 and 2 concurrently. I’m less interested in option 3 since timecode is typically used to describe the contents of another track rather than serve as an independent piece of data.

That sounds like something we can discuss a No Time To Wait.

> >> You may also set the value in Chapters (which are not tied to a
> >> track). There's already a start timestamp. You could add the timecode
> >> for this timestamp. That works for NLE sources as well, each
> >> non-linear part would be a chapter with its timestamp translation. A
> >> good NLE system would also tag this chapter with all kinds of data
> >> about the source. (Matroska was also designed for this case in mind).
> >
> > Setting up a timestamp/timecode mapping via Chapters for non-continuous timecode situations looks like an even better solution than using a dedicated timecode track as this structure should represent the timeline for players.
>
> I’m uncertain how this would work, do you mean to use ordered chapters to place the content along a timeline according to the source timecode? This may not work if multiple frames in a track all share the same timecode value, such as when a tape is shuttled during a duplication process or contains resets within the timecode track.

Not necessarily ordered-chapters. A chapter already has a mandatory
start time, it could have one Timecode to define what that start time
corresponds to (or more variants of Timecode for the same start time).
Technically that means you could have on Chapter per frame to match
it's time exactly with a timecode, that would be a dirty hack.

As for reset in tapes, After a reset you should use a different
Segment. If there are just gaps of time between continuous takes, you
can use on Chapter start/timecode after each discontinuity.

> […]
>
> Dave Rice
> _______________________________________________
> Cellar mailing list
> Cellar@ietf.org
> https://www.ietf.org/mailman/listinfo/cellar



-- 
Steve Lhomme
Matroska association Chairman