You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
livekit-client can publish frame-metadata trailers with user_timestamp and frame_id, and (since #1983, shipped in livekit-client@2.20.1) it can now parse a user_data trailer (tag 0x03) on the receive side. However, there is still no way to writeuser_data on the publish side from the JS SDK.
FrameMetadataPublishOptions only exposes timestamp and frameId.
The encode transform (appendPacketTrailerToEncodedFrame in src/frameMetadata/frameMetadata.ts) only ever writes the timestamp + frameId TLVs; there is no plumbing to attach an arbitrary per-frame user_data payload.
So JS clients can readuser_data published by Rust/other SDKs, but a JS publisher cannot emit it.
Use case
Frame-accurate correlation of application events with the published video: attach a small user_data payload (e.g. an event id / tag) to the frame that was live when the event fired, so a downstream recording/analysis pipeline can line up video with application state with no separate sync channel — exactly the "frame-accurate correlation" use case from the frame-metadata blog post.
Today this requires reimplementing the SDK's encoded-frame transform in a custom worker just to add the user_data TLV (reusing the exact LKTS XOR-TLV wire format), which duplicates SDK internals and risks drifting from the wire format across releases.
Proposal
Expose a publish-side user_data mechanism, e.g.:
a userData flag in FrameMetadataPublishOptions (to advertise the feature on the track), and
an API to set the user_data for upcoming frame(s), e.g. LocalVideoTrack.setFrameUserData(bytes: Uint8Array) (attach to the next encoded frame, or valid until replaced), mirroring the Rust capture_frame model.
Describe the feature
livekit-clientcan publish frame-metadata trailers withuser_timestampandframe_id, and (since #1983, shipped inlivekit-client@2.20.1) it can now parse auser_datatrailer (tag0x03) on the receive side. However, there is still no way to writeuser_dataon the publish side from the JS SDK.FrameMetadataPublishOptionsonly exposestimestampandframeId.appendPacketTrailerToEncodedFrameinsrc/frameMetadata/frameMetadata.ts) only ever writes the timestamp + frameId TLVs; there is no plumbing to attach an arbitrary per-frameuser_datapayload.VideoFrame.frame_metadata.user_datapassed tocapture_frame(Add support for frame level user timestamp rust-sdks#890), and the blog post (https://livekit.com/blog/frame-metadata) advertisesuser_dataas a first-class capability across SDKs.So JS clients can read
user_datapublished by Rust/other SDKs, but a JS publisher cannot emit it.Use case
Frame-accurate correlation of application events with the published video: attach a small
user_datapayload (e.g. an event id / tag) to the frame that was live when the event fired, so a downstream recording/analysis pipeline can line up video with application state with no separate sync channel — exactly the "frame-accurate correlation" use case from the frame-metadata blog post.Today this requires reimplementing the SDK's encoded-frame transform in a custom worker just to add the
user_dataTLV (reusing the exactLKTSXOR-TLV wire format), which duplicates SDK internals and risks drifting from the wire format across releases.Proposal
Expose a publish-side
user_datamechanism, e.g.:userDataflag inFrameMetadataPublishOptions(to advertise the feature on the track), anduser_datafor upcoming frame(s), e.g.LocalVideoTrack.setFrameUserData(bytes: Uint8Array)(attach to the next encoded frame, or valid until replaced), mirroring the Rustcapture_framemodel.Questions
user_datawriter intentionally deferred, or is it planned as a follow-up to Add support for user data frame metadata trailer type #1983?SDK
livekit-client@2.20.1