@remotion/renderer 3.3.53 → 3.3.55

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.
@@ -5,6 +5,14 @@ declare type Result = {
5
5
  result: 'found-in-path' | 'found-in-node-modules' | 'installed';
6
6
  wasAlreadyInstalled: boolean;
7
7
  };
8
+ /**
9
+ * @description Checks if the ffmpeg binary is installed and if it is not, downloads it and puts it into your node_modules folder.
10
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffmpeg)
11
+ */
8
12
  export declare const ensureFfmpeg: (options?: EnsureFfmpegOptions) => Promise<Result>;
13
+ /**
14
+ * @description Checks if the ffprobe binary is installed and if it is not, downloads it and puts it into your node_modules folder.
15
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffprobe)
16
+ */
9
17
  export declare const ensureFfprobe: (options?: EnsureFfmpegOptions) => Promise<Result>;
10
18
  export {};
@@ -40,10 +40,18 @@ const ensureFfmpegOrFfprobe = async (binary, options) => {
40
40
  }
41
41
  throw new Error(`${binary} could not be installed automatically. Your architecture and OS combination (os = ${os_1.default.platform()}, arch = ${process.arch}) is not supported. Please install ${binary} manually and add "${binary}" to your PATH.`);
42
42
  };
43
+ /**
44
+ * @description Checks if the ffmpeg binary is installed and if it is not, downloads it and puts it into your node_modules folder.
45
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffmpeg)
46
+ */
43
47
  const ensureFfmpeg = (options) => {
44
48
  return ensureFfmpegOrFfprobe('ffmpeg', options);
45
49
  };
46
50
  exports.ensureFfmpeg = ensureFfmpeg;
51
+ /**
52
+ * @description Checks if the ffprobe binary is installed and if it is not, downloads it and puts it into your node_modules folder.
53
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/ensure-ffprobe)
54
+ */
47
55
  const ensureFfprobe = (options) => {
48
56
  return ensureFfmpegOrFfprobe('ffprobe', options);
49
57
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { OffthreadVideoImageFormat } from 'remotion';
3
2
  import type { DownloadMap } from './assets/download-map';
4
3
  import type { FfmpegExecutable } from './ffmpeg-executable';
@@ -1,5 +1,9 @@
1
1
  import type { FfmpegExecutable } from './ffmpeg-executable';
2
2
  export declare const ACCEPTABLE_OFFSET_THRESHOLD = 50;
3
+ /**
4
+ * @description Probes whether frames of a video can be efficiently extracted when using <OffthreadVideo>.
5
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/get-can-extract-frames-fast)
6
+ */
3
7
  export declare const getCanExtractFramesFast: ({ src, ffmpegExecutable, ffprobeExecutable, }: {
4
8
  src: string;
5
9
  ffmpegExecutable?: FfmpegExecutable | undefined;
@@ -11,6 +11,10 @@ const find_closest_package_json_1 = require("./find-closest-package-json");
11
11
  const get_video_info_1 = require("./get-video-info");
12
12
  const try_to_extract_frame_of_video_fast_1 = require("./try-to-extract-frame-of-video-fast");
13
13
  exports.ACCEPTABLE_OFFSET_THRESHOLD = 50;
14
+ /**
15
+ * @description Probes whether frames of a video can be efficiently extracted when using <OffthreadVideo>.
16
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/get-can-extract-frames-fast)
17
+ */
14
18
  const getCanExtractFramesFast = async ({ src, ffmpegExecutable, ffprobeExecutable, }) => {
15
19
  const remotionRoot = (0, find_closest_package_json_1.findRemotionRoot)();
16
20
  const out = await (0, ensure_presentation_timestamp_1.ensurePresentationTimestampWithoutCache)({
@@ -21,5 +21,9 @@ declare type GetCompositionsConfig = {
21
21
  */
22
22
  downloadMap?: DownloadMap;
23
23
  };
24
+ /**
25
+ * @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
26
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
27
+ */
24
28
  export declare const getCompositions: (serveUrlOrWebpackUrl: string, config?: GetCompositionsConfig) => Promise<TCompMetadata[]>;
25
29
  export {};
@@ -56,6 +56,10 @@ const innerGetCompositions = async (serveUrl, page, config, proxyPort) => {
56
56
  });
57
57
  return result;
58
58
  };
59
+ /**
60
+ * @description Gets the compositions defined in a Remotion project based on a Webpack bundle.
61
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/get-compositions)
62
+ */
59
63
  const getCompositions = async (serveUrlOrWebpackUrl, config) => {
60
64
  var _a, _b, _c, _d, _e;
61
65
  await (0, validate_ffmpeg_1.validateFfmpeg)((_a = config === null || config === void 0 ? void 0 : config.ffmpegExecutable) !== null && _a !== void 0 ? _a : null, (0, find_closest_package_json_1.findRemotionRoot)(), 'ffmpeg');
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { OffthreadVideoImageFormat } from 'remotion';
3
2
  import type { SpecialVCodecForTransparency } from './assets/download-map';
4
3
  import type { FfmpegExecutable } from './ffmpeg-executable';
@@ -8,7 +7,10 @@ export declare const getFrameOfVideoSlow: ({ src, duration, ffmpegExecutable, im
8
7
  duration: number;
9
8
  imageFormat: OffthreadVideoImageFormat;
10
9
  specialVCodecForTransparency: SpecialVCodecForTransparency;
11
- needsResize: [number, number] | null;
10
+ needsResize: [
11
+ number,
12
+ number
13
+ ] | null;
12
14
  offset: number;
13
15
  fps: number | null;
14
16
  remotionRoot: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import execa from 'execa';
3
2
  import { SymbolicateableError } from './error-handling/symbolicateable-error';
4
3
  import { mimeContentType, mimeLookup } from './mime-types';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { OffthreadVideoImageFormat } from 'remotion';
3
2
  import type { DownloadMap, SpecialVCodecForTransparency } from './assets/download-map';
4
3
  import type { FfmpegExecutable } from './ffmpeg-executable';
@@ -1,5 +1,9 @@
1
1
  declare type Callback = () => void;
2
2
  export declare type CancelSignal = (callback: Callback) => void;
3
+ /**
4
+ * @description Returns a signal and a cancel function that allows to you cancel a render triggered using renderMedia(), renderStill(), renderFrames() or stitchFramesToVideo().
5
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/make-cancel-signal)
6
+ */
3
7
  export declare const makeCancelSignal: () => {
4
8
  cancelSignal: CancelSignal;
5
9
  cancel: () => void;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isUserCancelledRender = exports.cancelErrorMessages = exports.makeCancelSignal = void 0;
4
+ /**
5
+ * @description Returns a signal and a cancel function that allows to you cancel a render triggered using renderMedia(), renderStill(), renderFrames() or stitchFramesToVideo().
6
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/make-cancel-signal)
7
+ */
4
8
  const makeCancelSignal = () => {
5
9
  const callbacks = [];
6
10
  let cancelled = false;
@@ -10,6 +10,10 @@ export declare type ChromiumOptions = {
10
10
  headless?: boolean;
11
11
  };
12
12
  export declare const killAllBrowsers: () => Promise<void>;
13
+ /**
14
+ * @description Opens a Chrome or Chromium browser instance.
15
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/open-browser)
16
+ */
13
17
  export declare const openBrowser: (browser: Browser, options?: {
14
18
  shouldDumpIo?: boolean;
15
19
  browserExecutable?: string | null;
@@ -27,6 +27,10 @@ const killAllBrowsers = async () => {
27
27
  }
28
28
  };
29
29
  exports.killAllBrowsers = killAllBrowsers;
30
+ /**
31
+ * @description Opens a Chrome or Chromium browser instance.
32
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/open-browser)
33
+ */
30
34
  const openBrowser = async (browser, options) => {
31
35
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
32
36
  if (browser === 'firefox') {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ClipRegion } from 'remotion';
3
2
  import type { Page } from './browser/BrowserPage';
4
3
  import type { ImageFormat } from './image-format';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ClipRegion } from 'remotion';
3
2
  import type { Page } from './browser/BrowserPage';
4
3
  export declare const screenshot: (options: {
@@ -57,5 +57,9 @@ declare type RenderFramesOptions = {
57
57
  downloadMap?: DownloadMap;
58
58
  muted?: boolean;
59
59
  } & ConfigOrComposition & ConcurrencyOrParallelism & ServeUrlOrWebpackBundle;
60
+ /**
61
+ * @description Renders a series of images using Puppeteer and computes information for mixing audio.
62
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/render-frames)
63
+ */
60
64
  export declare const renderFrames: (options: RenderFramesOptions) => Promise<RenderFramesOutput>;
61
65
  export {};
@@ -286,6 +286,10 @@ const innerRenderFrames = ({ onFrameUpdate, outputDir, onStart, inputProps, qual
286
286
  })
287
287
  .then(() => happyPath);
288
288
  };
289
+ /**
290
+ * @description Renders a series of images using Puppeteer and computes information for mixing audio.
291
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/render-frames)
292
+ */
289
293
  const renderFrames = (options) => {
290
294
  var _a, _b, _c;
291
295
  const composition = getComposition(options);
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { SmallTCompMetadata } from 'remotion';
3
2
  import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
4
3
  import type { DownloadMap } from './assets/download-map';
@@ -88,7 +87,7 @@ declare type ConcurrencyOrParallelism = {
88
87
  /**
89
88
  *
90
89
  * @description Render a video from a composition
91
- * @link https://www.remotion.dev/docs/renderer/render-media
90
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
92
91
  */
93
92
  export declare const renderMedia: ({ proResProfile, crf, composition, ffmpegExecutable, ffprobeExecutable, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, onSlowestFrames, audioCodec, ...options }: RenderMediaOptions) => Promise<Buffer | null>;
94
93
  export {};
@@ -53,7 +53,7 @@ const getConcurrency = (others) => {
53
53
  /**
54
54
  *
55
55
  * @description Render a video from a composition
56
- * @link https://www.remotion.dev/docs/renderer/render-media
56
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/render-media)
57
57
  */
58
58
  const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprobeExecutable, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, audioBitrate, videoBitrate, onSlowestFrames, audioCodec, ...options }) => {
59
59
  var _a, _b, _c, _d, _e;
@@ -42,7 +42,7 @@ export declare type RenderStillOptions = InnerStillOptions & ServeUrlOrWebpackBu
42
42
  /**
43
43
  *
44
44
  * @description Render a still frame from a composition
45
- * @link https://www.remotion.dev/docs/renderer/render-still
45
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/render-still)
46
46
  */
47
47
  export declare const renderStill: (options: RenderStillOptions) => Promise<RenderStillReturnValue>;
48
48
  export {};
@@ -169,7 +169,7 @@ const innerRenderStill = async ({ composition, quality, imageFormat = 'png', ser
169
169
  /**
170
170
  *
171
171
  * @description Render a still frame from a composition
172
- * @link https://www.remotion.dev/docs/renderer/render-still
172
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/render-still)
173
173
  */
174
174
  const renderStill = (options) => {
175
175
  var _a, _b;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ClipRegion } from 'remotion';
3
2
  import type { Page } from './browser/BrowserPage';
4
3
  import type { ImageFormat } from './image-format';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { ClipRegion } from 'remotion';
3
2
  import type { Page } from './browser/BrowserPage';
4
3
  import type { StillImageFormat } from './image-format';
@@ -45,5 +45,9 @@ declare type ReturnType = {
45
45
  getLogs: () => string;
46
46
  };
47
47
  export declare const spawnFfmpeg: (options: StitcherOptions, remotionRoot: string) => Promise<ReturnType>;
48
+ /**
49
+ * @description Takes a series of images and audio information generated by renderFrames() and encodes it to a video.
50
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/stitch-frames-to-video)
51
+ */
48
52
  export declare const stitchFramesToVideo: (options: StitcherOptions) => Promise<Buffer | null>;
49
53
  export {};
@@ -341,6 +341,10 @@ const spawnFfmpeg = async (options, remotionRoot) => {
341
341
  };
342
342
  };
343
343
  exports.spawnFfmpeg = spawnFfmpeg;
344
+ /**
345
+ * @description Takes a series of images and audio information generated by renderFrames() and encodes it to a video.
346
+ * @see [Documentation](https://www.remotion.dev/docs/renderer/stitch-frames-to-video)
347
+ */
344
348
  const stitchFramesToVideo = async (options) => {
345
349
  const remotionRoot = (0, find_closest_package_json_1.findRemotionRoot)();
346
350
  const { task, getLogs } = await (0, exports.spawnFfmpeg)(options, remotionRoot);
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { TAsset } from 'remotion';
3
2
  import type { DownloadMap } from './assets/download-map';
4
3
  import type { Page } from './browser/BrowserPage';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { OffthreadVideoImageFormat } from 'remotion';
3
2
  import type { NeedsResize, SpecialVCodecForTransparency } from './assets/download-map';
4
3
  import type { FfmpegExecutable } from './ffmpeg-executable';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "3.3.53",
3
+ "version": "3.3.55",
4
4
  "description": "Renderer for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "execa": "5.1.1",
26
26
  "extract-zip": "2.0.1",
27
- "remotion": "3.3.53",
27
+ "remotion": "3.3.55",
28
28
  "source-map": "^0.8.0-beta.0",
29
29
  "ws": "8.7.0"
30
30
  },
@@ -49,13 +49,13 @@
49
49
  "vitest": "0.24.3"
50
50
  },
51
51
  "optionalDependencies": {
52
- "@remotion/compositor-darwin-arm64": "3.3.53",
53
- "@remotion/compositor-darwin-x64": "3.3.53",
54
- "@remotion/compositor-linux-arm64-gnu": "3.3.53",
55
- "@remotion/compositor-linux-arm64-musl": "3.3.53",
56
- "@remotion/compositor-linux-x64-gnu": "3.3.53",
57
- "@remotion/compositor-linux-x64-musl": "3.3.53",
58
- "@remotion/compositor-win32-x64-msvc": "3.3.53"
52
+ "@remotion/compositor-darwin-arm64": "3.3.55",
53
+ "@remotion/compositor-darwin-x64": "3.3.55",
54
+ "@remotion/compositor-linux-arm64-gnu": "3.3.55",
55
+ "@remotion/compositor-linux-arm64-musl": "3.3.55",
56
+ "@remotion/compositor-linux-x64-gnu": "3.3.55",
57
+ "@remotion/compositor-linux-x64-musl": "3.3.55",
58
+ "@remotion/compositor-win32-x64-msvc": "3.3.55"
59
59
  },
60
60
  "keywords": [
61
61
  "remotion",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "b6d64c3ec91b55ac537765fda0b927c3a472b529"
70
+ "gitHead": "4cecccc293e9c906c693f55fac65df8f1cfd2338"
71
71
  }
@@ -1,2 +0,0 @@
1
- import type { Codec } from './codec';
2
- export declare const getAudioCodecName: (codec: Codec) => string | null;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAudioCodecName = void 0;
4
- const is_audio_codec_1 = require("./is-audio-codec");
5
- const getAudioCodecName = (codec) => {
6
- if (!(0, is_audio_codec_1.isAudioCodec)(codec)) {
7
- // The mkv container supports WAV, but MP4 does only support
8
- // AAC. Choose MKV codec for better quality because we can put in lossless audio
9
- if (codec === 'h264-mkv') {
10
- return 'pcm_s16le';
11
- }
12
- if (codec === 'vp8' || codec === 'vp9') {
13
- return 'libopus';
14
- }
15
- return 'aac';
16
- }
17
- if (codec === 'aac') {
18
- return 'aac';
19
- }
20
- if (codec === 'mp3') {
21
- return 'libmp3lame';
22
- }
23
- if (codec === 'wav') {
24
- return 'pcm_s16le';
25
- }
26
- return null;
27
- };
28
- exports.getAudioCodecName = getAudioCodecName;
@@ -1 +0,0 @@
1
- export declare const validateFrame: (frame: number, durationInFrames: number) => void;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateFrame = void 0;
4
- const validateFrame = (frame, durationInFrames) => {
5
- if (typeof frame === 'undefined') {
6
- throw new TypeError(`Argument missing for parameter "frame"`);
7
- }
8
- if (typeof frame !== 'number') {
9
- throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
10
- }
11
- if (!Number.isFinite(frame)) {
12
- throw new RangeError(`Frame ${frame} is not finite`);
13
- }
14
- if (frame % 1 !== 0) {
15
- throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
16
- }
17
- if (frame < 0 && frame < -durationInFrames) {
18
- throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
19
- }
20
- if (frame > durationInFrames - 1) {
21
- throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
22
- }
23
- };
24
- exports.validateFrame = validateFrame;