feat(wasm): Live Viewer に配信開始からの経過時間を表示する - #372
Open
yuki-uchida wants to merge 5 commits into
Open
Conversation
yuki-uchida
added this pull request to stack #377
September 10, 2026 10:26
draft-ietf-moq-msf-00 section 7.1 defines a media timeline as an array of three-item records whose ordinal position defines their type. Model the record as a tuple struct so serde emits that array shape, and name the items through accessors. serde_json joins the dev-dependencies to assert the wire format against the example document in the draft.
A publisher that also has to describe its own locations, such as an MSF media timeline, needs the group id it just wrote. Only the group count was reachable, which does not resolve to a location without the seed the writer was constructed with.
Nothing in the catalog told a subscriber where the broadcast started, so a player could only measure time from the moment it joined. The bridge now publishes a "timeline" track carrying the media presentation timestamp, the location and the encode wallclock of every keyframe group, declared with mediatimeline packaging and depending on every media track. Records are held for as long as the relay caches objects, and are dropped when a group id stops continuing the sequence, which is how a resubscribe reseeds the numbering and invalidates the recorded locations.
The slider only said how far behind the live edge a position was, so there was no way to tell how long the broadcast had been running. The viewer now subscribes to the MSF media timeline track it finds in the catalog and reads `position / broadcast` off it. A capture timestamp resolves to a presentation time by offsetting from the newest record at or before it, rather than by matching the recorded group id, because renditions number their groups independently of the track the records point at. The catalog reader gained media timeline discovery, keyed on the packaging of section 7.2 with the optional role of section 5.1.14 as a fallback, and excludes those tracks from the video and audio lists.
…it indexes Listing every media track claimed the records resolve against renditions too. Each track gets its own writer, seeded when it is subscribed, so a rendition numbers its groups independently of the locations the records carry, and only the primary video track is actually indexed.
yuki-uchida
force-pushed
the
codex/live-viewer-media-timeline
branch
from
September 10, 2026 10:35
c1ba4c6 to
27c2b90
Compare
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.
概要
シークバーがライブ端からの相対位置しか示さず、配信開始から何分経ったのか分かりませんでした。MSF の media timeline track(draft-ietf-moq-msf-00 §7)を実装し、スライダー下に
シーク位置 / 配信経過を表示します。やったこと
media-streaming-formatに §7.1 のレコード型を追加する。序数で意味が決まる3要素配列なので tuple struct にしたtimelineトラックを publish する。keyframe group ごとに presentation time / location / encode wallclock を記録し、mediatimeline packaging と主 video トラックへの depends を付ける。保持は relay のキャッシュ相当の窓で、group ID が連番でなくなったら再パブリッシュと判断して破棄する。自分の location を書くためにTrackWriterに書き込み先 group ID の読み取りを追加したやらないこと
影響範囲
moqtは追加のみの API 拡張テスト
cargo test -p media-streaming-format -p moqt-bridge-live-ingest -p moqt(moqt は 154 件)、cargo clippy、cargo fmt --check、npm --prefix examples/browser run lint、prettier: passnpm run e2e:live-viewer: pass。ライブで1:48 / 1:48、Home シークで1:36 / 1:54(差 18 秒 = 表示の-17.7sと一致)、360p 切り替え後も2:06 / 2:06備考
dependsは §7.2 の MUST なので出しますが、値はレコードの Location が解決できる主 video トラックだけに絞っています。live-ingest は SUBSCRIBE ごとにトラック別の writer を作って group ID を再採番するため、rendition を同じタイムラインでは表せません。トラックごとに timeline を publish して depends で選ばせる形は、必要になってから入れます。