Re: [Cellar] matroska and side data vs timecode

Dave Rice <dave@dericed.com> Thu, 21 November 2019 15:03 UTC

Return-Path: <dave@dericed.com>
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 4AB8312081F for <cellar@ietfa.amsl.com>; Thu, 21 Nov 2019 07:03:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.119
X-Spam-Level:
X-Spam-Status: No, score=-1.119 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
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 S0DTtLRCJPcm for <cellar@ietfa.amsl.com>; Thu, 21 Nov 2019 07:03:28 -0800 (PST)
Received: from server172-3.web-hosting.com (server172-3.web-hosting.com [68.65.122.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 93BA81200E7 for <cellar@ietf.org>; Thu, 21 Nov 2019 07:03:28 -0800 (PST)
Received: from [146.96.19.240] (port=42464 helo=[10.10.201.20]) by server172.web-hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <dave@dericed.com>) id 1iXnzO-0035Ff-DY; Thu, 21 Nov 2019 10:03:26 -0500
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\))
From: Dave Rice <dave@dericed.com>
In-Reply-To: <03b98f95-f426-24a9-be2b-d8cc4ab4ef65@noa-archive.com>
Date: Thu, 21 Nov 2019 10:03:20 -0500
Cc: cellar@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <7B1163E2-FCD5-446C-8430-34F94E165101@dericed.com>
References: <00F6A0BF-2922-4BAC-AC73-EB888767886F@dericed.com> <CAOXsMF+_zZjKS9GRjBhpQMQ5dbQK04hph5x5o8UJjj5ngkaaMA@mail.gmail.com> <03b98f95-f426-24a9-be2b-d8cc4ab4ef65@noa-archive.com>
To: Tobias Rapp <t.rapp@noa-archive.com>
X-Mailer: Apple Mail (2.3445.104.8)
X-OutGoing-Spam-Status: No, score=-2.9
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server172.web-hosting.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - dericed.com
X-Get-Message-Sender-Via: server172.web-hosting.com: authenticated_id: dave@dericed.com
X-Authenticated-Sender: server172.web-hosting.com: dave@dericed.com
X-Source:
X-Source-Args:
X-Source-Dir:
X-From-Rewrite: unmodified, already matched
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/IQpWvbNgrOoP5K-odndjSdKFb2U>
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: Thu, 21 Nov 2019 15:03:30 -0000

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.

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.

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

[…]

Dave Rice