I have been doing some work with this too, and am totally mystified as to the criteria used for when FEC packets are sent.
I am trying to add WebRTC support to me VoIP library. Using SIP stack over WebSocket, the SDP negotiation indicates that red and ulpfec are enabled, and yet, Chrome only ever sends the raw VP8 video on payload type 100. Never the red packets.
Chrome offer:
m=video 1 RTP/SAVPF 100 116 117
...
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 goog-remb
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
...
My answer:
m=video 44094 RTP/SAVPF 100 116 117
a=rtcp-fb:* ccm fir
a=rtcp-fb:* nack pli
a=rtcp-fb:* goog-remb
a=rtpmap:100 VP8/90000
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
...
Which to the best of my knowledge is correct to all the relevant RFC's, and there are a few!
As an aside Chome does not advertise support for PLI in it's SDP, and yat as far as I can determine it doe, in fact, support it.
As a lot of people talked about FEC only happening when there is packet loss, I hacked my code to fake packet loss in the RTCP-SR records sent back to Chrome for it's transmitted video. Even at 25% packet loss, no FEC packets were forthcoming. At 50%, Chome seemed to deem the link unusable and disconnected, though not at all sure that was the reason.
I have tried sending many PLI packets. I have tried sending REMB packets in case that was required.
Nothing works.
Now, the final kicker, when I do a call between two computers
running Chome (Mac to PC, if it matters) using
https://apprtc.appspot.com, and observe the RTP traffic using
Wireshark, I can see that Chrome
is sending red packets, and, by implication
ulpfec, via the payload type (116) which you can still see as the RTP
header not encrypted in SRTP.
As Chrome was sending red packet
while over my LAN, the statements that it only does so in the presence of packet loss does not seem correct. It is certainly possible it is not putting in the redundant ulpfec part or the red packet until a certain level of packet loss, but it is sending red packets. And I have not managed to get it to do that.
There is some criteria that Chrome needs, which has so far eluded me, does anyone have a clue as to what that is?