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

Video and audio desync #7

Open
blk750 opened this issue Nov 7, 2023 · 1 comment
Open

Video and audio desync #7

blk750 opened this issue Nov 7, 2023 · 1 comment

Comments

@blk750
Copy link

blk750 commented Nov 7, 2023

It usually only takes a couple seconds, at most 30 seconds.
(Yes, I am compiling on release build).

I did this:

        //let frame_timer_guard = self.frame_timer.schedule_repeating(video_wait_duration, move || {
        let frame_timer_guard = self.frame_timer.schedule_repeating(Duration::zero(), move || {
            play(&video_streamer_ref);
            ctx.request_repaint();
        });

and it did not have trouble decoding video unthrottled, so it's not a problem of getting frames to the GPU.

I did this test real quick with OBS and the example program:
Video
so the video stream is playing slightly too fast on my machine.

(I also tried this on chubby1968's fork (commit 7abbc48), and I have the same problems.)

@n00kii
Copy link
Owner

n00kii commented Nov 8, 2023

thanks for catching this. timer says callbacks shouldn't be called before the wait duration so perhaps the wait duration calculation (Duration::milliseconds((1000. / self.framerate) as i64)) is inaccurate, even with double precision. im planning out a full rewrite of the streamer internals, so ill keep an eye out for that once i can test.

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