Skip to content

fix(demo): stabilize video export#38

Open
ptj0225 wants to merge 1 commit into
nv-tlabs:mainfrom
ptj0225:fix/video-export-frame-order
Open

fix(demo): stabilize video export#38
ptj0225 wants to merge 1 commit into
nv-tlabs:mainfrom
ptj0225:fix/video-export-frame-order

Conversation

@ptj0225

@ptj0225 ptj0225 commented Jun 9, 2026

Copy link
Copy Markdown

• ## Summary

  • Stabilize video export from Exports > Video > Download Video.
  • Pause playback while recording export frames.
  • Flush each frame update before requesting the browser canvas render.
  • Restore the original frame and playback state after export finishes.

Root Cause

The video export path iterates over every frame, calls demo.set_frame(...), and immediately requests a browser render with event_client.get_render(...).

That can race in two ways:

  • If playback is active, the background playback loop can advance session.frame_idx while export is also stepping frames.
  • Viser frame updates can remain in the websocket message buffer, so the render request may capture the previous or otherwise stale visual frame before the new frame is applied in the browser.

As a result, exported videos could appear to have frames out of order or visually mixed.

Fix

During video export:

  • Save the current playback state.
  • Set session.playing = False to stop the background playback loop from changing frames.
  • Call event_client.flush() after each demo.set_frame(...) before get_render(...).
  • Restore the original frame and flush it.
  • Restore the original playback state in finally.

@ptj0225 ptj0225 marked this pull request as ready for review June 9, 2026 07:20
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

Successfully merging this pull request may close these issues.

1 participant