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

WebCodecs - Synchronization #58

Open
kixelated opened this issue Oct 23, 2023 · 1 comment
Open

WebCodecs - Synchronization #58

kixelated opened this issue Oct 23, 2023 · 1 comment

Comments

@kixelated
Copy link
Owner

Audio and video are rendered out of sync. This isn't a big deal with zero latency, but matters more at higher end targets.

@chrisprobst
Copy link

chrisprobst commented Nov 2, 2023

Hi @kixelated, very cool projects. Quick question and that is related to this issue's topic: How do you deal with clock drift?

Meaning, an audio packet with 128 samples (as an example) has a clear duration given by the rate and number of samples. However, 20 ms on my machine are not 20 ms on your machine. That means, there is ALWAYS a difference. WebRTC solved this massive problem (it's really hard to solve) using NetEQ (a library used by Chrome). It is able to shrink and stretch audio in a non-hearable fashion to compensate for that. Otherwise, buffers will (even in a perfect world) always run under or over over time.

Now, de-synchronization is one effect of this issue. I guess your current sync issue has nothing to do with clock drift. But it will arise later, even after you implement sync. Just wanted to share my experience with this topic so you can keep this on your radar. Otherwise, great projects and nice work!!

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

No branches or pull requests

2 participants