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 lagging a lot #38

Open
DanilochTop opened this issue Nov 8, 2023 · 10 comments
Open

Video lagging a lot #38

DanilochTop opened this issue Nov 8, 2023 · 10 comments

Comments

@DanilochTop
Copy link

No errors in output, audio plays fine, but the video is lagging a lot, only some frames are playing...
Do you guys have some suggestions to fix this issue?

@dank074
Copy link
Owner

dank074 commented Nov 9, 2023

Make sure you're using h264 codec since the encoder for that uses a lot less cpu than vp8. If your computer/vps still struggles with that you can decrease the bitrate and/or resolution

@DanilochTop
Copy link
Author

DanilochTop commented Nov 9, 2023 via email

@DanilochTop
Copy link
Author

I just tested with a VPS, and it seems to work fine (almost), i just needed to set the stream FPS to 15, but that's not a problem for me. For better results maybe I need a better CPU?

@dank074
Copy link
Owner

dank074 commented Nov 9, 2023

If it wasn't using too much cpu but the resulting video was still slow it could be your internet speed. Try lowering the bitrate and resolution

@longnguyen2004
Copy link
Collaborator

Can you test the current version of the package? I've optimized various parts in the code, and it should be purely IO bound now.

@Darwin1546
Copy link

@Darwin1546
Copy link

I've added buffer and performance/quality is fine now.
I deleted

-fflags nobuffer
-analyzeduration 0

and added

-bufsize 6000k

But audio still ahead of the video. And I have no idea how to fix that

@dank074
Copy link
Owner

dank074 commented Sep 28, 2024

What kind of video input is it? A regular video file or a m3u8 livestream? I know that there's an issue with certain m3u8 streams where the audio is out of sync with the video and the only solution I found was to remove the '-re' flag. There's an open issue about it

@Darwin1546
Copy link

Darwin1546 commented Sep 28, 2024

I'm using this interface https://github.com/ysdragon/StreamBot

It doesn't support readAtNativeFps option afaik
Is '-re' enabled by default?

I've tested local file and youtube video (it still loads locally)

Also this ysdragon/StreamBot#37 (comment)

@dank074
Copy link
Owner

dank074 commented Sep 28, 2024

At some point it was the default, until I removed it and added it as an option instead since it did not affect all video files

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

4 participants