tinypilot
tinypilot copied to clipboard
Video lag when not enough bandwidth
Description
When there is not enough bandwidth to pass the stream through, the video lag accumulates. A page refresh helps reset the lag.
What's the behavior that you expect?
Dropping frames when bandwidth does not allow for full stream. Or degrade quality.
What's happening instead?
The lag increases to values like tens of seconds.
What are the steps to reproduce this behavior?
- Open TinyPilot in Chrome
- Switch network profile to "Slow 3G"
- Do some actions in the KVM
- Observe the lag increase
Logs
Note that to reduce the bandwidth I've lowered ustreamer settings (resolution, fps, quality). http://sprunge.us/UF2fyc
Thanks for reporting. This is a known issue. It's due to the fact that TinyPilot uses MJPEG for video streaming, which browsers support poorly.
I'm looking at options for switching to H264 which is much more bandwidth-efficient and has better browser support, but it's going to take a few months, since it's a significant change.
The author of uStreamer has mentioned that they're implementing h264 - is that the process you're referring to, or is it a separate effort?
It's still up in the air whether uStreamer's h264 implementation will work with TinyPilot. It will be great if we can continue sharing it, but if not, we'll have to move to a different implementation.
Do you know where the buffer builds up? Without looking at all I'm guessing it's ustream, but it could just as easily be nginx, I suppose. I'd be willing to work an an intermediary layer that would detect buffer buildup and proactively drop source frames, if you'd be interested.
I'm not sure, but I think the issue is on the client side in the browser. I don't think it's worth building an intermediate layer, because h264 support is expected soon, though I thought that six months ago too.
The workaround in the meantime is to reduce video settings so that TinyPilot sends frames low enough in bandwidth to avoid clogging the network.
@mtlynch any updates to switch to h264
, looks like it's been a year :)
@michaelguild13 - We're actively working on it. You can follow updates on #875.
It's possible to test a proof of concept install. I recommend doing it on a spare microSD, as it will overwrite any existing TinyPilot installation.
This should be fixed now that H.264 is available.