Skip to content

feat: add packet_buffer_init_video config parameter#2

Draft
Rajiv91 wants to merge 1 commit into
masterfrom
fix/packet-buffer-init-video
Draft

feat: add packet_buffer_init_video config parameter#2
Rajiv91 wants to merge 1 commit into
masterfrom
fix/packet-buffer-init-video

Conversation

@Rajiv91

@Rajiv91 Rajiv91 commented Apr 16, 2026

Copy link
Copy Markdown

Summary

  • Add new YAML config parameter packet_buffer_init_video that sets the initial size of the SFU's circular packet buffer for video, independently of packet_buffer_size_video (max capacity)
  • Under degraded networks (WiFi/5G congestion at trade shows), H.264 packets arrive in bursts of 1,000-2,500 that exceed the default initial bucket size (300). The PPS-based growth logic doesn't detect the need because it uses average PPS, not peak burst size
  • Falls back to InitPacketBufferSizeVideo (300) if not set — zero impact on existing deployments

For a more detailed analysis, please go to number 4 on the list:
https://www.notion.so/irisai/Low-quality-network-investigation-33645056d4d380d4b1e5f3e825077d9d

Cross-repo PRs

  • Paired with tryiris-ai/platform branch fix/livekit-packet-buffer-size (passes packet_buffer_init_video: 2400 in the encoder's LiveKit config)

Test plan

  • Validated with 10+ hours of active H.264 streaming under aggressive network shaping (25-30 Mbps, 50-75ms delay, 0.5-0.75% loss)
  • Zero packetNotFoundCount errors (vs 134,000+ without the fix)
  • VP8/NDI streams verified unaffected (zero errors in all sessions)
  • Burst peaks of up to 2,487 packets absorbed within 2,400 capacity

🤖 Generated with Claude Code

Add a new YAML config parameter `packet_buffer_init_video` that sets the
initial size of the SFU's circular packet buffer for video, independently
of the existing `packet_buffer_size_video` (max capacity).

Under degraded networks (WiFi/5G congestion), H.264 packets arrive in
bursts of 1,000-2,500 that exceed the default initial bucket size (300,
grown to 600). The existing growth logic uses average PPS which doesn't
reflect burst peaks, so the bucket never grows large enough. This new
parameter allows deployments to start the bucket at the right size.

If not set or zero, falls back to InitPacketBufferSizeVideo (300) —
preserving existing behavior for all current users.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Rajiv91 Rajiv91 requested a review from cwhitney-iris April 16, 2026 21:39
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