user_timestamp FFI#980
Merged
chenosaurus merged 1 commit intodc/feature/user_timestampfrom Mar 31, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR exposes per-frame packet-trailer metadata (notably user_timestamp_us, plus frame_id) through the FFI layer so downstream clients can both attach metadata when capturing frames and receive it on decoded frames.
Changes:
- Add
FrameMetadatato the FFI video frame protocol and thread it throughCaptureVideoFrameRequestandVideoFrameReceived. - Convert metadata between LiveKit
FrameMetadataand FFIproto::FrameMetadatainFfiVideoSourceandFfiVideoStream, with unit tests. - Add
packet_trailer_featurestoTrackPublishOptionsto enable packet trailer metadata emission, with Rust conversion + tests and updated Node bindings.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| livekit-ffi/src/server/video_stream.rs | Maps VideoFrame.frame_metadata into proto::VideoFrameReceived.metadata and adds unit tests for conversion. |
| livekit-ffi/src/server/video_source.rs | Maps CaptureVideoFrameRequest.metadata into VideoFrame.frame_metadata (dropping empty metadata) and adds unit tests. |
| livekit-ffi/src/conversion/room.rs | Converts TrackPublishOptions.packet_trailer_features into LiveKit PacketTrailerFeatures and adds unit tests. |
| livekit-ffi/protocol/video_frame.proto | Introduces FrameMetadata message and adds optional metadata fields to capture and receive messages. |
| livekit-ffi/protocol/room.proto | Adds packet_trailer_features to TrackPublishOptions. |
| livekit-ffi-node-bindings/proto/video_frame_pb.js | Regenerates Node JS bindings to include FrameMetadata and the new optional metadata fields. |
| livekit-ffi-node-bindings/proto/video_frame_pb.d.ts | Regenerates Node TS declarations for FrameMetadata and the new optional metadata fields. |
| livekit-ffi-node-bindings/proto/room_pb.js | Regenerates Node JS bindings to include packet_trailer_features on TrackPublishOptions. |
| livekit-ffi-node-bindings/proto/room_pb.d.ts | Regenerates Node TS declarations for packet_trailer_features on TrackPublishOptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chenosaurus
approved these changes
Mar 30, 2026
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.
Expose user_timestamp for video frames to the FFI