Re: [Cellar] Timestamps again

"Timothy B. Terriberry" <> Mon, 21 June 2021 15:21 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 5B1093A0AD5 for <>; Mon, 21 Jun 2021 08:21:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -0.338
X-Spam-Status: No, score=-0.338 tagged_above=-999 required=5 tests=[NICE_REPLY_A=-0.338, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id HDNXiKVK9qUD for <>; Mon, 21 Jun 2021 08:21:41 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 6F27F3A0AD4 for <>; Mon, 21 Jun 2021 08:21:40 -0700 (PDT)
Received: from [] ( []) by (Postfix) with ESMTPSA id D36839F707 for <>; Mon, 21 Jun 2021 15:21:38 +0000 (UTC)
References: <> <>
From: "Timothy B. Terriberry" <>
Message-ID: <>
Date: Mon, 21 Jun 2021 08:21:36 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 SeaMonkey/2.53.1
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <>
Subject: Re: [Cellar] Timestamps again
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Codec Encoding for LossLess Archiving and Realtime transmission <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 21 Jun 2021 15:21:44 -0000

Steve Lhomme wrote:
> One possibility is to use the existing TrackTimestampScale element which 
> wasn't designed for that but works pretty well. It's backward compatible 
> although there is a high chance a lot of readers don't handle it properly.

There are some other questions I had about interactions of it with other 
features, but given that it was deprecated I was not too worried about 
them. If you are planning to use it for this, maybe I should be, though.

> A more solid solution would be to write the proper sampling rate of the 
> source (but that becomes complicated in case of Variable Frame Rate as 
> found nowadays in video games).

Complicated things might be complicated, but you still need a reliable, 
documented way for the 99% of usage that will not have those complications.

> I think the TrackTimecodeScale solves both these examples, because it 
> using a floating point estimation before rounding the numbers. It allows 

I think the issue here is not that there is insufficient precision. 
There are enough code points in the timestamp to uniquely identify each 
sample number, but the rounding rules are not constructed in such a way 
as to guarantee a reversible map between them. That problem could be 
exacerbated by introducing floating point if you are not very careful 
about defining how the truncation and rounding works, since not every 
floating point environment is implemented or configured the same way. It 
certainly becomes a lot harder to test exhaustively.

For what it is worth, the program I attached passes using strategy (b) 
if you choose the "slightly smaller value" for TimestampScale to be 1/2 
of the value recommended in the text, instead of the recommended value 
minus one.

> I think we should explain the possibilities and limits of both methods 
> (with and without TrackTimecodeScale) when solving issue #517. Both when 
> muxing and demuxing to explain what rounding should be used.

I agree. I look forward to seeing the rewrite of these sections.