Skip to content

🎥 Make videos programmatically with React

multithreading docs

Jonny Burger61811f36a586
diff --git a/packages/docs/docs/flickering.md b/packages/docs/docs/flickering.md
new file mode 100644
index 0000000000..6dbc363b7e
--- /dev/null
+++ b/packages/docs/docs/flickering.md
@@ -0,0 +1,27 @@
+---
+id: flickering
+title: Flickering
+---
+
+If your video flickers during rendering, it is an indication that you have a **multi-threading issue**.
+
+The rendering process of Remotion works as followed:
+
+<img src="/static/img/parallel-rendering.png" />
+
+We open multiple tabs to render the video to speed up the process dramatically. These tabs don't share state and animations that run independent of [`useCurrentFrame()`](/docs/use-current-frame) will break. Frames don't render in order and frames can be skipped.
+
+## Solution
+
+You need to code your video in a way that animations run purely off the value of [`useCurrentFrame()`](/docs/use-current-frame). Think of your component as a function that transforms a frame number into an image. Make sure you check all these boxes:
+
+- [x] Your component should always give the same result when called multiple times.
+- [x] Your component should not rely on frames being rendered sequentially.
+- [x] Your component should not animate when the video is paused.
+- [x] Your component should not rely on randomness - [Exception: `random()`](/docs/random)
+
+## Integrations
+
+Often the problem arises from using other animation techniques than the ones built into Remotion. These techniques animate based off realtime instead of `useCurrentFrame()`. Sometimes we can apply a patch to synchronize other animation techniques with Remotion.
+
+Head over to [**the list of integrations**](/docs/third-party) to see if there is an integration for your animation technique.
diff --git a/packages/docs/docs/third-party.md b/packages/docs/docs/third-party.md
new file mode 100644
index 0000000000..9fdce4fa81
--- /dev/null
+++ b/packages/docs/docs/third-party.md
@@ -0,0 +1,41 @@
+---
+id: third-party
+title: Third party integrations
+sidebar_label: Third party integrations
+---
+
+All animations in Remotion must be driven by the value returned by the [`useCurrentFrame()`](/docs/use-current-frame) hook. If you would like to use another way of animations in Remotion, you need an integration that supports synchronizing the timing with Remotion.
+
+On this page, we maintain a list of integrations for popular ways of animating on the web, and provide status for popular requests.
+
+## CSS animations
+
+You can synchronize animations with Remotions time using the `animation-play-state` and `animation-delay` CSS properties. Check out [example code](https://github.com/ahgsql/remotion-animation/blob/main/src/index.js) or use the [remotion-animation](https://github.com/ahgsql/remotion-animation/blob/main/src/index.js) library directly (_inofficial library_).
+
+## GIFs
+
+Use the [`@remotion/gif`](/docs/gif) component.
+
+## Framer Motion
+
+At the moment, we don't have a Framer Motion integration, but are discussing the matter on [Github Issues](https://github.com/remotion-dev/remotion/issues/399).
+
+## Lottie
+
+Use the [`remotion-lottie`](https://github.com/ahgsql/remotion-lottie) package (_inofficial library_).
+
+## Three.JS
+
+Use the [`@remotion/three`](/docs/three) package.
+
+## react-spring
+
+There is no direct compatibility but Remotion provides it's own [`spring()`](/docs/spring) instead.
+
+## Reanimated
+
+There is no integration available but Remotion shares some code with Reanimated, in particular [`interpolate()`](/docs/interpolate), [`spring()`](/docs/spring) and [`Easing`](/docs/easing). This makes it easier to refactor already existing animation from Reanimated.
+
+## Other libraries
+
+Are you interested in using other libraries with Remotion? You can [file a Github issue](https://github.com/remotion-dev/remotion/issues/new) to inquire it. While we cannot guarantee to help you, you can register interest and kick of the discussion.
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 705d8e56e5..919e2520ba 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -1,6 +1,7 @@
module.exports = {
someSidebar: [
{
+ collapsed: false,
type: "category",
label: "Getting started",
items: [
@@ -15,6 +16,7 @@ module.exports = {
{
type: "category",
label: "Techniques",
+ collapsed: false,
items: [
"assets",
"using-audio",
@@ -32,6 +34,7 @@ module.exports = {
"webpack",
"legacy-babel",
"env-variables",
+ "third-party",
],
},
"cli",
@@ -39,6 +42,7 @@ module.exports = {
{
type: "category",
label: "API - Core",
+ collapsed: false,
items: [
"continue-render",
"delay-render",
@@ -93,12 +97,14 @@ module.exports = {
{
type: "category",
label: "Troubleshooting",
+ collapsed: false,
items: [
"timeout",
"media-playback-error",
"performance",
"webpack-dynamic-imports",
"non-seekable-media",
+ "flickering",
],
},
"2-0-migration",
diff --git a/packages/docs/static/img/parallel-rendering.png b/packages/docs/static/img/parallel-rendering.png
new file mode 100644
index 0000000000..e115e60b86
Binary files /dev/null and b/packages/docs/static/img/parallel-rendering.png differ