From 58e9e89fe1c1ffcbd6bd206688dd19ee48caf646 Mon Sep 17 00:00:00 2001 From: Joe Heffernan Date: Wed, 15 Nov 2023 13:34:54 -0800 Subject: [PATCH] specify fps in captureStream --- src/simularium/StreamRecorder.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/simularium/StreamRecorder.tsx b/src/simularium/StreamRecorder.tsx index 6ddc7978..bc58461d 100644 --- a/src/simularium/StreamRecorder.tsx +++ b/src/simularium/StreamRecorder.tsx @@ -38,7 +38,10 @@ class Recorder { try { // returns a media stream captured from the viewer canvas // more details here: https://developer.chrome.com/en/articles/webcodecs/ - const stream = this.canvasEl.captureStream(); + + // fixed at 30 fps for now + const fps = 30; + const stream = this.canvasEl.captureStream(fps); const track = stream.getVideoTracks()[0]; // MediaStreamTrackProcessor makes the captured stream readable this.trackProcessor = new MediaStreamTrackProcessor(track);