Skip to content

fix: Disable FEC and RTX in WHEP output to prevent bandwidth doubling - #216

Merged
srperens merged 1 commit into
mainfrom
fix/whep-double-bandwidth
Jan 14, 2026
Merged

fix: Disable FEC and RTX in WHEP output to prevent bandwidth doubling#216
srperens merged 1 commit into
mainfrom
fix/whep-double-bandwidth

Conversation

@srperens

Copy link
Copy Markdown
Collaborator

Summary

  • Disable FEC (Forward Error Correction) and RTX (retransmission) in WHEP output which were causing near-double bandwidth usage
  • webrtcsink enables these by default, causing significant overhead for high-bitrate pre-encoded streams

Problem

For a 10 Mbit/s pre-encoded H.264 stream sent via WHEP:

  • Before: ~21 Mbit/s transmitted (FEC + RTX overhead)
  • After: ~11 Mbit/s transmitted (expected with RTP overhead)

Changes

  • Set do-fec=false and do-retransmission=false on whepserversink
  • Added defensive deduplication of codec caps when relaxing profile matching

Test plan

  • Tested on remote server with 10 Mbit/s H.264 stream
  • Verified bandwidth reduced from ~21 Mbit/s to ~11 Mbit/s
  • Stream plays correctly in WHEP player

🤖 Generated with Claude Code

webrtcsink enables FEC (Forward Error Correction) and RTX (retransmission)
by default, which can nearly double bandwidth usage for high-bitrate streams.

For a 10 Mbit/s pre-encoded H.264 stream:
- Before fix: ~21 Mbit/s transmitted (FEC + RTX overhead)
- After fix: ~11 Mbit/s transmitted (expected with RTP overhead)

Also includes defensive deduplication of codec caps when relaxing profile
matching to prevent potential duplicate stream issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@srperens
srperens merged commit fb6ec1b into main Jan 14, 2026
9 checks passed
@srperens
srperens deleted the fix/whep-double-bandwidth branch January 14, 2026 15:51
birme pushed a commit to eyevinn-osaas/strom that referenced this pull request Feb 2, 2026
…Eyevinn#216)

webrtcsink enables FEC (Forward Error Correction) and RTX (retransmission)
by default, which can nearly double bandwidth usage for high-bitrate streams.

For a 10 Mbit/s pre-encoded H.264 stream:
- Before fix: ~21 Mbit/s transmitted (FEC + RTX overhead)
- After fix: ~11 Mbit/s transmitted (expected with RTP overhead)

Also includes defensive deduplication of codec caps when relaxing profile
matching to prevent potential duplicate stream issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Per Enstedt <per.enstedt@svt.se>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
srperens added a commit that referenced this pull request Jun 5, 2026
PR #216 disabled both FEC and RTX to stop bandwidth doubling on
high-bitrate pre-encoded streams. The doubling came from FEC's constant
proactive redundancy — RTX was disabled alongside it without being the
culprit. RTX is reactive: it costs nothing while no packets are lost
and only resends the exact packets the client NACKs.

Without RTX, client NACKs go unanswered, so every burst loss escalates
to PLI -> forced keyframe, leaving the picture broken until the keyframe
arrives (observed as fps drops from 50 to 3-9 in client stats).

Field-verified on a lossy viewer path: with RTX enabled the client
holds 44-50 fps through loss bursts and only ~1 in 5 bursts still
escalates to PLI, at a retransmission cost proportional to actual loss
(zero on clean paths).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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