Skip to content

🎥 Make videos programmatically with React

fix #139

Jonny Burger17010ba64c9d
diff --git a/packages/renderer/src/render.ts b/packages/renderer/src/render.ts
index c2fd0ef766..97f08e51c2 100644
--- a/packages/renderer/src/render.ts
+++ b/packages/renderer/src/render.ts
@@ -56,7 +56,9 @@ export const renderFrames = async ({
const pool = new Pool(await Promise.all(pages));
const {durationInFrames: frames} = config;
- const filePadLength = String(frames).length;
+ // Substract one because 100 frames will be 00-99
+ // --> 2 digits
+ const filePadLength = String(frames - 1).length;
let framesRendered = 0;
onStart();
await Promise.all(
@@ -73,7 +75,10 @@ export const renderFrames = async ({
quality,
options: {
frame: f,
- output: path.join(outputDir, `element-${paddedIndex}.${imageFormat}`),
+ output: path.join(
+ outputDir,
+ `element-${paddedIndex}.${imageFormat}`
+ ),
},
});
} catch (err) {