Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Conversation

gondaruk
Copy link
Contributor

Fix case, when bitrate goes slightly higher than max-bitrate which leads to fec-percentage being out of range.

@MathieuDuponchelle
Copy link
Collaborator

hrm, isn't that bitrate clamped properly at this point? If not, shouldn't we fix that instead? :)

@gondaruk
Copy link
Contributor Author

gondaruk commented Aug 22, 2022

Looks like before gcc was introduced, target_bitrate was used in calculation which was always <= max_bitrate.
Here, looks like actual bitrate is used, which can be more than max_bitrate.

UPD: I could misunderstood this, and maybe bitrate should be clamped instead :)

@gondaruk
Copy link
Contributor Author

Hmm. My bad. bitrate in this context is estimated bitrate notified by rtpgccbwe. Maybe, you're right and rtpgccbwe should not estimate more than max_bitrate?

@gondaruk gondaruk force-pushed the bugfix/fec-percentage branch from f9576cb to d512817 Compare August 22, 2022 23:54
@gondaruk
Copy link
Contributor Author

@MathieuDuponchelle sorry for confusion. I should have check deeper before doing PR.

Here is what I found.
If do_fec is set to true - rtpgccbwe's max-bitrate will be max-bitrate * 1.5.

So, bitrate in this callback is clamped but with different "max", because it includes the bitrate which is supposed to be used for fec.
I've updated the PR to contain fec check as well.

Let me know what you think. Thanks :)

@MathieuDuponchelle
Copy link
Collaborator

@thiblahute ? this is all a bit ugly, not sure how to make nicer :)

@thiblahute
Copy link
Contributor

I think the way to make it nicer would be to have the max-bitrate take FEC into account all the time and then set the encoder bitrate / fec porcentage as needed, what do you think?

@MathieuDuponchelle
Copy link
Collaborator

I think the way to make it nicer would be to have the max-bitrate take FEC into account all the time and then set the encoder bitrate / fec porcentage as needed, what do you think?

You mean that it should also be the meaning of the prop as exposed to the user? I suppose that's a solution

@thiblahute
Copy link
Contributor

I think the way to make it nicer would be to have the max-bitrate take FEC into account all the time and then set the encoder bitrate / fec porcentage as needed, what do you think?

You mean that it should also be the meaning of the prop as exposed to the user? I suppose that's a solution

Yes, that is what I mean

@MathieuDuponchelle
Copy link
Collaborator

@gondaruk , I guess that needs a decision, I say we go with what thibault suggests if you agree :)

@gondaruk gondaruk marked this pull request as draft August 25, 2022 18:16
@gondaruk
Copy link
Contributor Author

Thanks!
Let me work on that and I'll get back :)

@gondaruk gondaruk force-pushed the bugfix/fec-percentage branch from d512817 to 255e8b5 Compare August 30, 2022 19:26
@gondaruk
Copy link
Contributor Author

Hey @MathieuDuponchelle @thiblahute,
whenever you have a chance, could you please take a look on the update and let me know if it's what you meant or if I misunderstood you?
Thanks!

@gondaruk gondaruk marked this pull request as ready for review August 30, 2022 19:37
@MathieuDuponchelle
Copy link
Collaborator

care to review this one @thiblahute ? :)

@gondaruk gondaruk force-pushed the bugfix/fec-percentage branch from 255e8b5 to cbd8fd7 Compare September 1, 2022 18:25
@gondaruk gondaruk marked this pull request as draft September 5, 2022 15:36
@gondaruk gondaruk force-pushed the bugfix/fec-percentage branch from cbd8fd7 to cf1fe91 Compare September 5, 2022 22:08
@gondaruk gondaruk marked this pull request as ready for review September 5, 2022 22:19
@gondaruk
Copy link
Contributor Author

gondaruk commented Sep 5, 2022

@thiblahute @MathieuDuponchelle, whenever you have a chance, could you please take a look?
Thanks :)

@gondaruk gondaruk force-pushed the bugfix/fec-percentage branch from cf1fe91 to 989c4b5 Compare September 5, 2022 22:29
@gondaruk gondaruk requested a review from thiblahute September 7, 2022 12:50
Copy link
Contributor

@thiblahute thiblahute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@gondaruk gondaruk force-pushed the bugfix/fec-percentage branch from 989c4b5 to e6d2af1 Compare September 7, 2022 19:24
@gondaruk gondaruk requested a review from thiblahute September 7, 2022 19:26
@gondaruk