DEV Community

Peiguan
Peiguan

Posted on

Do the Public Tiny Desk AI Clips Use a ctts Box? Mapping DTS to PTS for B-frame Reordering (Python, Tested)

Do the Public Tiny Desk AI Clips Use a ctts Box? Mapping DTS to PTS for B-frame Reordering (Python, Tested)

I built tinydeskoutstanding.video, an independent studio that places one to five photos into a 15-second vertical desk performance. Today, 30 November 2026, I asked a dating question of a different kind: do the eight public homepage samples carry a ctts (composition-offset) box, and can you map each frame's DTS to its PTS without decoding the picture?

They all do. The official reference has a version-0 ctts box of 3,400 bytes at offset 689, with 423 entries covering all 435 video samples. 340 of those samples have a non-zero offset. The video media timescale is 15,360; every frame lasts 512 ticks (1/30 s). The largest offset is 2,560 ticks, which is five frames.

The public samples were already on disk from an earlier SHA-256-verified fetch (the official file is still 4,258,704 bytes; each filename still matches its SHA-256). I did not use a paid studio render and I did not touch a customer file. As of today's fetch of the pricing page (72,750 bytes, 12:23:06 CST, Asia/Shanghai), a single run is $9.98 at 480p (998 credits), $12.98 at 720p (1,298), $24.98 at 1080p (2,498), or $39.98 at 4K (3,998), the same for Just Me, Back Row, and Whole Band. There is no subscription.

What I ran

The official reference is still:

https://tinydeskoutstanding.video/media/imported/db09b1c54359b0930cec54690f0158751f6144e3a7faa812556adec5a89a0cc1.mp4
Enter fullscreen mode Exit fullscreen mode

Then:

python3 ctts_map.py --samples-dir files/samples --out files/dv
Enter fullscreen mode Exit fullscreen mode

The script walks the ISO-BMFF boxes, reads stts and ctts on the video track, and computes PTS = DTS + composition_offset. It does not decode the picture or the soundtrack.

The official DTS/PTS map

Measured 12:36–12:37 CST. Official mdhd duration is 222,720 ticks = 14.500 s. The first video PTS is not 0: sample 1 is a sync sample with DTS 0, offset 1,024, PTS 1,024 (two frames later). stss lists eight sync samples: 1, 61, 121, 155, 215, 275, 335, 395.

n DTS offset PTS sync?
1 0 1,024 1,024 yes
2 512 2,560 3,072 no
3 1,024 1,024 2,048 no
4 1,536 0 1,536 no
5 2,048 512 2,560 no
435 222,208 512 222,720 no

Offset histogram on the official file: 0 × 95, 512 × 119, 1,024 × 109, 1,536 × 10, 2,048 × 7, 2,560 × 95. That is a B-frame reorder pattern, not a missing box. The other seven public files also have a ctts box; they use timescale 12,288 (24 fps, still 512 ticks per frame) and the same maximum offset of 2,560.

If you are cutting, muxing, or drawing a timeline, use PTS for "when this frame should appear," and do not assume DTS 0 is the first visible frame. On the official clip, the first visible frame is two ticks-of-a-frame later than the first DTS.

How to reproduce: Python 3 and the ctts_map.py / iso_boxes.py scripts in this post. Numbers are from files/dv/ctts_map.json, measured on this box on 30 November 2026.

Top comments (0)