FlexFec enabled creates framesReceived/s instability

238 views
Skip to first unread message

Matt Knowles

unread,
Dec 18, 2024, 7:08:11 AM12/18/24
to discuss-webrtc
We have a game streaming service. I am using libwebrtc and enabled FlexFec-03.
I see fec related stats in webrtc-internals.
I have tried various implementations of the FecController, the FecControllerDefault or my own version.

Looking at webrtc-internals stats:

Our games normally run at 60 fps and without FlexFEC enabled the framesReceived/s is basically at 60 with a varience of +1 (~61) to -2 (~58).
Graph image attached "stream_without_flex_fec.jpg"

With FlexFEC enabled I see it run at 60fps but with a varience of +20 (80) / -43 (17).  
Quickly bouncing from high to low 4 to 6 times each 15 seconds.
Graph image attached "stream_with_flex_fec.jpg"

I have adjusted the FecProtectionParams tweaking fec_rate (0-255) and max_fec_frames(0-48).
No matter what I change with these values, even when there are no FEC packets, the framesReceived/s is still erratic which is mirrored in my client side fps.

Any suggestions to fix this?

My hope was to be able to give a percentage of my bitrate to FEC packets.
I don't mind if this means in the end to I have to increase my bitrate.
I have the ability to increase or decrease the FEC packets but I need to fix this instability in my framesReceived/s. 

Thank you,
Matt
stream_with_flex_fec.jpg
stream_without_flex_fec.jpg

Andrei Volykhin

unread,
Mar 19, 2025, 8:00:41 AM3/19/25
to discuss-webrtc
@Matt,

As an option you could try to check with the following CL: https://webrtc-review.googlesource.com/c/src/+/381600

As example for GeForceNow browser client on embed device this change has reduced average CPU duration to deliver RTP video packet by 0,073 ms (0,317 ms -> 0,244 ms) per each packet.

May be in your environment the frame assembly time (FAT) will also be reduced and decoder "framesReceived/s" stat will be more smoothly (less peaks).

Matt Knowles

unread,
Apr 16, 2025, 3:25:11 AM4/16/25
to discuss-webrtc
Forgot to follow upon this. Thank you Andrei. I did pull that code in and it did smooth some of the graphs. 

Appreciate the suggestion.
Matt

Reply all
Reply to author
Forward
0 new messages