Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NACK optimize #80

Open
notedit opened this issue Sep 30, 2019 · 13 comments
Open

NACK optimize #80

notedit opened this issue Sep 30, 2019 · 13 comments
Assignees

Comments

@notedit
Copy link
Contributor

notedit commented Sep 30, 2019

Hi murillo,

I read your nack part code, i think the nack can be optimized. here is some stats from webrtc.
I test this in local network.

this is retransmit bitrate
Screen Shot 2019-09-30 at 2 35 26 PM

this is video bitrate
Screen Shot 2019-09-30 at 2 36 13 PM

this is nack received
Screen Shot 2019-09-30 at 2 36 34 PM

@murillo128
Copy link
Member

How do you think it can be optimized? i am against early-optimizations without clear metrics from real live scenarios.

@murillo128
Copy link
Member

Also, what do you see wrong in your graphics?

@notedit
Copy link
Contributor Author

notedit commented Sep 30, 2019

I compare medooze and agora's service on my mac, agora's has very little nacks and retransmit bitrate is almost is zero.

@notedit
Copy link
Contributor Author

notedit commented Sep 30, 2019

Also, what do you see wrong in your graphics?

the nacks is too much and the retransmit bitrate is a bit of high.

@murillo128
Copy link
Member

do you have a sendonly stream? in this case I use rtx/nacks to get the rtt periodically. If not, there should be nacks according to the packet losses.

@notedit
Copy link
Contributor Author

notedit commented Sep 30, 2019

yes, this is a sendonly stream. I know you send rtx to get rtt periodically, but there is only one rtx in one second.

@murillo128
Copy link
Member

nack policy is a bit aggressive, I send one nack packet each time a packet is lost and on subsequent packets until rtx is received or timeout happens.

This nacks redundant packets will be filtered by libwebrtc and only send rtx first time the nack packet is receveid and retransmisión based on rtt. So this causes no extra rtx from client->server.

The only effect are minor spikes of rtcp traffics depending on the rtt which should not have much side issues.

@murillo128 murillo128 self-assigned this Sep 30, 2019
@notedit
Copy link
Contributor Author

notedit commented Sep 30, 2019

Just go through webrtc's nack_module https://github.com/notedit/webrtc-clone/blob/5a29d526be7589f5ba7fb824a749f9088b305070/modules/video_coding/nack_module.cc#L36

they add a default 10ms delay filter. that may help.

@notedit
Copy link
Contributor Author

notedit commented Oct 12, 2019

I have a simple test in my local, add 20ms delay can reduce half of retransmit bitrate in 500kbps.

@murillo128
Copy link
Member

murillo128 commented Oct 12, 2019 via email

@notedit
Copy link
Contributor Author

notedit commented Oct 13, 2019

We may not say the same thing, I mean the incoming source's RTPLostPackets,

I add a 20ms filter when generate nacks, filter the pakcets's time is less than (now - 20ms).

@murillo128
Copy link
Member

murillo128 commented Oct 13, 2019 via email

@notedit
Copy link
Contributor Author

notedit commented Oct 15, 2019

Ok, Will give a pr when i have more free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants