timotheeg / nestrischamps

A web-based OCR and restreamer system for NES Classic Tetris players
MIT License
45 stars 11 forks source link

Add optional FrameBuffer to smoothen playback #85

Closed timotheeg closed 3 years ago

timotheeg commented 3 years ago

Frames can be buffered to be replayed according to their recorded capture time on the sender-side. This should help smoothen out the playback when the latency is unstable (frames received clumped together will be played back with the correct time spacing).

Implementation is simple and straight forward, but I worry about edge cases (e.g. hard refresh of the producer), so this needs to be tested.

The Frame Buffer resets when it gets empty. This might create some weird visual glitches when connections are not stable.

timotheeg commented 3 years ago

Test locally, looks like it works.

To prevent changes to prod, frame buffer is activated Lazily if a query string args is passed in the renderer.

Supported layouts so far: ctm, ctm_video, ctm_video2, ctm_2matches, ctwc