Re: [Cellar] matroska and side data vs timecode

Tobias Rapp <t.rapp@noa-archive.com> Tue, 26 November 2019 08:31 UTC

Return-Path: <t.rapp@noa-archive.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 2FE3212081B for <cellar@ietfa.amsl.com>; Tue, 26 Nov 2019 00:31:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham 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 1sgZuDyKySOm for <cellar@ietfa.amsl.com>; Tue, 26 Nov 2019 00:31:06 -0800 (PST)
Received: from mx01.mail.netstorage.at (mx01.mail.netstorage.at [IPv6:2a02:2410:b000:101:3000::c]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9955312003F for <cellar@ietf.org>; Tue, 26 Nov 2019 00:30:40 -0800 (PST)
Received: from p1002.netstorage.at (p1002.netstorage.at [89.207.146.186]) by mx01.mail.netstorage.at (Postfix) with ESMTPS id E1FA4A0847; Tue, 26 Nov 2019 09:30:34 +0100 (CET)
Received: from mailix (noaport.de [46.237.252.213]) by p1002.netstorage.at (Postfix) with ESMTPA id 37D54811EC; Tue, 26 Nov 2019 09:30:34 +0100 (CET)
Received: from [192.168.0.107] (HSI-KBW-46-237-252-214.hsi.kabel-badenwuerttemberg.de [46.237.252.214]) by mailix with ESMTPSA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128) ; Tue, 26 Nov 2019 09:30:33 +0100
From: Tobias Rapp <t.rapp@noa-archive.com>
To: Steve Lhomme <slhomme@matroska.org>, Dave Rice <dave@dericed.com>
Cc: Codec Encoding for LossLess Archiving and Realtime transmission <cellar@ietf.org>
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> <CAOXsMFLFkKB20tdVkC+bH+692q4LT8Wg4SeOOWA-vfAhLtZ9Qg@mail.gmail.com>
Organization: NOA GmbH
Message-ID: <b880b216-f232-600d-a8cf-613e7ac14259@noa-archive.com>
Date: Tue, 26 Nov 2019 09:30:33 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1
MIME-Version: 1.0
In-Reply-To: <CAOXsMFLFkKB20tdVkC+bH+692q4LT8Wg4SeOOWA-vfAhLtZ9Qg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-PPP-Message-ID: <20191126083034.6882.1462@p1002.netstorage.at>
X-PPP-Vhost: noa-archive.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/lAVNdvAVbN1gqged8l7CfNwArm0>
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: Tue, 26 Nov 2019 08:31:09 -0000

On 24.11.2019 17:43, Steve Lhomme wrote:
> Le jeu. 21 nov. 2019 à 16:03, Dave Rice <dave@dericed.com> a écrit :
>>
>> [...]
>>
>> 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)

Adding a tag for storing timecode offset is a simple solution and 
satisfies the most basic requirements. The current list [1] seems to 
already include other technical tags like "FPS" and "REPLAYGAIN_PEAK" so 
it should be fine.

I would not use a framecount for storing sub-seconds, though, but a 
HH:MM:SS.MSS pattern like used for date-time (without the date part). 
This would be valid for audio and video files. An application can render 
the value in HH:MM:SS:FF syntax for user display, if desired.

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

The latter option seems the most practical. As far as I understand from 
[2] there can be multiple chapters applied to one segment by using 
multiple EditionEntry elements. That might be useful because we can have 
one chapter structure for track labeling "scene one", "scene two", ... 
and another chapter structure for timecodes (if necessary).

I assume timecodes would get an own "ChapterTimecodeOffset" element, 
similar to existing ChapterTimeStart/-End. Or would you define a 
"ChapProcessCodecID" for timecodes explicitly? Also maybe we want to 
store some more information together with the plain time value. Possibly 
frame-rate and drop-frame flag (for rendering the time in HH:MM:SS[:;]FF 
syntax) should be put either as optional elements on EditionEntry level 
or into ChapProcessPrivate.

In theory there could be multiple timecode sources (VITC, LTC, etc) but 
in practice it seems hardware players just output the most precise one 
currently available so storing the source name in Matroska would not be 
considered relevant by me.

Best regards,
Tobias

Links:
[1] https://www.ietf.org/id/draft-ietf-cellar-tags-03.html
[2] 
https://datatracker.ietf.org/doc/html/draft-ietf-cellar-matroska-04#section-9.3.7