liqvidjs / liqvid

Library for interactive videos in React
https://liqvidjs.org
MIT License
754 stars 39 forks source link

How to control the frame rate? #18

Closed anishg-cn closed 2 years ago

anishg-cn commented 2 years ago

Is there a way to change the frame rate in react?

ysulyma commented 2 years ago

If you mean for rendering to static video, see https://liqvidjs.org/docs/rp-master/render/#fps, and relatedly https://liqvidjs.org/docs/rp-master/thumbs/#frequency for generating thumbnails

If you mean the in-browser view: there's no concept of "frames" or "frame rate" in Liqvid. Everything happens with requestAnimationFrame, so the view will be updated as frequently as the browser is able to

anishg-cn commented 2 years ago

@ysulyma I meant the in-browser view

ysulyma commented 2 years ago

Ok then yeah there's no such thing as frame rate per se. Are you running into a performance issue?

anishg-cn commented 2 years ago

@ysulyma yes, the video is not smooth there is a lot of lagging, is there a way to improve the performance?

ysulyma commented 2 years ago

That's likely an issue with your code then (possibly a subscription leak, using React for animation, etc.). Can you provide a sample?