perf: remux indexed Cast video at keyframe boundaries
This commit is contained in:
@@ -221,7 +221,7 @@ TLS connection establishment has a twelve-second deadline; cold receiver launch
|
||||
|
||||
The Mac serves session-only capability URLs over HTTP. Keep it awake and connected, and allow incoming connections through its firewall. The relay exposes only the chosen media and subtitle resources, never arbitrary filesystem paths or a general URL proxy. Disconnect, replacement and quit cancel delivery and invalidate the listening endpoint.
|
||||
|
||||
Local files, resolved Miruro HLS and YouTube's combined/separate video/audio inputs are delivered as six-second HLS segments. Compatible, independently decodable H.264/AAC is remuxed; other supported inputs use VideoToolbox H.264 (including its platform software fallback) and stereo AAC. Output targets at most **1920×1080 at 30 fps**, H.264 Main/High level 4.1 or lower, with preserved display aspect ratio. Recorded segments are generated on demand, including distant seeks; there is no full-movie download or preprocessing step. Live output keeps eight segments (about 48 seconds) and is not seekable. Audio-only sources are supported.
|
||||
Local files, resolved Miruro HLS and YouTube's combined/separate video/audio inputs are delivered as HLS segments targeting six seconds. Compatible H.264/AAC is remuxed; complete sample indexes let recorded, non-reordered H.264 use keyframe-aligned segments up to twelve seconds. Unindexed inputs (including Miruro HLS), B-frame video, longer GOPs and incompatible formats retain the fixed six-second fallback: VideoToolbox H.264 (including its platform software fallback) and stereo AAC where needed. Output targets at most **1920×1080 at 30 fps**, H.264 Main/High level 4.1 or lower, preserving display aspect ratio. Recorded segments are generated on demand, including distant seeks; no full-movie download or preprocessing. Live output keeps eight segments (about 48 seconds) and is not seekable. Audio-only sources are supported.
|
||||
|
||||
Recorded network delivery uses the native player's bounded compressed-packet buffer: up to 128 MiB shared between inputs, targeting sixty seconds ahead and thirty seconds behind (byte pressure can shorten retention). Combined HLS supplies video/audio from one selected-stream reader; unused quality variants are disabled. Sequential and nearby seeks reuse packets, including decoder/AAC preroll; true cache misses seek upstream once. Nearby forward requests wait for existing read-ahead instead of cancelling and restarting its fetch. Eight completed output segments are also cached (at most 256 MiB), so repeated, HEAD and range requests reuse encoded bytes. Uncached generation is serialized; GOP preroll, transcoding, provider slowness and receiver buffering can still delay a fresh Cast seek.
|
||||
|
||||
@@ -233,6 +233,17 @@ The Cast channel accepts the selected receiver's self-signed TLS certificate: en
|
||||
|
||||
Authenticated multi-variant HLS regressions gate upstream responses and verify no unused-quality downloads or duplicate retained-media reads, nearby rewinds, distant cache misses, decoded A/V positions and AAC continuity, and cancellation while upstream remains blocked. Native network playback checks cover the shared reader's existing callers.
|
||||
|
||||
`make check-cast` also checks indexed remux packet preservation, independent decoding, random seeks through combined/split inputs, non-grid AAC continuity, and fallback for B-frames/long GOPs. One local synthetic 28-second, 1280×720/10 fps H.264/AAC recording with seven-second GOPs measured:
|
||||
|
||||
| Relay generation (fixture creation/probing excluded) | Before | After |
|
||||
| --- | ---: | ---: |
|
||||
| All output segments, HTTP loopback | 959 ms | 2.7 ms |
|
||||
| Segment count | 5 | 4 |
|
||||
| Longest segment | 6 s | 7.021 s |
|
||||
| Total output bytes | 813,288 | 812,912 |
|
||||
|
||||
This measures avoided transcoding, not CDN latency or physical-receiver performance. Segment/cache byte caps are unchanged; longer indexed segments can retain more playback time within those caps. A production-build HLS consumer matched source frame MD5s after forward/backward seeks to 10.5, 22.3 and 2.6 seconds. Hardware receiver seeking and A/V synchronization still need manual verification.
|
||||
|
||||
The player handoff checks also gate receiver launch and LOAD to exercise cancellation, LOAD rejection after local pause, replacement/close/shutdown during pending and active Cast, and late receiver replies. Disconnect recovery preserves the latest playback intent, acknowledged position, stable bookmarks and independent local volume even with an unacknowledged remote seek.
|
||||
|
||||
## Resume playback
|
||||
|
||||
Reference in New Issue
Block a user