@remotion/renderer 3.2.30 → 3.2.31

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,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';
@@ -0,0 +1,2 @@
1
+ export declare const findClosestPackageJson: () => string | null;
2
+ export declare const findRemotionRoot: () => string;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.findRemotionRoot = exports.findClosestPackageJson = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const recursionLimit = 5;
10
+ const findClosestPackageJson = () => {
11
+ let currentDir = process.cwd();
12
+ let possiblePackageJson = '';
13
+ for (let i = 0; i < recursionLimit; i++) {
14
+ possiblePackageJson = path_1.default.join(currentDir, 'package.json');
15
+ const exists = fs_1.default.existsSync(possiblePackageJson);
16
+ if (exists) {
17
+ return possiblePackageJson;
18
+ }
19
+ currentDir = path_1.default.dirname(currentDir);
20
+ }
21
+ return null;
22
+ };
23
+ exports.findClosestPackageJson = findClosestPackageJson;
24
+ const findRemotionRoot = () => {
25
+ const closestPackageJson = (0, exports.findClosestPackageJson)();
26
+ if (closestPackageJson === null) {
27
+ console.error('Could not find a package.json in the current directory or any of the ' +
28
+ recursionLimit +
29
+ ' parent directories. Is this a Remotion project?');
30
+ process.exit(1);
31
+ }
32
+ return path_1.default.dirname(closestPackageJson);
33
+ };
34
+ exports.findRemotionRoot = findRemotionRoot;
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';
@@ -69,7 +68,7 @@ export declare const RenderInternals: {
69
68
  task: Promise<Buffer | null>;
70
69
  getLogs: () => string;
71
70
  }>;
72
- getFileExtensionFromCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif", type: "chunk" | "final") => "mp3" | "aac" | "wav" | "gif" | "webm" | "mp4" | "mov" | "mkv";
71
+ getFileExtensionFromCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif", type: "chunk" | "final") => "mp3" | "aac" | "wav" | "gif" | "mp4" | "mkv" | "mov" | "webm";
73
72
  tmpDir: (str: string) => string;
74
73
  deleteDirectory: (directory: string) => Promise<void>;
75
74
  isServeUrl: (potentialUrl: string) => boolean;
@@ -124,8 +123,8 @@ export declare const RenderInternals: {
124
123
  validPixelFormats: readonly ["yuv420p", "yuva420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le", "yuv444p10le", "yuva444p10le"];
125
124
  DEFAULT_BROWSER: import("./browser").Browser;
126
125
  validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
127
- DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | null;
128
- validateOpenGlRenderer: (option: "angle" | "swangle" | "egl" | "swiftshader" | null) => "angle" | "swangle" | "egl" | "swiftshader" | null;
126
+ DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | null;
127
+ validateOpenGlRenderer: (option: "swangle" | "angle" | "egl" | "swiftshader" | null) => "swangle" | "angle" | "egl" | "swiftshader" | null;
129
128
  getDefaultCrfForCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => number;
130
129
  validateSelectedCrfAndCodecCombination: (crf: unknown, codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => void;
131
130
  validImageFormats: readonly ["png", "jpeg", "none"];
@@ -136,8 +135,11 @@ export declare const RenderInternals: {
136
135
  DEFAULT_TIMEOUT: number;
137
136
  getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
138
137
  validateSelectedPixelFormatAndCodecCombination: (pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le", codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => void;
139
- validateSelectedCodecAndProResCombination: (actualCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif", actualProResProfile: "proxy" | "4444-xq" | "4444" | "hq" | "standard" | "light" | undefined) => void;
140
- validateSelectedPixelFormatAndImageFormatCombination: (pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le", imageFormat: "jpeg" | "png" | "none") => "none" | "valid";
138
+ validateSelectedCodecAndProResCombination: ({ codec, proResProfile, }: {
139
+ codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
140
+ proResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined;
141
+ }) => void;
142
+ validateSelectedPixelFormatAndImageFormatCombination: (pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le", imageFormat: "png" | "jpeg" | "none") => "none" | "valid";
141
143
  DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
142
144
  isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
143
145
  logLevels: readonly ["verbose", "info", "warn", "error"];
@@ -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,8 @@
1
1
  import type { Codec } from './codec';
2
2
  declare const proResProfileOptions: readonly ["4444-xq", "4444", "hq", "standard", "light", "proxy"];
3
3
  export declare type ProResProfile = typeof proResProfileOptions[number];
4
- export declare const validateSelectedCodecAndProResCombination: (actualCodec: Codec, actualProResProfile: ProResProfile | undefined) => void;
4
+ export declare const validateSelectedCodecAndProResCombination: ({ codec, proResProfile, }: {
5
+ codec: Codec;
6
+ proResProfile: ProResProfile | undefined;
7
+ }) => void;
5
8
  export {};
@@ -9,13 +9,13 @@ const proResProfileOptions = [
9
9
  'light',
10
10
  'proxy',
11
11
  ];
12
- const validateSelectedCodecAndProResCombination = (actualCodec, actualProResProfile) => {
13
- if (typeof actualProResProfile !== 'undefined' && actualCodec !== 'prores') {
14
- throw new TypeError('You have set a ProRes profile but the codec is not "prores". Set the codec to "prores" or remove the ProRes profile.');
12
+ const validateSelectedCodecAndProResCombination = ({ codec, proResProfile, }) => {
13
+ if (typeof proResProfile !== 'undefined' && codec !== 'prores') {
14
+ throw new TypeError(`You have set a ProRes profile but the codec is "${codec}". Set the codec to "prores" or remove the ProRes profile.`);
15
15
  }
16
- if (actualProResProfile !== undefined &&
17
- !proResProfileOptions.includes(actualProResProfile)) {
18
- throw new TypeError(`The ProRes profile "${actualProResProfile}" is not valid. Valid options are ${proResProfileOptions
16
+ if (proResProfile !== undefined &&
17
+ !proResProfileOptions.includes(proResProfile)) {
18
+ throw new TypeError(`The ProRes profile "${proResProfile}" is not valid. Valid options are ${proResProfileOptions
19
19
  .map((p) => `"${p}"`)
20
20
  .join(', ')}`);
21
21
  }
@@ -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';
@@ -26,6 +26,7 @@ const overwrite_1 = require("./overwrite");
26
26
  const perf_1 = require("./perf");
27
27
  const prespawn_ffmpeg_1 = require("./prespawn-ffmpeg");
28
28
  const prestitcher_memory_usage_1 = require("./prestitcher-memory-usage");
29
+ const prores_profile_1 = require("./prores-profile");
29
30
  const quality_1 = require("./quality");
30
31
  const render_frames_1 = require("./render-frames");
31
32
  const stitch_frames_to_video_1 = require("./stitch-frames-to-video");
@@ -54,6 +55,10 @@ const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprob
54
55
  if (typeof crf !== 'undefined' && crf !== null) {
55
56
  (0, crf_1.validateSelectedCrfAndCodecCombination)(crf, codec);
56
57
  }
58
+ (0, prores_profile_1.validateSelectedCodecAndProResCombination)({
59
+ codec,
60
+ proResProfile,
61
+ });
57
62
  if (outputLocation) {
58
63
  (0, validate_output_filename_1.validateOutputFilename)(codec, (0, get_extension_of_filename_1.getExtensionOfFilename)(outputLocation));
59
64
  }
@@ -25,6 +25,7 @@ const merge_audio_track_1 = require("./merge-audio-track");
25
25
  const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
26
26
  const pixel_format_1 = require("./pixel-format");
27
27
  const preprocess_audio_track_1 = require("./preprocess-audio-track");
28
+ const prores_profile_1 = require("./prores-profile");
28
29
  const truthy_1 = require("./truthy");
29
30
  const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
30
31
  const validate_ffmpeg_1 = require("./validate-ffmpeg");
@@ -88,6 +89,10 @@ const spawnFfmpeg = async (options) => {
88
89
  codec,
89
90
  scale: 1,
90
91
  });
92
+ (0, prores_profile_1.validateSelectedCodecAndProResCombination)({
93
+ codec,
94
+ proResProfile: options.proResProfile,
95
+ });
91
96
  remotion_1.Internals.validateFps(options.fps, 'in `stitchFramesToVideo()`', false);
92
97
  const crf = (_b = options.crf) !== null && _b !== void 0 ? _b : (0, crf_1.getDefaultCrfForCodec)(codec);
93
98
  const pixelFormat = (_c = options.pixelFormat) !== null && _c !== void 0 ? _c : pixel_format_1.DEFAULT_PIXEL_FORMAT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "3.2.30",
3
+ "version": "3.2.31",
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
  "extract-zip": "2.0.1",
25
- "remotion": "3.2.30",
25
+ "remotion": "3.2.31",
26
26
  "source-map": "^0.8.0-beta.0",
27
27
  "ws": "8.7.0"
28
28
  },
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "5dc5f4c010c47186c7911b575998296d6a65f7cb"
60
+ "gitHead": "f011b454d78903e548c32f548d8fef642c5ff7a6"
61
61
  }
@@ -1 +0,0 @@
1
- export declare const downloadBrowser: (url: string) => Promise<void>;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.downloadBrowser = void 0;
4
- const listeners = {};
5
- const isDownloading = {};
6
- const waitForFfmpegToBeDownloaded = (url) => {
7
- return new Promise((resolve) => {
8
- if (!listeners[url]) {
9
- listeners[url] = [];
10
- }
11
- listeners[url].push(resolve);
12
- });
13
- };
14
- const downloadBrowser = async (url) => {
15
- if (isDownloading[url]) {
16
- console.log('WAITING');
17
- return waitForFfmpegToBeDownloaded(url);
18
- }
19
- isDownloading[url] = true;
20
- await new Promise((resolve) => {
21
- console.log('DOWNLOADING BROWSER');
22
- setTimeout(resolve, 20000);
23
- });
24
- isDownloading[url] = false;
25
- if (!listeners[url]) {
26
- listeners[url] = [];
27
- }
28
- listeners[url].forEach((listener) => listener());
29
- listeners[url] = [];
30
- };
31
- exports.downloadBrowser = downloadBrowser;
32
- (0, exports.downloadBrowser)('https://remotion.dev').then(() => {
33
- (0, exports.downloadBrowser)('https://remotion.dev').then(() => {
34
- (0, exports.downloadBrowser)('https://remotion.dev').then(() => console.log('FINISHED DOWNLOADING'));
35
- (0, exports.downloadBrowser)('https://remotion.dev').then(() => console.log('FINISHED DOWNLOADING'));
36
- (0, exports.downloadBrowser)('https://remotion.dev').then(() => console.log('FINISHED DOWNLOADING'));
37
- });
38
- });