Long running func animation

I have a pyplot func animation with lots of frames that takes too long to render beforehand. Is it possible to get the same functionality as with the FuncAnimation from pyplot, maybe with a workaround?

Maybe have a look at GitHub - whitphx/streamlit-webrtc: Real-time video and audio processing on Streamlit .

IIRC it can be used to create frames in server and stream them to browser, out of the page-run lifecycle.