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

Recent changes to video-rtc.js introduced ~1 second delay to MSE stream #1602

Closed
AndrewEyesman opened this issue Feb 14, 2025 · 4 comments
Closed
Labels
question Further information is requested

Comments

@AndrewEyesman
Copy link

Hello, I've been integrating the MSE stream example from the go2rtc demo into my project. While the stream loads successfully, I noticed a ~1s delay compared to the demo example.

After some investigation, I traced the issue to the video-rtc.js file, which I borrowed from the demo. Specifically, the delay appears to be introduced by the recent “Improve delay for MSE player” commit.

To confirm this, I tested an older version of video-rtc.js (before this commit), and the delay disappeared.

Unfortunately, I haven't pinpointed the exact cause, but it seems the recent changes introduced unintended latency. Hopefully, someone can reproduce the issue and identify the fix.

Additional context

By “MSE stream example,” I’m specifically referring to this one:
Image

Environment

Go2rtc host: Docker
Browser: [Chrome]
Operating System: [Windows]
Frontend Framework: [React/Vite]

I'm happy to provide any additional information if needed.

@AndrewEyesman AndrewEyesman changed the title [BUG] Recent changes to video-rtc.js introduced ~1 second delay to MSE stream Recent changes to video-rtc.js introduced ~1 second delay to MSE stream Feb 14, 2025
@AlexxIT AlexxIT added the question Further information is requested label Feb 14, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Feb 14, 2025

I don't know what you mean about demo. Go2rtc doesn't have any demo.

1 sec delay for MSE added for a reason. It could work worse for perfect connection. But it works better for other connections. Because it added controllable buffer before player.

@AndrewEyesman
Copy link
Author

When I say demo I'm referring to the web UI. Sorry for not being clear.

Thank you for confirming this is not a bug. However, the 1 sec delay is not ideal for some cases. For example I'm integrating PTZ commands to my application but it feels much worse because of the delay.

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 14, 2025

You can use old JS version. It's hard to write best logic for all cases.
Old version works fine only in local network. Or on very good channels. And with streams with low quality.

@AndrewEyesman
Copy link
Author

Ok thank you. I will consider this moving forward.

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

No branches or pull requests

2 participants