@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.
- package/dist/extract-frame-from-video.d.ts +0 -1
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +34 -0
- package/dist/index.d.ts +8 -6
- package/dist/last-frame-from-video-cache.d.ts +0 -1
- package/dist/prores-profile.d.ts +4 -1
- package/dist/prores-profile.js +6 -6
- package/dist/render-media.d.ts +0 -1
- package/dist/render-media.js +5 -0
- package/dist/stitch-frames-to-video.js +5 -0
- package/package.json +3 -3
- package/dist/assets/dl-browser.d.ts +0 -1
- package/dist/assets/dl-browser.js +0 -38
|
@@ -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" | "
|
|
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: "
|
|
128
|
-
validateOpenGlRenderer: (option: "
|
|
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: (
|
|
140
|
-
|
|
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"];
|
package/dist/prores-profile.d.ts
CHANGED
|
@@ -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: (
|
|
4
|
+
export declare const validateSelectedCodecAndProResCombination: ({ codec, proResProfile, }: {
|
|
5
|
+
codec: Codec;
|
|
6
|
+
proResProfile: ProResProfile | undefined;
|
|
7
|
+
}) => void;
|
|
5
8
|
export {};
|
package/dist/prores-profile.js
CHANGED
|
@@ -9,13 +9,13 @@ const proResProfileOptions = [
|
|
|
9
9
|
'light',
|
|
10
10
|
'proxy',
|
|
11
11
|
];
|
|
12
|
-
const validateSelectedCodecAndProResCombination = (
|
|
13
|
-
if (typeof
|
|
14
|
-
throw new TypeError(
|
|
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 (
|
|
17
|
-
!proResProfileOptions.includes(
|
|
18
|
-
throw new TypeError(`The ProRes profile "${
|
|
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
|
}
|
package/dist/render-media.d.ts
CHANGED
package/dist/render-media.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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": "
|
|
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
|
-
});
|