@remotion/cloudrun 4.0.210 → 4.0.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @remotion/cloudrun@4.0.209 build /Users/jonathanburger/remotion/packages/cloudrun
2
+ > @remotion/cloudrun@4.0.212 build /Users/jonathanburger/remotion/packages/cloudrun
3
3
  > bun build.ts
4
4
 
5
5
  distribution bundled.
@@ -86,6 +86,8 @@ const internalRenderMediaOnCloudrunRaw = async ({ cloudRunUrl, serviceName, regi
86
86
  accumulatedChunks = ''; // Clear the buffer after successful parsing.
87
87
  }
88
88
  catch (e) {
89
+ // eslint-disable-next-line no-console
90
+ console.error('Could not parse progress: ', accumulatedChunks.trim());
89
91
  // If parsing fails, it means we don't have a complete JSON string yet.
90
92
  // We'll wait for more chunks.
91
93
  return;
@@ -25,10 +25,18 @@ const renderMediaSingleThread = async (body, res) => {
25
25
  const composition = await (0, get_composition_from_body_1.getCompositionFromBody)(body);
26
26
  const defaultOutName = `out.${renderer_1.RenderInternals.getFileExtensionFromCodec(body.codec, body.audioCodec)}`;
27
27
  const tempFilePath = `/tmp/${defaultOutName}`;
28
- let previousProgress = 2;
29
- const onProgress = ({ progress }) => {
28
+ let previousProgress = 0.02;
29
+ let writingProgress = Promise.resolve();
30
+ const onProgress = ({ progress, renderedFrames, encodedFrames, }) => {
30
31
  if (previousProgress !== progress) {
31
- res.write(JSON.stringify({ onProgress: progress }) + '\n');
32
+ renderer_1.RenderInternals.Log.info({ indent: false, logLevel: body.logLevel }, 'Render progress:', renderedFrames, 'frames rendered', encodedFrames, 'frames encoded', Math.round(progress * 100), '%');
33
+ writingProgress = writingProgress.then(() => {
34
+ return new Promise((resolve) => {
35
+ res.write(JSON.stringify({ onProgress: progress }) + '\n', () => {
36
+ resolve();
37
+ });
38
+ });
39
+ });
32
40
  previousProgress = progress;
33
41
  }
34
42
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/cloudrun"
4
4
  },
5
5
  "name": "@remotion/cloudrun",
6
- "version": "4.0.210",
6
+ "version": "4.0.212",
7
7
  "description": "Render Remotion videos on Google Cloud Run",
8
8
  "main": "dist/index.js",
9
9
  "sideEffects": false,
@@ -16,14 +16,14 @@
16
16
  "@google-cloud/logging": "^11.1.0",
17
17
  "google-auth-library": "^8.7.0",
18
18
  "zod": "3.22.3",
19
- "@remotion/bundler": "4.0.210",
20
- "@remotion/renderer": "4.0.210",
21
- "@remotion/cli": "4.0.210",
22
- "remotion": "4.0.210"
19
+ "@remotion/bundler": "4.0.212",
20
+ "@remotion/cli": "4.0.212",
21
+ "@remotion/renderer": "4.0.212",
22
+ "remotion": "4.0.212"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/minimist": "1.2.2",
26
- "@remotion/compositor-linux-x64-gnu": "4.0.210"
26
+ "@remotion/compositor-linux-x64-gnu": "4.0.212"
27
27
  },
28
28
  "exports": {
29
29
  "./package.json": "./package.json",