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

[core] Added SRTO_MININPUTBW #1791

Merged
merged 4 commits into from
Feb 22, 2021

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Feb 5, 2021

A simplification of #1541 and #1383.
The proposed SRTO_MININPUTBW socket option allows specifying the minimum input bitrate estimate used to set bandwidth limit.

Effective when SRTO_INPUTBW = 0 -> input bitrate estimation.

input_rate = max(SRTO_MININPUTBW, estimate)
BWLimit = input_rate * (1 + SRTO_OHEADBW / 100.0)

TODO

  • Update APISocketOptions.md

@maxsharabayko maxsharabayko added Type: Enhancement Indicates new feature requests [core] Area: Changes in SRT library core labels Feb 5, 2021
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Feb 5, 2021
@maxsharabayko maxsharabayko self-assigned this Feb 5, 2021
Copy link
Collaborator

@jeandube jeandube left a comment

Choose a reason for hiding this comment

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

Way simpler than the SRTO_OUTPACEMODE option it replaces. Maintain backward compatibility but setting both SRTO_INPUTBW and SRTO_MININPUTBW would lead to unexpected results. The documentation should clarify that SRTO_MININPUTBW is a floor to the internally measured input rate.

srtcore/core.cpp Outdated Show resolved Hide resolved
@maxsharabayko
Copy link
Collaborator Author

Way simpler than the SRTO_OUTPACEMODE option it replaces. Maintain backward compatibility but setting both SRTO_INPUTBW and SRTO_MININPUTBW would lead to unexpected results. The documentation should clarify that SRTO_MININPUTBW is a floor to the internally measured input rate.

The proposed behavior is that SRTO_MININPUTBW is only effective when both SRTO_MAXBW and SRTO_INPUTBW are set to zero, meaning input bitrate estimation is in use.

@maxsharabayko maxsharabayko force-pushed the develop/min-inputbw branch 2 times, most recently from 5a43fc7 to d7208d7 Compare February 19, 2021 08:55
@maxsharabayko
Copy link
Collaborator Author

Test

Sending starts at 1 Mbps, five seconds later sending rate is increased to 5 Mbps.

Input BW Estimation

SRTO_MAXBW = 0
SRTO_INPUTBW = 0; // Estimate internally
SRTO_OHEADBW = 25;
SRTO_MININPUTBW = 0;

sender-estinputbw

Input BW Estimation + Setting Min Input BW

SRTO_MAXBW = 0
SRTO_INPUTBW = 0; // Estimate internally
SRTO_OHEADBW = 25;
SRTO_MININPUTBW = 1 Mbps;
// Once "encoder" changes sending rate from 1Mbps to 5Mbps
SRTO_MININPUTBW = 5 Mbps;

setting-mininputbw

@maxsharabayko maxsharabayko marked this pull request as ready for review February 19, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants