Skip to content

Fix AV1 packet trailers#1115

Open
chenosaurus wants to merge 1 commit into
dc/exp/video_timingfrom
dc/fix_av1_ptf
Open

Fix AV1 packet trailers#1115
chenosaurus wants to merge 1 commit into
dc/exp/video_timingfrom
dc/fix_av1_ptf

Conversation

@chenosaurus
Copy link
Copy Markdown
Contributor

What this fixes

Fixes AV1 packet trailer delivery when packet trailers are enabled.

Previously, packet trailers were appended as raw bytes at the end of the encoded frame. That works for codecs like VP8, but breaks AV1 because the subscriber-side decoder sees the appended bytes as invalid AV1 bitstream data. This caused AV1 subscribers to fail/loop on recovery behavior when packet trailers were enabled.

What changed

  • Encodes LiveKit packet trailer metadata for AV1 as an AV1 Metadata OBU instead of appending raw trailer bytes.
  • Inserts the metadata OBU after leading AV1 sequence header OBUs when present.
  • Extracts and strips the AV1 metadata OBU on receive before the frame reaches the decoder.
  • Keeps the existing raw trailing trailer behavior for non-AV1 codecs.
  • Adds AV1 coverage to the packet trailer tests.

Validation

  • cargo fmt
  • cargo check -p webrtc-sys
  • cargo test -p livekit --features default,__lk-e2e-test --test packet_trailer_test -- --nocapture --test-threads=1
  • Verified with local SFU using publisher --test-pattern --codec av1 --attach-timestamp --attach-frame-id; subscriber decoded AV1 and reported packet trailer features successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant