Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve single-instance rendering performance #4664

Open
tzvc opened this issue Dec 23, 2024 · 4 comments
Open

Improve single-instance rendering performance #4664

tzvc opened this issue Dec 23, 2024 · 4 comments

Comments

@tzvc
Copy link

tzvc commented Dec 23, 2024

We’ve discovered that running Remotion renderer on powerful VPSs (e.g., 48 cores, 350GB RAM) with increased concurrency does not consistently improve performance and can sometimes make rendering slower. Investigations point to two main bottlenecks:

Chrome Resource Allocation

Simply opening more Chrome tabs doesn’t linearly increase resource usage.
Running multiple browser instances (rather than multiple tabs in a single instance) can yield better (but still limited) performance gains.

OffthreadVideo Frame Extraction

Videos are extracted frame-by-frame, making it difficult to parallelize.
Composition with heavy OffthreadVideos can see significant slowdowns at high concurrency.

A thorough discussion of these findings, along with logs and performance charts, is available in the existing issue.

Goal
The goal of this issue is spark a conversation on solutions to improve single instance rendering performance, with for example:

New concurrency strategies (e.g., multi-browser instances)
Possible refactors for more efficient frame extraction (e.g., multi-threading/process compositor, preprocessing, optimistic caching, open the same video streams concurrently).

We use Remotion professionally and this would have a great impact for us, I'll open a $500 bounty for a working solution.

Copy link

algora-pbc bot commented Dec 23, 2024

💎 $500 bounty • zigg.team

⏸️ Bounty Status: ON HOLD

This bounty has been placed on hold to ensure any solutions align with the project's long-term direction. It might be reactivated in the future if the issue is ready to accept external contributions.

@abhishek818
Copy link
Contributor

abhishek818 commented Dec 23, 2024

/attempt #4664

Algora profile Completed bounties Tech Active attempts Options
@abhishek818    3 remotion bounties
+ 20 bounties from 5 projects
Go, TypeScript,
Rust & more
Cancel attempt

@algora-pbc algora-pbc bot removed the 💎 Bounty label Dec 23, 2024
@JonnyBurger
Copy link
Member

Thanks for filing and posting a bounty!

Although appreciated, I cancelled the bounty because there are tons of contributors who would attempt this without any context.
The hard issues we don't wanna outsource without also specifying how we expect the issue to be solved, otherwise random things happen which leads to overhead.

The feature request is valid but it concerns two completely separate things.

Frame extraction:
The path forward for improving frame extraction performance I think is to further progress @remotion/media-parser + the WebCodecs interface so that this can happen in-browser, without the overhead of Rust+serializing to images+Node at play. Plus it would make it possible to stream the video rather than downloading it entirely and if available use the hardware acceleration.

I'm working myself towards this goal, which would be a new video tag that would replace Video and OffthreadVideo in the long-term. Please understand though that this will still take some time.

Chrome resources:
It would be nice to support having multiple Chrome instances and be able to specify the concurrency like 2x2 (2 browser instances with 2 tabs each).

@tzvc
Copy link
Author

tzvc commented Dec 29, 2024

@JonnyBurger understandable. Do let me know if there is anything we can do to offer support for this work

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

No branches or pull requests

3 participants