Skip to content

🎥 Make videos programmatically with React

stuff added

Patric Salvisberg11b314640563
diff --git a/packages/docs/components/OverlayDemo.tsx b/packages/docs/components/OverlayDemo.tsx
new file mode 100644
index 0000000000..f92593af20
--- /dev/null
+++ b/packages/docs/components/OverlayDemo.tsx
@@ -0,0 +1,48 @@
+import React, { useCallback, useRef } from "react";
+import "./transparent-video.css";
+
+export const OverlayDemo: React.FC = () => {
+ const ref = useRef<HTMLVideoElement>(null);
+ const onClick = useCallback(() => {
+ ref.current?.classList.toggle("transparent");
+ }, []);
+ return (
+ <div>
+ <div
+ style={{
+ alignItems: "flex-start",
+ flexDirection: "row",
+ display: "flex",
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ width: "70%",
+ flexDirection: "column",
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column",
+ border: "1px solid var(--ifm-color-emphasis-300)",
+ borderRadius: "var(--ifm-pre-border-radius)",
+ }}
+ >
+ <video ref={ref} src="/img/overlay.webm" controls autoPlay loop />
+ </div>
+ <div style={{ marginTop: "8px" }} />
+ <p className="tr-centered" onClick={onClick}>
+ <button type="button">Toggle transparency</button>
+ </p>
+ </div>
+
+ <p style={{ marginLeft: "10px" }}>
+ {" "}
+ Want the source code? Check out the template
+ </p>
+ </div>
+ </div>
+ );
+};
diff --git a/packages/docs/components/OverlayInDavinci.tsx b/packages/docs/components/OverlayInDavinci.tsx
new file mode 100644
index 0000000000..3e710d254a
--- /dev/null
+++ b/packages/docs/components/OverlayInDavinci.tsx
@@ -0,0 +1,12 @@
+import React, { useRef } from "react";
+import "./transparent-video.css";
+
+export const OverlayInDavinci: React.FC = () => {
+ const ref = useRef<HTMLVideoElement>(null);
+
+ return (
+ <div>
+ <video ref={ref} src="/img/OverlayInDavinci.mov" controls autoPlay loop />
+ </div>
+ );
+};
diff --git a/packages/docs/docs/overlay.md b/packages/docs/docs/overlay.md
new file mode 100644
index 0000000000..73383743dd
--- /dev/null
+++ b/packages/docs/docs/overlay.md
@@ -0,0 +1,58 @@
+---
+id: prores-overlay
+title: ProRes Overlay
+---
+
+If you want to export a remotion video to use it as an overlay or transition in an conventional video editing software, you can export it as an Apple ProRes file, which is supported by Final Cut Pro, Adobe Premiere and Davinci Resolve. Make sure your composition has no background color!
+
+## Exporting a video as ProRes file
+
+To export the video as ProRes file, you can setup the remotion.config.ts file as follows
+
+```tsx twoslash
+import { Config } from "remotion";
+
+Config.Rendering.setImageFormat("png");
+Config.Output.setPixelFormat("yuva444p10le");
+Config.Output.setCodec("prores");
+Config.Output.setProResProfile("4444");
+```
+
+and trigger the render with
+
+```bash
+npx remotion render
+```
+
+Alternatively, you can set the settings directly on the command line:
+
+```bash
+npx remotion render --image-format=png --pixel-format=yuva444p10le --codec=prores --prores-profile=4444
+```
+
+## See an example
+
+import { OverlayDemo } from "../components/OverlayDemo";
+
+```twoslash include example
+const MyVideo: React.FC<{
+ transparent: boolean;
+}> = ({transparent}) => {
+ return (
+ <div style={{backgroundColor: transparent ? undefined : 'white', flex: 1}}>
+ {/* Omit opaque background based on `transparent` prop */}
+ </div>
+ )
+}
+// - MyVideo
+```
+
+<OverlayDemo/>
+
+## Use it in your Video Editor
+
+Now, you can simply import the video into your video editing software. You can find the video in the out folder from your remotion project.
+
+import { OverlayInDavinci } from "../components/OverlayInDavinci";
+
+<OverlayInDavinci/>
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 528ad56527..80cf6ea88e 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -323,6 +323,7 @@ module.exports = {
"scaling",
"video-manipulation",
"render-as-gif",
+ "prores-overlay",
],
},
{
diff --git a/packages/docs/static/img/DavinciOverlay.gif b/packages/docs/static/img/DavinciOverlay.gif
new file mode 100644
index 0000000000..059ccfe73f
Binary files /dev/null and b/packages/docs/static/img/DavinciOverlay.gif differ
diff --git a/packages/docs/static/img/OverlayInDavinci.mov b/packages/docs/static/img/OverlayInDavinci.mov
new file mode 100644
index 0000000000..58532551e6
Binary files /dev/null and b/packages/docs/static/img/OverlayInDavinci.mov differ
diff --git a/packages/docs/static/img/overlay.webm b/packages/docs/static/img/overlay.webm
new file mode 100644
index 0000000000..43f2ef44b2
Binary files /dev/null and b/packages/docs/static/img/overlay.webm differ