Skip to content

🎥 Make videos programmatically with React

finetuning

Jonny Burgerb828308a3f05
diff --git a/packages/create-video/package.json b/packages/create-video/package.json
index cb6f4d70ad..97b73cc55d 100644
--- a/packages/create-video/package.json
+++ b/packages/create-video/package.json
@@ -30,6 +30,7 @@
"@types/node": "^16.7.5",
"@types/prompts": "^2.0.12",
"@types/tar": "6.1.1",
+ "@types/react": "18.0.23",
"eslint": "8.25.0",
"got": "^11",
"prettier": "2.6.2",
diff --git a/packages/create-video/src/templates.ts b/packages/create-video/src/templates.tsx
similarity index 95%
rename from packages/create-video/src/templates.ts
rename to packages/create-video/src/templates.tsx
index 120370f256..ee041157e1 100644
--- a/packages/create-video/src/templates.ts
+++ b/packages/create-video/src/templates.tsx
@@ -22,7 +22,7 @@ export type Template = {
org: string;
repoName: string;
homePageLabel: string;
- longerDescription: string;
+ longerDescription: React.ReactNode;
cliId:
| 'hello-world'
| 'javascript'
@@ -215,8 +215,13 @@ export const FEATURED_TEMPLATES: Template[] = [
org: 'remotion-dev',
repoName: 'template-overlay',
description: 'TypeScript and Tailwind starter',
- longerDescription:
- 'A starter template to create overlays to use in conventional video editing software.',
+ longerDescription: (
+ <span>
+ A starter template to create overlays to use in conventional video
+ editing software.{' '}
+ <a href="/docs/overlay">Read more about creating overlays.</a>
+ </span>
+ ),
promoVideo: {
muxId: 'zgy7XK01009y33Vfzhns02cZS00rOyeZ6WaanaxcrDysqmU',
height: 720,
diff --git a/packages/docs/components/OverlayDemo.tsx b/packages/docs/components/OverlayDemo.tsx
index db8fe1bd0b..0576ca5c52 100644
--- a/packages/docs/components/OverlayDemo.tsx
+++ b/packages/docs/components/OverlayDemo.tsx
@@ -28,9 +28,17 @@ export const OverlayDemo: React.FC = () => {
flexDirection: "column",
border: "1px solid var(--ifm-color-emphasis-300)",
borderRadius: "var(--ifm-pre-border-radius)",
+ overflow: "hidden",
}}
>
- <video ref={ref} src="/img/overlay.webm" controls autoPlay loop />
+ <video
+ ref={ref}
+ className="transparent"
+ src="/img/overlay.webm"
+ autoPlay
+ loop
+ muted
+ />
</div>
<div style={{ marginTop: "8px" }} />
<p className="tr-centered" onClick={onClick}>
@@ -40,13 +48,14 @@ export const OverlayDemo: React.FC = () => {
<p style={{ marginLeft: "10px" }}>
{" "}
- Want the source code? Check out the{" "}
+ Use our template by cloning the{" "}
<a
href="https://github.com/remotion-dev/template-overlay"
target="_blank"
>
- template
- </a>
+ GitHub repo
+ </a>{" "}
+ or running <code>npx create-video --overlay</code>.
</p>
</div>
</div>
diff --git a/packages/docs/docs/overlay.md b/packages/docs/docs/overlay.md
index ecf23ce79e..a49708a8e2 100644
--- a/packages/docs/docs/overlay.md
+++ b/packages/docs/docs/overlay.md
@@ -1,15 +1,17 @@
---
-id: prores-overlay
-title: Overlay
+id: overlay
+title: Creating overlays
---
-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!
+If you want to export a Remotion video to use it as an overlay or transition in a conventional video editing software, you can export it as a transparent Apple ProRes file, which is supported by Final Cut Pro, Adobe Premiere and Davinci Resolve.
## Exporting a video as ProRes file
-To export the video as ProRes file, you can setup the remotion.config.ts file as follows
+<InlineStep>1</InlineStep> Make sure your composition has no background color. If you toggle the transparency option on in the editor, you should see a checkerboard background. <br /> <br/>
-```tsx twoslash
+<InlineStep>2</InlineStep> To export the video as ProRes file, setup the <code>remotion.config.ts</code> file as follows: <br/><br/>
+
+```tsx twoslash title="remotion.config.ts"
import { Config } from "remotion";
Config.Rendering.setImageFormat("png");
@@ -30,7 +32,7 @@ Alternatively, you can set the settings directly on the command line:
npx remotion render --image-format=png --pixel-format=yuva444p10le --codec=prores --prores-profile=4444
```
-## See an example
+## Use a template
import { OverlayDemo } from "../components/OverlayDemo";
@@ -51,7 +53,7 @@ const MyVideo: React.FC<{
## 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.
+Now, you can simply import the video into your video editing software. You can find the video in the out folder of your Remotion project.
import { OverlayInDavinci } from "../components/OverlayInDavinci";
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 80cf6ea88e..fdec09b7f8 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -323,7 +323,7 @@ module.exports = {
"scaling",
"video-manipulation",
"render-as-gif",
- "prores-overlay",
+ "overlay",
],
},
{
diff --git a/packages/docs/src/theme/MDXComponents.js b/packages/docs/src/theme/MDXComponents.js
new file mode 100644
index 0000000000..11447de1f7
--- /dev/null
+++ b/packages/docs/src/theme/MDXComponents.js
@@ -0,0 +1,8 @@
+// Import the original mapper
+import MDXComponents from "@theme-original/MDXComponents";
+import { InlineStep } from "../../components/InlineStep";
+
+export default {
+ ...MDXComponents,
+ InlineStep,
+};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c4e969e648..22a737c05d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -216,6 +216,7 @@ importers:
'@types/minimist': 1.2.2
'@types/node': ^16.7.5
'@types/prompts': ^2.0.12
+ '@types/react': 18.0.23
'@types/tar': 6.1.1
chalk: 4.1.2
eslint: 8.25.0
@@ -239,6 +240,7 @@ importers:
'@types/minimist': 1.2.2
'@types/node': 16.10.2
'@types/prompts': 2.0.14
+ '@types/react': 18.0.23
'@types/tar': 6.1.1
eslint: 8.25.0
got: 11.8.5