FEC, RTX and RED
RFC 4588 retransmission with NACK is in the default interceptors. FlexFEC (draft-03 as browsers send it, and RFC 8627), ULPFEC in RED and redundant audio are opt-in interceptors, configured in the interceptor registry.
Retransmission (RTX)
RFC 4588 retransmission: the default interceptors generate NACKs for lost packets and answer the peer's NACKs with RTX (configure_nack configures the NACK interceptors on their own). Interop cells at the release repair video under netem loss in both directions against Pion, str0m and aiortc (Interoperability).
The opt-in coders
All in interceptor_registry; the coders themselves are in rtci-interceptor.
| Function | What it adds (its documentation, shortened) |
|---|---|
configure_video_flexfec | RFC 8627 FlexFEC for video, in both directions (DefaultInterceptorOptions::video_flexfec, on in the StrictRfc profile) |
configure_ulpfec / configure_ulpfec_with_placement | ULPFEC (RFC 5109) carried in RED (RFC 2198) for video, in both directions |
configure_video_red_ulpfec / _with | video red and ulpfec as Chromium offers them, and ULPFEC in RED in both directions (used by the Chrome profile) |
configure_ulpfec_sessions / _with | ULPFEC for FEC sessions of their own (RFC 5109 section 14.1, RTCPeerConnection::add_fec_session) |
configure_audio_redundancy / _with / _with_builder | redundant audio data, RED (RFC 2198), in both directions |
FlexFEC is implemented both as browsers send it (draft-ietf-payload-flexible-fec-scheme-03, video/flexfec-03, MIME_TYPE_FLEX_FEC03) and as published (RFC 8627, video/flexfec, MIME_TYPE_FLEX_FEC: masks, row / column / 2-D protection, retransmission). For draft-03, where libwebrtc departs from the draft's letter, the engine follows libwebrtc, the only draft-03 peer.
Which of these each profile turns on is in the fec.* rows (fec.video-red-ulpfec, fec.video-flexfec, ...) of the profiles table.
Statistics
FEC sent and received per stream, and packets rebuilt by FEC, are in RTCPeerConnection::fec_stats (FecStats, FecSentStats, FecReceivedStats in rtci::statistics).
Examples
The repository's play-from-disk-fec and save-to-disk-fec examples send and receive with FEC.