Skip to content

🎥 Make videos programmatically with React

test out transparency

Jonny Burgerca8218352188
diff --git a/packages/example/package.json b/packages/example/package.json
index 839e9e2d61..9d8b179fb9 100644
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@ -8,7 +8,7 @@
"start": "npx ts-node ../cli/src/index.tsx preview src/index.tsx",
"test": "eslint src --ext ts,tsx,js,jsx",
"build": "tsc -d",
- "render": "remotion render src/index.tsx react-svg video.mp4"
+ "render": "remotion render src/index.tsx react-svg video.webm"
},
"files": [
"dist"
diff --git a/packages/example/remotion.config.ts b/packages/example/remotion.config.ts
index 0dec8e0a94..7ba72798ff 100644
--- a/packages/example/remotion.config.ts
+++ b/packages/example/remotion.config.ts
@@ -2,8 +2,10 @@ import os from 'os';
import {Config} from 'remotion';
Config.Rendering.setConcurrency(os.cpus().length);
+Config.Rendering.setImageFormat('png');
Config.Output.setOverwriteOutput(true);
-Config.Output.setPixelFormat('yuv420p');
+Config.Output.setPixelFormat('yuva420p');
+Config.Output.setCodec('vp8');
Config.Bundling.overrideWebpackConfig((currentConfiguration) => {
return {
diff --git a/packages/example/src/ReactSvg/index.tsx b/packages/example/src/ReactSvg/index.tsx
index c891ea12f3..30bf0985d7 100644
--- a/packages/example/src/ReactSvg/index.tsx
+++ b/packages/example/src/ReactSvg/index.tsx
@@ -5,7 +5,9 @@ import {Atom} from './Atom';
import {Black} from './Black';
import {DotGrid} from './DotGrid';
-const ReactSvg: React.FC = () => {
+const ReactSvg: React.FC<{
+ transparent: boolean;
+}> = ({transparent}) => {
const frame = useCurrentFrame();
const videoConfig = useVideoConfig();
const start = 0;
@@ -81,7 +83,7 @@ const ReactSvg: React.FC = () => {
const scale = frame < 70 ? scaleIn : scaleOut;
return (
- <div style={{flex: 1, backgroundColor: 'white'}}>
+ <div style={{flex: 1, backgroundColor: transparent ? undefined : 'white'}}>
<div
style={{
position: 'absolute',
@@ -90,7 +92,7 @@ const ReactSvg: React.FC = () => {
transform: `scale(${scale})`,
}}
>
- <DotGrid />
+ {transparent ? null : <DotGrid />}
<Arc
rotateProgress={rotationDevelopment}
progress={development}
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index f98abe67ae..399666f349 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -68,6 +68,9 @@ export const Index: React.FC = () => {
height={1080}
fps={60}
durationInFrames={300}
+ defaultProps={{
+ transparent: true,
+ }}
/>
<Composition
id="shadow-circles"