-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
@remotion/compositor
: Faster <OffthreadVideo>
concurrency model
#4831
Merged
+4,611
−3,891
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@remotion/compositor
: Rework concurrency model@remotion/compositor
: Faster <OffthreadVideo>
concurrency model
Amazing work, I'll try that right away! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This re-architects the Rust binary that is being used for
<OffthreadVideo>
to properly multithread when using multiple streams are included.This should by default improve the rendering speed of videos with picture-in-picture layouts or similar, and even makes it a bit faster when using 1 stream.
By default, 2 threads are allowed, but it can be increased or decreased using the new
--offthreadvideo-video-threads
option.As always, it is not a good idea to set the concurrency too high, because FFmpeg already uses multiple cores for extracting frames already. Slowly ramp up the value and observe.
This option is designed for users with beefy machines such as high-core VPS-es. We encourage those to play around with the new
offthreadVideoThreads
option and find an ideal value.Advanced, experimental option: Frames that are close to each other will still only cause 1 stream to be opened. That still makes sense, as otherwise using multiple threads is wasteful, because most frames in a video depend on other frames before and after.
However, one idea is that we can change the render so it does not render from start to end, but instead one tab renders the first half of the video and the second tab renders the second half of the video. Same idea with n > 2 tabs. This will force more streams to be opened concurrently.
To try out this idea, you can set the
REMOTION_PARTITIONED_RENDERING=true
environment variable.We may remove this option in the future if it does turn out to make renders faster.