Skip to content

HKSV3 recordings: true times, a sealed date line, a sealed initialization segment and one target duration - #1155

Merged
hjdhjd merged 4 commits into
beta-2.4.0from
feat/hjd-hksv3-clip-dates
Nov 29, 2026
Merged

hjdhjd merged 4 commits into
beta-2.4.0from
feat/hjd-hksv3-clip-dates

Conversation

@hjdhjd

@hjdhjd hjdhjd commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

What this changes

Four changes to how a camera in the modern form records, following #1154. Each was read on home hubs running iOS 27.

  • A recording is dated by when its video was taken. Each recording is stamped with the time its first picture was taken: the time the plugin's own stream states in a prft box where it carries one, and the picture's arrival otherwise. Before this, a recording was stamped with the moment its first fragment was sent, which dated its lead-up late by the length of the prebuffer.
  • Each clip states its start, sealed. A clip's multivariant playlist carries a date line, sealed under the clip's content key, and the Home app places the clip in its timeline at that time to the second. A clip without the line stands at the moment its upload began.
  • A clip's initialization segment is sealed with its media, under the same content key, with the playlist's key line ahead of its map.
  • A clip's media playlist states one target duration, the same in its opening form and its closing form: the longest segment the camera's recording can cut, which is its prebuffer plus ten seconds. Before this, each form worked the number out for itself, and a longer segment later in a clip could change it. A segment the recorder closes early, at a stream's restart or a long gap, is now held to that length as well. This one was raised in the discussion of HomeKit Secure Video 3 (iOS 27) #1132.

What a plugin sees

Nothing a plugin has to change. A plugin whose source knows when its pictures were taken can say so with a prft box in front of each fragment, which from ffmpeg is -write_prft wallclock. Without one, the library dates each picture by its arrival, which is right for a live source. The example camera states its time this way.

The commits

  1. Each recording and its clip dated by when the video was taken, with the example camera stating its time.
  2. A clip's initialization segment, sealed.
  3. One target duration for a clip, and the recorder's early-closed segment held to it.
  4. The two guides, brought up to date.

The guides

guides/HKSV3Protocol.md now describes the sealed date line and what places a clip, the sealed initialization segment, the target duration, and how long a hub waits for a recording's first fragment: about 16 seconds, after which it closes the stream. It also notes one thing we observed and have not explained: two clips that meet end to end show as one clip in the Home app, and it plays with a brief stutter where they meet.

guides/UpgradingCameraPlugins.md gains how a plugin's stream states its times.

How it was tested

  • The suite, 3589 tests, with the typecheck, the lint and the documentation lint clean.
  • On home hubs: a clip stood in the timeline at the time its video began, lead-up included; the publishing point accepted the library's own HEVC and Opus clips with their initialization segments sealed; and playlists stating target durations of 15 and 40 were accepted and their clips played.
  • Not yet read on a hub: a stream whose stated time differs from its arrival time. The library's handling of a stated time is held by its tests.

@github-actions github-actions Bot added feature beta This is in some form related to the current beta release labels Nov 29, 2026
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 46279573336

Warning

No base build found for commit e83d144 on beta-2.4.0.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 94.476%

Details

  • Patch coverage: 81 of 81 lines across 11 files are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 16758
Covered Lines: 15766
Line Coverage: 94.08%
Relevant Branches: 2810
Covered Branches: 2721
Branch Coverage: 96.83%
Branches in Coverage %: Yes
Coverage Strength: 56388.28 hits per line

💛 - Coveralls

@hjdhjd
hjdhjd merged commit 17ced45 into beta-2.4.0 Nov 29, 2026
15 checks passed
@hjdhjd
hjdhjd deleted the feat/hjd-hksv3-clip-dates branch November 29, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta This is in some form related to the current beta release feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants