@remotion/renderer 4.0.0-offthread.6 → 4.0.0-offthread.8

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,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { FfmpegExecutable } from 'remotion';
3
4
  import { Readable } from 'stream';
4
5
  export declare function streamToString(stream: Readable): Promise<string>;
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.extractFrameFromVideo = exports.extractFrameFromVideoFn = exports.streamToString = void 0;
7
7
  const execa_1 = __importDefault(require("execa"));
8
+ const remotion_1 = require("remotion");
8
9
  const frame_to_ffmpeg_timestamp_1 = require("./frame-to-ffmpeg-timestamp");
9
10
  const last_frame_from_video_cache_1 = require("./last-frame-from-video-cache");
10
11
  const p_limit_1 = require("./p-limit");
@@ -64,7 +65,11 @@ const getLastFrameOfVideoUnlimited = async ({ ffmpegExecutable, offset, src, })
64
65
  const [stdErr, stdoutBuffer] = await Promise.all([stdErrString, stdoutChunk]);
65
66
  const isEmpty = stdErr.includes('Output file is empty');
66
67
  if (isEmpty) {
67
- return getLastFrameOfVideo({ ffmpegExecutable, offset: offset + 10, src });
68
+ return getLastFrameOfVideoUnlimited({
69
+ ffmpegExecutable,
70
+ offset: offset + 10,
71
+ src,
72
+ });
68
73
  }
69
74
  return stdoutBuffer;
70
75
  };
@@ -136,7 +141,10 @@ const extractFrameFromVideoFn = async ({ time, src, ffmpegExecutable, }) => {
136
141
  return stdOut;
137
142
  };
138
143
  exports.extractFrameFromVideoFn = extractFrameFromVideoFn;
139
- const extractFrameFromVideo = (options) => {
140
- return mainLimit(exports.extractFrameFromVideoFn, options);
144
+ const extractFrameFromVideo = async (options) => {
145
+ const perf = remotion_1.Internals.perf.startPerfMeasure('extract-frame');
146
+ const res = await mainLimit(exports.extractFrameFromVideoFn, options);
147
+ remotion_1.Internals.perf.stopPerfMeasure(perf);
148
+ return res;
141
149
  };
142
150
  exports.extractFrameFromVideo = extractFrameFromVideo;
@@ -1,3 +1,4 @@
1
+ /// <reference types="node" />
1
2
  import { FfmpegExecutable } from 'remotion';
2
3
  export declare type LastFrameOptions = {
3
4
  ffmpegExecutable: FfmpegExecutable;
@@ -135,6 +135,7 @@ const innerRenderFrames = ({ onFrameUpdate, outputDir, onStart, inputProps, qual
135
135
  await (0, seek_to_frame_1.seekToFrame)({ frame, page: freePage });
136
136
  if (imageFormat !== 'none') {
137
137
  if (onFrameBuffer) {
138
+ const id = remotion_1.Internals.perf.startPerfMeasure('save');
138
139
  const buffer = await (0, provide_screenshot_1.provideScreenshot)({
139
140
  page: freePage,
140
141
  imageFormat,
@@ -144,6 +145,7 @@ const innerRenderFrames = ({ onFrameUpdate, outputDir, onStart, inputProps, qual
144
145
  output: undefined,
145
146
  },
146
147
  });
148
+ remotion_1.Internals.perf.stopPerfMeasure(id);
147
149
  onFrameBuffer(buffer, frame);
148
150
  }
149
151
  else {
@@ -137,7 +137,9 @@ const renderMedia = ({ parallelism, proResProfile, crf, composition, imageFormat
137
137
  if (cancelled) {
138
138
  return;
139
139
  }
140
+ const id = remotion_1.Internals.perf.startPerfMeasure('piping');
140
141
  (_a = stitcherFfmpeg === null || stitcherFfmpeg === void 0 ? void 0 : stitcherFfmpeg.stdin) === null || _a === void 0 ? void 0 : _a.write(buffer);
142
+ remotion_1.Internals.perf.stopPerfMeasure(id);
141
143
  setFrameToStitch(frame + 1);
142
144
  }
143
145
  : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.0-offthread.6+d689e66f2",
3
+ "version": "4.0.0-offthread.8+cc05bc8a0",
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": "4.0.0-offthread.6+d689e66f2",
25
+ "remotion": "4.0.0-offthread.8+cc05bc8a0",
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": "d689e66f2c7b5096008b60c68254f3d953602651"
62
+ "gitHead": "cc05bc8a03feb46a3a100ab5b4069c8e16f404b4"
63
63
  }