@remotion/renderer 3.0.12 → 3.0.14

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.
@@ -168,6 +168,23 @@ const renderMedia = async ({ parallelism, proResProfile, crf, composition, image
168
168
  encodedDoneIn = Date.now() - stitchStart;
169
169
  callUpdate();
170
170
  }
171
+ catch (err) {
172
+ /**
173
+ * When an error is thrown in renderFrames(...) (e.g., when delayRender() is used incorrectly), fs.unlinkSync(...) throws an error that the file is locked because ffmpeg is still running, and renderMedia returns it.
174
+ * Therefore we first kill the FFMPEG process before deleting the file
175
+ */
176
+ if (stitcherFfmpeg !== undefined && stitcherFfmpeg.exitCode === null) {
177
+ const promise = new Promise((resolve) => {
178
+ setTimeout(() => {
179
+ resolve();
180
+ }, 2000);
181
+ stitcherFfmpeg.on('close', resolve);
182
+ });
183
+ stitcherFfmpeg.kill();
184
+ await promise;
185
+ }
186
+ throw err;
187
+ }
171
188
  finally {
172
189
  if (preEncodedFileLocation !== null &&
173
190
  fs_1.default.existsSync(preEncodedFileLocation)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "3.0.12",
3
+ "version": "3.0.14",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "execa": "5.1.1",
24
24
  "puppeteer-core": "13.5.1",
25
- "remotion": "3.0.12",
25
+ "remotion": "3.0.14",
26
26
  "serve-handler": "6.1.3",
27
27
  "source-map": "^0.8.0-beta.0"
28
28
  },
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "6347da2f66936e2c21300cc53dd8f536d0a4ee36"
62
+ "gitHead": "475caaea420199fcaf3c95c0da908e9208dc0e61"
63
63
  }