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

Timestamp correction algorithm, default 10ms instead of automatically calculating the timestamp. #425

Closed
winlinvip opened this issue Jun 10, 2015 · 2 comments
Assignees
Labels
Bug It might be a bug. Enhancement Improvement or enhancement. TransByAI Translated by AI/GPT.
Milestone

Comments

@winlinvip
Copy link
Member

winlinvip commented Jun 10, 2015

The key part of the current timestamp correction algorithm is:

        // calc the right diff by audio sample rate
        if (msg->is_audio() && sample_rate > 0) {
            delta = (int64_t)(delta * 1000.0 / sample_rate);
        } else if (msg->is_video() && frame_rate > 0) {
            delta = (int64_t)(delta * 1.0 / frame_rate);
        } else {
            delta = DEFAULT_FRAME_TIME_MS;
        }

That is, it will be calculated based on the fps and sample rate. But in reality, this is not accurate. In other words, the server cannot guarantee that a problematic stream has the correct timestamp. On the contrary, if the timestamp of the stream is incorrect, an obvious correction method should be used to indicate that the stream has an anomaly. Therefore, using the default 10ms is sufficient, and when the timestamp jumps, it is corrected to 10 milliseconds.

TRANS_BY_GPT3

@winlinvip winlinvip added Bug It might be a bug. Enhancement Improvement or enhancement. labels Jun 10, 2015
@winlinvip winlinvip added this to the srs 2.0 release milestone Jun 10, 2015
@winlinvip
Copy link
Member Author

winlinvip commented Jun 10, 2015

In addition, negative values are allowed for timestamps, which means there are discontinuous regions, ranging from [-inf, 0) + (500, inf), to (-inf, -250) + (250, inf).
This means that as long as the timestamp jitter is within 250ms, whether it is forward or backward, it is considered to be without any issues.

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Aug 26, 2021
@winlinvip winlinvip changed the title 时间戳矫正算法,默认10ms而不自动计算时间戳 Timestamp correction algorithm, default 10ms instead of automatically calculating the timestamp. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It might be a bug. Enhancement Improvement or enhancement. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

1 participant