tommy24 commited on
Commit
20229ac
·
verified ·
1 Parent(s): 4f0e4df

Update remotion/render.mjs

Browse files
Files changed (1) hide show
  1. remotion/render.mjs +10 -15
remotion/render.mjs CHANGED
@@ -1,12 +1,10 @@
1
  import { bundle } from '@remotion/bundler';
2
  import { renderMedia, selectComposition } from '@remotion/renderer';
3
  import { createRequire } from 'node:module';
4
-
5
  const require = createRequire(import.meta.url);
6
 
7
  const bundled = await bundle({
8
- entryPoint: require.resolve('./src/index.tsx'), // your main TSX
9
- webpackOverride: (config) => config,
10
  });
11
 
12
  const inputProps = {
@@ -15,17 +13,8 @@ const inputProps = {
15
  targetAudience: "General",
16
  summary: "Sample render",
17
  scenes: [
18
- {
19
- title: "Hello World",
20
- duration: 3,
21
- voiceover: "Welcome to Remotion!",
22
- codeSnippet: "DemoComponent",
23
- },
24
- {
25
- title: "Second Scene",
26
- duration: 2,
27
- voiceover: "This is scene two."
28
- }
29
  ],
30
  config: {
31
  visualTheme: "STOMP",
@@ -36,10 +25,15 @@ const inputProps = {
36
  }
37
  };
38
 
 
 
39
  const composition = await selectComposition({
40
  serveUrl: bundled,
41
- id: 'VideoComposition', // must match your index.tsx Composition id
42
  inputProps,
 
 
 
43
  });
44
 
45
  console.log('Starting render...');
@@ -51,6 +45,7 @@ await renderMedia({
51
  outputLocation: `out/${composition.id}.mp4`,
52
  chromiumOptions: {
53
  enableMultiProcessOnLinux: true,
 
54
  },
55
  inputProps,
56
  });
 
1
  import { bundle } from '@remotion/bundler';
2
  import { renderMedia, selectComposition } from '@remotion/renderer';
3
  import { createRequire } from 'node:module';
 
4
  const require = createRequire(import.meta.url);
5
 
6
  const bundled = await bundle({
7
+ entryPoint: require.resolve('./src/index.tsx'),
 
8
  });
9
 
10
  const inputProps = {
 
13
  targetAudience: "General",
14
  summary: "Sample render",
15
  scenes: [
16
+ { title: "Scene 1", duration: 2 },
17
+ { title: "Scene 2", duration: 3 },
 
 
 
 
 
 
 
 
 
18
  ],
19
  config: {
20
  visualTheme: "STOMP",
 
25
  }
26
  };
27
 
28
+ console.log('=== VIDEO SCRIPT PASSED TO COMPOSITION ===', inputProps);
29
+
30
  const composition = await selectComposition({
31
  serveUrl: bundled,
32
+ id: 'VideoComposition', // MUST MATCH index.tsx
33
  inputProps,
34
+ onBrowserDownload: (progress) => {
35
+ console.log(`Chrome download progress: ${progress.percent.toFixed(2)}%`);
36
+ },
37
  });
38
 
39
  console.log('Starting render...');
 
45
  outputLocation: `out/${composition.id}.mp4`,
46
  chromiumOptions: {
47
  enableMultiProcessOnLinux: true,
48
+ args: ['--no-sandbox', '--disable-setuid-sandbox'],
49
  },
50
  inputProps,
51
  });