Repository navigation
fix(live): one frame more no longer buys a whole second of fastZap TARGETDURATION (#670) - #691
Merged
Merged
Conversation
…RGETDURATION (#670) The fastZap GOP headroom took ceil(1.5 x max EXTINF). On a 59.94 fps source with 1.001 s GOPs a 79-frame segment (1.318 s) sealed 2 and an 80-frame one (1.335 s, 2.002 x 1.5) sealed 3, a 9 s holdback that a 6 s rebuild backlog could not hold: bounded start, first frame 2.5 s later. The term now asks what it is for: the smallest TARGETDURATION under which a GOP 1.5 x the longest seen still lists (RFC 8216 rounds EXTINF to the nearest integer) and finishes inside AVPlayer's 1.5 x TD patience with 0.5 s to spare. Segments up to 1.666 s seal 2, 1 s GOPs keep 2, and the value is never above the old one. Measured with aetherctl live --fast-zap --realtime --preroll 6 on a 59.94 fps seed with one 80-frame segment, two runs per arm: main sealed 3, served bounded after 1.345 s and presented at 2.94 to 2.95 s; the branch sealed 2 and presented at 0.37 to 0.39 s. No -12888 or stall in either. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 2 of #670, from the 59.94 fps data point in #670.
Problem
The fastZap GOP headroom term was
ceil(1.5 x max EXTINF). At 59.94 fps with 1.001 s GOPs:One millisecond of segment duration bought 1 s of TARGETDURATION and 3 s of holdback. On a rebuild with a 6 s backlog, that 9 s holdback forced a bounded start.
Fix
LiveEdgePolicy.targetDurationForGOPHeadroomasks what the term is for. It returns the smallest TD under which a GOP 1.5 x the longest seen:1.5 x TDpatience with 0.5 s to spare. That is the margin round 1 already accepted for the reported 2.4 s GOP at TD 2.Segments up to 1.666 s now seal 2, and 1 s GOPs keep TD 2. The new value is never above the old one (tested over 0.3 to 12 s in 1 ms steps). Ingested segments and
.standardare untouched. The seal line now states what the term needs:1.5 x max EXTINF 2.002s needs 2s.Measured
Fixture: a 59.94 fps H.264 TS seed with keyframes every 60 frames plus one extra at frame 100, which makes the third segment 80 frames. Run with
aetherctl live --fast-zap --realtime --preroll 6 --seconds 60, two runs per arm:#361 startup 8/8 presentingNeither arm showed a -12888, -12642 or stall. With
--preroll 0the session seals before the 80-frame segment arrives (TD 2 on both arms). main then logslater candidate 3s (max segment 1.335s)and the branch logs no candidate.swift test: 714 XCTest passed. Swift Testing had one failure inIssue281ColdStartRoundTripTests(a 10 s network-timing test under full-suite load). It passes in isolation on both the branch and main.🤖 Generated with Claude Code
https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS