When I do canvas.capturestream and publish, the fp...
# ask-ai
e
When I do canvas.capturestream and publish, the fps drops to 1 fps
t
Thanks for reaching out, Oludare. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you get this sorted out! Could you please share a bit more about your setup? Specifically: • Which browser and version are you using? • Are there any special configurations or settings you’ve applied to the canvas or during the publishing process? • Does this happen every time, or only in certain situations? Having these details will really help me understand what's going on and find the best solution for you.
e
Chrome. Just a triangle on the canvas moving around It happens every time.
t
I understand how frustrating FPS drops can be when using
canvas.captureStream
in Chrome, so let’s work through some helpful optimization steps together: • Try setting a maximum FPS with the
maxFps
option. It’s usually set to 30 by default, but you can adjust it to better fit your needs. • Implementing frame rate throttling can really help avoid processing duplicate frames. Here’s how you can do that: ◦ Keep track of the last processed timestamp. ◦ Make sure there’s a minimum time between frames based on your
maxFps
. ◦ Process new frames only when the video has actually updated. • If possible, you might want to explore using the newer
MediaStreamTrackProcessor
API instead of
canvas.captureStream
, as it tends to offer better performance. Please feel free to reach out if you’d like more detailed guidance on implementing any of these steps—I’m here to help! Sources: src/webgl/index.ts