VersionControl:PRs/maybelle-config/297: Difference between revisions

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
DrivingThatTrain (talk | contribs)
cryptograss/maybelle-config#297, as GitHub has it
 
DrivingThatTrain (talk | contribs)
cryptograss/maybelle-config#297, as GitHub has it
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
|url=https://github.com/cryptograss/maybelle-config/pull/297
|url=https://github.com/cryptograss/maybelle-config/pull/297
|author=magent-cryptograss
|author=magent-cryptograss
|state=open
|state=merged
|base=production
|base=production
|branch=magent/strip-empty-sdtp
|branch=magent/strip-empty-sdtp
|opened=2026-11-09 11:51:10
|opened=2026-11-09 11:51:10
|pushed=2026-11-09 11:50:56
|pushed=2026-11-09 11:50:56
|merged=
|merged=2026-11-09 17:39:05
|closed=
|closed=
|worked_on_by=magent, skyler (testing on an iphone 17), with justin
|worked_on_by=magent, skyler (testing on an iphone 17), with justin
Line 16: Line 16:
|deploy=
|deploy=
}}
}}
<pre class="pr-body">## Why
Skyler's iPhone 17 shows nothing (no picture, no sound) when Safari's own player plays a release's stream. Over five rounds of test streams ([test page](https://magent-cryptograss.github.io/av1-iphone-test/)), tapped on the phone:
- AV1 plays, as a plain file and as a stream, with Opus or AAC sound, in full colour range too.
- The IPFS gateway isn't it: the release's stream copied byte for byte to GitHub also fails.
- The release's exact stream, with **only** the 12-byte empty `sdtp` box removed from the video init segment, plays (test 18).
ffmpeg 7.1 (Lavf 61.7, from `python:3.12-slim`'s Debian) writes that empty `sdtp` into every video init segment. ffmpeg 8 doesn't. The audio-only rendition has none, and it is the one that always played.
## What
- `_drop_empty_sdtp(init_segment)` in `transcode.py`: walks moov → trak → mdia → minf → stbl, removes any `sdtp` that is exactly a 12-byte empty full box, and shrinks every parent's size to match. It leaves alone an `sdtp` with entries, and any file with a 64-bit or malformed box.
- Run on each `stream_*/init*.mp4` right after ffmpeg succeeds, before the poster, probe and pin.
## Checked
- Applied to the real release's `stream_360p/init_2.mp4` (`QmbYnW…`), the output is byte-identical to test 18's init segment, which Skyler's iPhone played.
- 5 new tests (`tests/test_drop_empty_sdtp.py`); the full delivery-kid suite passes, 144 tests.
- Not checked: a full encode on the delivery-kid image (ffmpeg 7.1) end to end.
## Not in this PR: existing releases
26 of the 44 HLS Releases on PickiPedia carry the empty `sdtp` (all encoded by Lavf 61.7.103); the other 18 have none. Fixing them means rewriting their init segments, which gives each a new CID, so a new Release page superseding the old via `subsequent_to`, as `scripts/reladder.py` already describes. That's a call for a person.
Redeploy delivery-kid.
Worked on by: magent and Skyler (testing on an iPhone 17), with Justin, in #uploads-and-embeds</pre>

Latest revision as of 17:39, 9 November 2026

maybelle-config#297: delivery-kid: drop the empty sdtp box that stops iPhones playing releases
State 🟣 merged 2026-11-09 17:39:05
Worked on by magent, skyler (testing on an iphone 17), with justin
Moods #uploads-and-embeds
Deploy not said
Branch magent/strip-empty-sdtp → production, by magent-cryptograss
Opened · last pushed 2026-11-09 11:51:10 · 2026-11-09 11:50:56
## Why

Skyler's iPhone 17 shows nothing (no picture, no sound) when Safari's own player plays a release's stream. Over five rounds of test streams ([test page](https://magent-cryptograss.github.io/av1-iphone-test/)), tapped on the phone:

- AV1 plays, as a plain file and as a stream, with Opus or AAC sound, in full colour range too.
- The IPFS gateway isn't it: the release's stream copied byte for byte to GitHub also fails.
- The release's exact stream, with **only** the 12-byte empty `sdtp` box removed from the video init segment, plays (test 18).

ffmpeg 7.1 (Lavf 61.7, from `python:3.12-slim`'s Debian) writes that empty `sdtp` into every video init segment. ffmpeg 8 doesn't. The audio-only rendition has none, and it is the one that always played.

## What

- `_drop_empty_sdtp(init_segment)` in `transcode.py`: walks moov → trak → mdia → minf → stbl, removes any `sdtp` that is exactly a 12-byte empty full box, and shrinks every parent's size to match. It leaves alone an `sdtp` with entries, and any file with a 64-bit or malformed box.
- Run on each `stream_*/init*.mp4` right after ffmpeg succeeds, before the poster, probe and pin.

## Checked

- Applied to the real release's `stream_360p/init_2.mp4` (`QmbYnW…`), the output is byte-identical to test 18's init segment, which Skyler's iPhone played.
- 5 new tests (`tests/test_drop_empty_sdtp.py`); the full delivery-kid suite passes, 144 tests.
- Not checked: a full encode on the delivery-kid image (ffmpeg 7.1) end to end.

## Not in this PR: existing releases

26 of the 44 HLS Releases on PickiPedia carry the empty `sdtp` (all encoded by Lavf 61.7.103); the other 18 have none. Fixing them means rewriting their init segments, which gives each a new CID, so a new Release page superseding the old via `subsequent_to`, as `scripts/reladder.py` already describes. That's a call for a person.

Redeploy delivery-kid.
Worked on by: magent and Skyler (testing on an iPhone 17), with Justin, in #uploads-and-embeds