Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into lambda-testing

Jonny Burger9e78d942c30b
diff --cc packages/docs/blog/2021-08-11-remotion-2-3.md
index 4a429106d3,44330b41ff..1857f2d0b5
--- a/packages/docs/blog/2021-08-11-remotion-2-3.md
+++ b/packages/docs/blog/2021-08-11-remotion-2-3.md
@@@ -89,8 -89,11 +89,11 @@@ if (!composition)
await renderStill({
composition,
- webpackBundle: bundleLocation,
+ serveUrl: bundleLocation,
output: '/tmp/still.png',
+ onError: (error) => {
+ console.error("The following error occured when rendering the still: ", error.message)
+ },
inputProps: {
custom: 'data'
}
diff --cc packages/docs/docs/parametrized-rendering.md
index 2fc882c589,bac4d28623..afac450ce3
--- a/packages/docs/docs/parametrized-rendering.md
+++ b/packages/docs/docs/parametrized-rendering.md
@@@ -99,9 -100,16 +100,16 @@@ import { renderFrames } from "@remotion
await renderFrames({
config: video,
- webpackBundle: bundled,
+ serveUrl: bundled,
onStart: () => undefined,
onFrameUpdate: (f) => undefined,
+ onError: (info) => {
+ if (info.frame === null) {
+ console.error("Got error while initalizing video rendering", info.error);
+ } else {
+ console.error("Got error at frame ", info.frame, info.error);
+ }
+ },
parallelism: null,
outputDir: framesDir,
inputProps: {
diff --cc packages/docs/docs/render-still.md
index 3e55f3a593,949eb216ab..34a281acfd
--- a/packages/docs/docs/render-still.md
+++ b/packages/docs/docs/render-still.md
@@@ -42,12 -39,18 +39,18 @@@ if (!composition)
await renderStill({
composition,
- webpackBundle: bundleLocation,
+ serveUrl: bundleLocation,
- output: '/tmp/still.png',
+ output: "/tmp/still.png",
+ onError: (error) => {
+ console.error(
+ "The following error occured when rendering the still: ",
+ error.message
+ );
+ },
inputProps: {
- custom: 'data'
- }
- })
+ custom: "data",
+ },
+ });
```
## Arguments
diff --cc packages/docs/docs/ssr.md
index 6e10bfe48e,94a74a88cc..999e1b1f90
--- a/packages/docs/docs/ssr.md
+++ b/packages/docs/docs/ssr.md
@@@ -28,11 -28,10 +28,11 @@@ import
const start = async () => {
// The composition you want to render
- const compositionId = 'HelloWorld'
+ const compositionId = "HelloWorld";
// Create a webpack bundle of the entry file.
- const bundleLocation = await bundle(require.resolve("./src/index"));
+ // TODO: This is wrong in Lambda
+ const bundleLocation = await bundle(require.resolve('./src/index'))
// Extract all the compositions you have defined in your project
// from the webpack bundle.
@@@ -55,17 -54,28 +55,28 @@@
// We create a temporary directory for storing the frames
const framesDir = await fs.promises.mkdtemp(
- path.join(os.tmpdir(), 'remotion-')
- )
+ path.join(os.tmpdir(), "remotion-")
+ );
// We create JPEGs for all frames
- const {assetsInfo} = await renderFrames({
+ const { assetsInfo } = await renderFrames({
config: composition,
// Path of the webpack bundle you have created
- webpackBundle: bundleLocation,
+ serveUrl: bundleLocation,
// Get's called after bundling is finished and the
// actual rendering starts.
- onStart: () => console.log('Rendering frames...'),
+ onStart: () => console.log("Rendering frames..."),
+ // Handle errors in your React code
+ onError: (info) => {
+ if (info.frame === null) {
+ console.error(
+ "Got error while initalizing video rendering",
+ info.error
+ );
+ } else {
+ console.error("Got error at frame ", info.frame, info.error);
+ }
+ },
onFrameUpdate: (f) => {
// Log a message whenever 10 frames have rendered.
if (f % 10 === 0) {
@@@ -98,20 -108,19 +109,20 @@@
height: composition.height,
width: composition.width,
// Must match the value above for the image format
- imageFormat: 'jpeg',
+ imageFormat: "jpeg",
// Pass in the desired output path of the video. Et voilà!
- outputLocation: path.join(framesDir, 'out.mp4'),
+ outputLocation: path.join(framesDir, "out.mp4"),
// FFMPEG pixel format
- pixelFormat: 'yuv420p',
+ pixelFormat: "yuv420p",
// Information needed to construct audio correctly.
assetsInfo,
+ webpackBundle: bundleLocation,
// Hook into the FFMPEG progress
- onProgress: (frame) => undefined
- })
- }
+ onProgress: (frame) => undefined,
+ });
+ };
- start()
+ start();
```
:::warning
diff --cc packages/docs/package.json
index 3eab60ce35,6e1ef086b2..53fc579d49
--- a/packages/docs/package.json
+++ b/packages/docs/package.json
@@@ -14,18 -14,17 +14,18 @@@
"test": "eslint src && jest"
},
"dependencies": {
- "@docusaurus/core": "2.0.0-beta.5",
- "@docusaurus/preset-classic": "2.0.0-beta.5",
+ "@docusaurus/core": "2.0.0-beta.7",
+ "@docusaurus/plugin-content-blog": "2.0.0-beta.7",
+ "@docusaurus/preset-classic": "2.0.0-beta.7",
"@mdx-js/react": "^1.6.21",
- "@remotion/babel-loader": "^2.4.2",
- "@remotion/bundler": "^2.4.2",
- "@remotion/gif": "^2.4.2",
- "@remotion/media-utils": "^2.4.2",
- "@remotion/player": "^2.4.2",
- "@remotion/renderer": "^2.4.2",
+ "@remotion/lambda": "^2.4.2",
- "@remotion/three": "^2.4.2",
+ "@remotion/babel-loader": "^2.4.3",
+ "@remotion/bundler": "^2.4.3",
+ "@remotion/gif": "^2.4.3",
+ "@remotion/media-utils": "^2.4.3",
+ "@remotion/player": "^2.4.3",
+ "@remotion/renderer": "^2.4.3",
+ "@remotion/three": "^2.4.3",
"@splitbee/web": "^0.2.4",
"chalk": "^4.1.0",
"clipboard": "^2.0.8",