@remotion/renderer 3.1.6 → 3.1.7
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/assets/convert-assets-to-file-urls.d.ts +3 -2
- package/dist/assets/convert-assets-to-file-urls.js +2 -2
- package/dist/assets/download-and-map-assets-to-file.d.ts +6 -5
- package/dist/assets/download-and-map-assets-to-file.js +47 -47
- package/dist/assets/download-map.d.ts +57 -0
- package/dist/assets/download-map.js +20 -0
- package/dist/assets/get-audio-channels.d.ts +3 -7
- package/dist/assets/get-audio-channels.js +6 -7
- package/dist/assets/get-files-in-folder.d.ts +9 -0
- package/dist/assets/get-files-in-folder.js +50 -0
- package/dist/assets/get-video-stream-duration.d.ts +3 -6
- package/dist/assets/get-video-stream-duration.js +9 -8
- package/dist/browser/TimeoutSettings.d.ts +1 -0
- package/dist/browser/TimeoutSettings.js +4 -4
- package/dist/browser-executable.d.ts +1 -0
- package/dist/browser-executable.js +2 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +4 -0
- package/dist/can-use-parallel-encoding.d.ts +1 -1
- package/dist/can-use-parallel-encoding.js +2 -2
- package/dist/codec-supports-media.d.ts +1 -1
- package/dist/codec.d.ts +4 -0
- package/dist/codec.js +16 -0
- package/dist/combine-videos.d.ts +1 -1
- package/dist/combine-videos.js +7 -6
- package/dist/compress-assets.d.ts +7 -0
- package/dist/compress-assets.js +25 -0
- package/dist/convert-to-pcm.d.ts +1 -1
- package/dist/create-ffmpeg-merge-filter.js +3 -3
- package/dist/create-silent-audio.d.ts +1 -1
- package/dist/crf.d.ts +5 -0
- package/dist/crf.js +64 -0
- package/dist/ensure-presentation-timestamp.d.ts +2 -1
- package/dist/ensure-presentation-timestamp.js +9 -7
- package/dist/extract-frame-from-video.d.ts +5 -1
- package/dist/extract-frame-from-video.js +21 -16
- package/dist/ffmpeg-executable.d.ts +1 -0
- package/dist/ffmpeg-executable.js +2 -0
- package/dist/frame-range.d.ts +2 -0
- package/dist/frame-range.js +49 -0
- package/dist/get-audio-codec-name.d.ts +1 -1
- package/dist/get-audio-codec-name.js +2 -2
- package/dist/get-browser-instance.d.ts +1 -1
- package/dist/get-browser-instance.js +2 -2
- package/dist/get-codec-name.d.ts +1 -1
- package/dist/get-codec-name.js +2 -2
- package/dist/get-compositions.d.ts +8 -1
- package/dist/get-compositions.js +6 -6
- package/dist/get-extension-from-codec.d.ts +1 -1
- package/dist/get-frame-to-render.d.ts +1 -1
- package/dist/get-local-browser-executable.d.ts +2 -1
- package/dist/get-prores-profile-name.d.ts +2 -1
- package/dist/get-video-info.d.ts +3 -8
- package/dist/get-video-info.js +7 -8
- package/dist/image-format.d.ts +6 -1
- package/dist/image-format.js +25 -1
- package/dist/index.d.ts +44 -5
- package/dist/index.js +70 -1
- package/dist/is-audio-codec.d.ts +2 -0
- package/dist/is-audio-codec.js +7 -0
- package/dist/is-beyond-last-frame.d.ts +3 -2
- package/dist/is-beyond-last-frame.js +5 -5
- package/dist/last-frame-from-video-cache.d.ts +5 -3
- package/dist/last-frame-from-video-cache.js +17 -17
- package/dist/log-level.d.ts +4 -0
- package/dist/log-level.js +15 -0
- package/dist/merge-audio-track.d.ts +1 -1
- package/dist/merge-audio-track.js +2 -2
- package/dist/offthread-video-server.d.ts +5 -3
- package/dist/offthread-video-server.js +3 -2
- package/dist/open-browser.d.ts +1 -1
- package/dist/open-browser.js +4 -4
- package/dist/overwrite.d.ts +1 -0
- package/dist/overwrite.js +4 -0
- package/dist/perf.d.ts +5 -0
- package/dist/perf.js +35 -0
- package/dist/pixel-format.d.ts +5 -0
- package/dist/pixel-format.js +26 -0
- package/dist/prepare-server.d.ts +4 -3
- package/dist/prepare-server.js +3 -3
- package/dist/preprocess-audio-track.d.ts +3 -1
- package/dist/preprocess-audio-track.js +2 -2
- package/dist/prespawn-ffmpeg.d.ts +5 -1
- package/dist/prespawn-ffmpeg.js +9 -6
- package/dist/prores-profile.d.ts +5 -0
- package/dist/prores-profile.js +23 -0
- package/dist/provide-screenshot.d.ts +1 -1
- package/dist/quality.d.ts +1 -0
- package/dist/quality.js +21 -0
- package/dist/render-frames.d.ts +10 -1
- package/dist/render-frames.js +21 -16
- package/dist/render-media.d.ts +14 -2
- package/dist/render-media.js +16 -9
- package/dist/render-still.d.ts +9 -1
- package/dist/render-still.js +14 -10
- package/dist/screenshot-dom-element.d.ts +1 -1
- package/dist/screenshot-task.d.ts +1 -1
- package/dist/screenshot-task.js +7 -7
- package/dist/serve-static.d.ts +3 -2
- package/dist/serve-static.js +3 -4
- package/dist/set-props-and-env.js +2 -2
- package/dist/stitch-frames-to-video.d.ts +6 -1
- package/dist/stitch-frames-to-video.js +16 -11
- package/dist/stringify-ffmpeg-filter.js +2 -2
- package/dist/symbolicate-stacktrace.js +3 -3
- package/dist/truthy.d.ts +3 -0
- package/dist/truthy.js +7 -0
- package/dist/types.d.ts +1 -1
- package/dist/validate-even-dimensions-with-codec.d.ts +1 -1
- package/dist/validate-even-dimensions-with-codec.js +2 -2
- package/dist/validate-every-nth-frame.d.ts +1 -0
- package/dist/validate-every-nth-frame.js +21 -0
- package/dist/validate-ffmpeg.js +2 -3
- package/dist/validate-frame.d.ts +1 -0
- package/dist/validate-frame.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +5 -0
- package/dist/validate-opengl-renderer.js +15 -0
- package/dist/validate-output-filename.d.ts +1 -1
- package/package.json +3 -3
package/dist/screenshot-task.js
CHANGED
|
@@ -5,35 +5,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports._screenshotTask = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const
|
|
8
|
+
const perf_1 = require("./perf");
|
|
9
9
|
const _screenshotTask = async (page, format, options) => {
|
|
10
10
|
const client = page._client();
|
|
11
11
|
const target = page.target();
|
|
12
|
-
const perfTarget =
|
|
12
|
+
const perfTarget = (0, perf_1.startPerfMeasure)('activate-target');
|
|
13
13
|
await client.send('Target.activateTarget', {
|
|
14
14
|
targetId: target._targetId,
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
(0, perf_1.stopPerfMeasure)(perfTarget);
|
|
17
17
|
const shouldSetDefaultBackground = options.omitBackground && format === 'png';
|
|
18
18
|
if (shouldSetDefaultBackground)
|
|
19
19
|
await client.send('Emulation.setDefaultBackgroundColorOverride', {
|
|
20
20
|
color: { r: 0, g: 0, b: 0, a: 0 },
|
|
21
21
|
});
|
|
22
|
-
const cap =
|
|
22
|
+
const cap = (0, perf_1.startPerfMeasure)('capture');
|
|
23
23
|
const result = await client.send('Page.captureScreenshot', {
|
|
24
24
|
format,
|
|
25
25
|
quality: options.quality,
|
|
26
26
|
clip: undefined,
|
|
27
27
|
captureBeyondViewport: true,
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
(0, perf_1.stopPerfMeasure)(cap);
|
|
30
30
|
if (shouldSetDefaultBackground)
|
|
31
31
|
await client.send('Emulation.setDefaultBackgroundColorOverride');
|
|
32
|
-
const saveMarker =
|
|
32
|
+
const saveMarker = (0, perf_1.startPerfMeasure)('save');
|
|
33
33
|
const buffer = Buffer.from(result.data, 'base64');
|
|
34
34
|
if (options.path)
|
|
35
35
|
await fs_1.default.promises.writeFile(options.path, buffer);
|
|
36
|
-
|
|
36
|
+
(0, perf_1.stopPerfMeasure)(saveMarker);
|
|
37
37
|
return buffer;
|
|
38
38
|
};
|
|
39
39
|
exports._screenshotTask = _screenshotTask;
|
package/dist/serve-static.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { FfmpegExecutable } from 'remotion';
|
|
2
1
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
2
|
+
import type { DownloadMap } from './assets/download-map';
|
|
3
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
3
4
|
export declare const serveStatic: (path: string | null, options: {
|
|
4
5
|
port: number | null;
|
|
5
6
|
ffmpegExecutable: FfmpegExecutable;
|
|
6
7
|
ffprobeExecutable: FfmpegExecutable;
|
|
7
|
-
downloadDir: string;
|
|
8
8
|
onDownload: RenderMediaOnDownload;
|
|
9
9
|
onError: (err: Error) => void;
|
|
10
|
+
downloadMap: DownloadMap;
|
|
10
11
|
}) => Promise<{
|
|
11
12
|
port: number;
|
|
12
13
|
close: () => Promise<void>;
|
package/dist/serve-static.js
CHANGED
|
@@ -5,19 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.serveStatic = void 0;
|
|
7
7
|
const http_1 = __importDefault(require("http"));
|
|
8
|
-
const remotion_1 = require("remotion");
|
|
9
8
|
const get_port_1 = require("./get-port");
|
|
10
9
|
const offthread_video_server_1 = require("./offthread-video-server");
|
|
11
10
|
const serve_handler_1 = require("./serve-handler");
|
|
12
11
|
const serveStatic = async (path, options) => {
|
|
13
|
-
var _a
|
|
14
|
-
const port = await (0, get_port_1.getDesiredPort)((
|
|
12
|
+
var _a;
|
|
13
|
+
const port = await (0, get_port_1.getDesiredPort)((_a = options === null || options === void 0 ? void 0 : options.port) !== null && _a !== void 0 ? _a : undefined, 3000, 3100);
|
|
15
14
|
const offthreadRequest = (0, offthread_video_server_1.startOffthreadVideoServer)({
|
|
16
15
|
ffmpegExecutable: options.ffmpegExecutable,
|
|
17
16
|
ffprobeExecutable: options.ffprobeExecutable,
|
|
18
|
-
downloadDir: options.downloadDir,
|
|
19
17
|
onDownload: options.onDownload,
|
|
20
18
|
onError: options.onError,
|
|
19
|
+
downloadMap: options.downloadMap,
|
|
21
20
|
});
|
|
22
21
|
try {
|
|
23
22
|
const server = http_1.default
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setPropsAndEnv = void 0;
|
|
4
|
-
const
|
|
4
|
+
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
5
5
|
const normalize_serve_url_1 = require("./normalize-serve-url");
|
|
6
6
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
7
7
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
8
8
|
const setPropsAndEnv = async ({ inputProps, envVariables, page, serveUrl, initialFrame, timeoutInMilliseconds, proxyPort, retriesRemaining, }) => {
|
|
9
9
|
(0, validate_puppeteer_timeout_1.validatePuppeteerTimeout)(timeoutInMilliseconds);
|
|
10
|
-
const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds :
|
|
10
|
+
const actualTimeout = timeoutInMilliseconds !== null && timeoutInMilliseconds !== void 0 ? timeoutInMilliseconds : TimeoutSettings_1.DEFAULT_TIMEOUT;
|
|
11
11
|
page.setDefaultTimeout(actualTimeout);
|
|
12
12
|
page.setDefaultNavigationTimeout(actualTimeout);
|
|
13
13
|
const urlToVisit = (0, normalize_serve_url_1.normalizeServeUrl)(serveUrl);
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import type { Codec, FfmpegExecutable, ImageFormat, PixelFormat, ProResProfile, RenderAssetInfo } from 'remotion';
|
|
3
2
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
3
|
+
import type { RenderAssetInfo } from './assets/download-map';
|
|
4
|
+
import type { Codec } from './codec';
|
|
5
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
6
|
+
import type { ImageFormat } from './image-format';
|
|
4
7
|
import type { CancelSignal } from './make-cancel-signal';
|
|
8
|
+
import type { PixelFormat } from './pixel-format';
|
|
9
|
+
import type { ProResProfile } from './prores-profile';
|
|
5
10
|
export declare type StitcherOptions = {
|
|
6
11
|
fps: number;
|
|
7
12
|
width: number;
|
|
@@ -35,8 +35,10 @@ const remotion_1 = require("remotion");
|
|
|
35
35
|
const calculate_asset_positions_1 = require("./assets/calculate-asset-positions");
|
|
36
36
|
const convert_assets_to_file_urls_1 = require("./assets/convert-assets-to-file-urls");
|
|
37
37
|
const download_and_map_assets_to_file_1 = require("./assets/download-and-map-assets-to-file");
|
|
38
|
+
const codec_1 = require("./codec");
|
|
38
39
|
const codec_supports_media_1 = require("./codec-supports-media");
|
|
39
40
|
const convert_number_of_gif_loops_to_ffmpeg_1 = require("./convert-number-of-gif-loops-to-ffmpeg");
|
|
41
|
+
const crf_1 = require("./crf");
|
|
40
42
|
const delete_directory_1 = require("./delete-directory");
|
|
41
43
|
const get_audio_codec_name_1 = require("./get-audio-codec-name");
|
|
42
44
|
const get_codec_name_1 = require("./get-codec-name");
|
|
@@ -44,21 +46,23 @@ const get_extension_from_codec_1 = require("./get-extension-from-codec");
|
|
|
44
46
|
const get_prores_profile_name_1 = require("./get-prores-profile-name");
|
|
45
47
|
const merge_audio_track_1 = require("./merge-audio-track");
|
|
46
48
|
const parse_ffmpeg_progress_1 = require("./parse-ffmpeg-progress");
|
|
49
|
+
const pixel_format_1 = require("./pixel-format");
|
|
47
50
|
const preprocess_audio_track_1 = require("./preprocess-audio-track");
|
|
48
51
|
const tmp_dir_1 = require("./tmp-dir");
|
|
52
|
+
const truthy_1 = require("./truthy");
|
|
49
53
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
50
54
|
const validate_ffmpeg_1 = require("./validate-ffmpeg");
|
|
51
55
|
const packageJsonPath = path_1.default.join(__dirname, '..', 'package.json');
|
|
52
56
|
const packageJson = fs_1.default.existsSync(packageJsonPath)
|
|
53
57
|
? JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf-8'))
|
|
54
58
|
: null;
|
|
55
|
-
const getAssetsData = async ({ assets,
|
|
59
|
+
const getAssetsData = async ({ assets, onDownload, fps, expectedFrames, verbose, ffmpegExecutable, ffprobeExecutable, onProgress, downloadMap, }) => {
|
|
56
60
|
const fileUrlAssets = await (0, convert_assets_to_file_urls_1.convertAssetsToFileUrls)({
|
|
57
61
|
assets,
|
|
58
|
-
downloadDir,
|
|
59
62
|
onDownload: onDownload !== null && onDownload !== void 0 ? onDownload : (() => () => undefined),
|
|
63
|
+
downloadMap,
|
|
60
64
|
});
|
|
61
|
-
(0, download_and_map_assets_to_file_1.markAllAssetsAsDownloaded)();
|
|
65
|
+
(0, download_and_map_assets_to_file_1.markAllAssetsAsDownloaded)(downloadMap);
|
|
62
66
|
const assetPositions = (0, calculate_asset_positions_1.calculateAssetPositions)(fileUrlAssets);
|
|
63
67
|
if (verbose) {
|
|
64
68
|
console.log('asset positions', assetPositions);
|
|
@@ -77,11 +81,12 @@ const getAssetsData = async ({ assets, downloadDir, onDownload, fps, expectedFra
|
|
|
77
81
|
asset,
|
|
78
82
|
expectedFrames,
|
|
79
83
|
fps,
|
|
84
|
+
downloadMap,
|
|
80
85
|
});
|
|
81
86
|
preprocessProgress[index] = 1;
|
|
82
87
|
updateProgress();
|
|
83
88
|
return result;
|
|
84
|
-
}))).filter(
|
|
89
|
+
}))).filter(truthy_1.truthy);
|
|
85
90
|
const outName = path_1.default.join((0, tmp_dir_1.tmpDir)('remotion-audio-preprocessing'), `audio.wav`);
|
|
86
91
|
await (0, merge_audio_track_1.mergeAudioTrack)({
|
|
87
92
|
ffmpegExecutable: ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : null,
|
|
@@ -100,16 +105,16 @@ const spawnFfmpeg = async (options) => {
|
|
|
100
105
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
101
106
|
remotion_1.Internals.validateDimension(options.height, 'height', 'passed to `stitchFramesToVideo()`');
|
|
102
107
|
remotion_1.Internals.validateDimension(options.width, 'width', 'passed to `stitchFramesToVideo()`');
|
|
103
|
-
const codec = (_a = options.codec) !== null && _a !== void 0 ? _a :
|
|
108
|
+
const codec = (_a = options.codec) !== null && _a !== void 0 ? _a : codec_1.DEFAULT_CODEC;
|
|
104
109
|
(0, validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec)({
|
|
105
110
|
width: options.width,
|
|
106
111
|
height: options.height,
|
|
107
112
|
codec,
|
|
108
113
|
scale: 1,
|
|
109
114
|
});
|
|
110
|
-
remotion_1.Internals.validateFps(options.fps, 'in `stitchFramesToVideo()`',
|
|
111
|
-
const crf = (_b = options.crf) !== null && _b !== void 0 ? _b :
|
|
112
|
-
const pixelFormat = (_c = options.pixelFormat) !== null && _c !== void 0 ? _c :
|
|
115
|
+
remotion_1.Internals.validateFps(options.fps, 'in `stitchFramesToVideo()`', false);
|
|
116
|
+
const crf = (_b = options.crf) !== null && _b !== void 0 ? _b : (0, crf_1.getDefaultCrfForCodec)(codec);
|
|
117
|
+
const pixelFormat = (_c = options.pixelFormat) !== null && _c !== void 0 ? _c : pixel_format_1.DEFAULT_PIXEL_FORMAT;
|
|
113
118
|
await (0, validate_ffmpeg_1.validateFfmpeg)((_d = options.ffmpegExecutable) !== null && _d !== void 0 ? _d : null);
|
|
114
119
|
const encoderName = (0, get_codec_name_1.getCodecName)(codec);
|
|
115
120
|
const audioCodecName = (0, get_audio_codec_name_1.getAudioCodecName)(codec);
|
|
@@ -131,8 +136,8 @@ const spawnFfmpeg = async (options) => {
|
|
|
131
136
|
console.log('[verbose] isAudioOnly', mediaSupport.audio && !mediaSupport.video);
|
|
132
137
|
console.log('[verbose] proResProfileName', proResProfileName);
|
|
133
138
|
}
|
|
134
|
-
|
|
135
|
-
|
|
139
|
+
(0, crf_1.validateSelectedCrfAndCodecCombination)(crf, codec);
|
|
140
|
+
(0, pixel_format_1.validateSelectedPixelFormatAndCodecCombination)(pixelFormat, codec);
|
|
136
141
|
const expectedFrames = options.assetsInfo.assets.length;
|
|
137
142
|
const updateProgress = (preStitchProgress, muxProgress) => {
|
|
138
143
|
var _a;
|
|
@@ -142,7 +147,6 @@ const spawnFfmpeg = async (options) => {
|
|
|
142
147
|
const audio = mediaSupport.audio
|
|
143
148
|
? await getAssetsData({
|
|
144
149
|
assets: options.assetsInfo.assets,
|
|
145
|
-
downloadDir: options.assetsInfo.downloadDir,
|
|
146
150
|
onDownload: options.onDownload,
|
|
147
151
|
fps: options.fps,
|
|
148
152
|
expectedFrames,
|
|
@@ -150,6 +154,7 @@ const spawnFfmpeg = async (options) => {
|
|
|
150
154
|
ffmpegExecutable: (_g = options.ffmpegExecutable) !== null && _g !== void 0 ? _g : null,
|
|
151
155
|
ffprobeExecutable: (_h = options.ffprobeExecutable) !== null && _h !== void 0 ? _h : null,
|
|
152
156
|
onProgress: (prog) => updateProgress(prog, 0),
|
|
157
|
+
downloadMap: options.assetsInfo.downloadMap,
|
|
153
158
|
})
|
|
154
159
|
: null;
|
|
155
160
|
if (mediaSupport.audio && !mediaSupport.video) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stringifyFfmpegFilter = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
4
|
const calculate_atempo_1 = require("./assets/calculate-atempo");
|
|
6
5
|
const ffmpeg_volume_expression_1 = require("./assets/ffmpeg-volume-expression");
|
|
7
6
|
const sample_rate_1 = require("./sample-rate");
|
|
7
|
+
const truthy_1 = require("./truthy");
|
|
8
8
|
const stringifyFfmpegFilter = ({ trimLeft, trimRight, channels, startInVideo, volume, fps, playbackRate, durationInFrames, assetDuration, }) => {
|
|
9
9
|
const startInVideoSeconds = startInVideo / fps;
|
|
10
10
|
if (assetDuration && trimLeft >= assetDuration) {
|
|
@@ -50,7 +50,7 @@ const stringifyFfmpegFilter = ({ trimLeft, trimRight, channels, startInVideo, vo
|
|
|
50
50
|
? 'apad=pad_len=' + Math.round(padAtEnd * sample_rate_1.DEFAULT_SAMPLE_RATE)
|
|
51
51
|
: null,
|
|
52
52
|
]
|
|
53
|
-
.filter(
|
|
53
|
+
.filter(truthy_1.truthy)
|
|
54
54
|
.join(',') +
|
|
55
55
|
`[a0]`);
|
|
56
56
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.symbolicateStackTrace = void 0;
|
|
4
|
-
const remotion_1 = require("remotion");
|
|
5
4
|
const source_map_1 = require("source-map");
|
|
6
5
|
const read_file_1 = require("./assets/read-file");
|
|
6
|
+
const truthy_1 = require("./truthy");
|
|
7
7
|
function extractSourceMapUrl(fileContents) {
|
|
8
8
|
const regex = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/gm;
|
|
9
9
|
let match = null;
|
|
@@ -74,7 +74,7 @@ const symbolicateStackTrace = async (frames) => {
|
|
|
74
74
|
...new Set(frames
|
|
75
75
|
.map((f) => f.fileName)
|
|
76
76
|
.filter((f) => f.startsWith('http://') || f.startsWith('https://'))
|
|
77
|
-
.filter(
|
|
77
|
+
.filter(truthy_1.truthy)),
|
|
78
78
|
];
|
|
79
79
|
const maps = await Promise.all(uniqueFileNames.map(async (fileName) => {
|
|
80
80
|
const fileContents = await fetchUrl(fileName);
|
|
@@ -105,6 +105,6 @@ const symbolicateStackTrace = async (frames) => {
|
|
|
105
105
|
originalScriptCode: scriptCode,
|
|
106
106
|
};
|
|
107
107
|
})
|
|
108
|
-
.filter(
|
|
108
|
+
.filter(truthy_1.truthy);
|
|
109
109
|
};
|
|
110
110
|
exports.symbolicateStackTrace = symbolicateStackTrace;
|
package/dist/truthy.d.ts
ADDED
package/dist/truthy.js
ADDED
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateEvenDimensionsWithCodec = void 0;
|
|
4
|
-
const
|
|
4
|
+
const truthy_1 = require("./truthy");
|
|
5
5
|
const validateEvenDimensionsWithCodec = ({ width, height, codec, scale, }) => {
|
|
6
6
|
if (codec !== 'h264-mkv' && codec !== 'h264' && codec !== 'h265') {
|
|
7
7
|
return;
|
|
@@ -17,7 +17,7 @@ const validateEvenDimensionsWithCodec = ({ width, height, codec, scale, }) => {
|
|
|
17
17
|
? `Change the width to ${Math.floor(width - 1)}px to fix this issue.`
|
|
18
18
|
: `You have used the "scale" option which might be the reason for the problem: The original width is ${width} and the scale is ${scale}x, which was multiplied to get the actual width.`,
|
|
19
19
|
]
|
|
20
|
-
.filter(
|
|
20
|
+
.filter(truthy_1.truthy)
|
|
21
21
|
.join(' ');
|
|
22
22
|
throw new Error(message);
|
|
23
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateEveryNthFrame: (everyNthFrame: unknown) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateEveryNthFrame = void 0;
|
|
4
|
+
const validateEveryNthFrame = (everyNthFrame) => {
|
|
5
|
+
if (typeof everyNthFrame === 'undefined') {
|
|
6
|
+
throw new TypeError(`Argument missing for parameter "everyNthFrame"`);
|
|
7
|
+
}
|
|
8
|
+
if (typeof everyNthFrame !== 'number') {
|
|
9
|
+
throw new TypeError(`Argument passed to "everyNthFrame" is not a number: ${everyNthFrame}`);
|
|
10
|
+
}
|
|
11
|
+
if (everyNthFrame < 1) {
|
|
12
|
+
throw new RangeError(`The value for "everyNthFrame" cannot be below 1, but is ${everyNthFrame}`);
|
|
13
|
+
}
|
|
14
|
+
if (!Number.isFinite(everyNthFrame)) {
|
|
15
|
+
throw new RangeError(`"everyNthFrame" ${everyNthFrame} is not finite`);
|
|
16
|
+
}
|
|
17
|
+
if (everyNthFrame % 1 !== 0) {
|
|
18
|
+
throw new RangeError(`Argument for everyNthFrame must be an integer, but got ${everyNthFrame}`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.validateEveryNthFrame = validateEveryNthFrame;
|
package/dist/validate-ffmpeg.js
CHANGED
|
@@ -7,7 +7,6 @@ exports.validateFfmpeg = exports.binaryExists = void 0;
|
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
10
|
-
const remotion_1 = require("remotion");
|
|
11
10
|
const existsMap = {};
|
|
12
11
|
const binaryExists = async (name, localFFmpeg) => {
|
|
13
12
|
if (typeof existsMap[name] !== 'undefined') {
|
|
@@ -42,9 +41,9 @@ const isHomebrewInstalled = () => {
|
|
|
42
41
|
const validateFfmpeg = async (customFfmpegBinary) => {
|
|
43
42
|
const ffmpegExists = await (0, exports.binaryExists)('ffmpeg', customFfmpegBinary);
|
|
44
43
|
if (!ffmpegExists) {
|
|
45
|
-
if (
|
|
44
|
+
if (customFfmpegBinary) {
|
|
46
45
|
console.error('FFmpeg executable not found:');
|
|
47
|
-
console.error(
|
|
46
|
+
console.error(customFfmpegBinary);
|
|
48
47
|
process.exit(1);
|
|
49
48
|
}
|
|
50
49
|
console.error('It looks like FFMPEG is not installed');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateFrame: (frame: number, durationInFrames: number) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 (frame < 0) {
|
|
12
|
+
throw new RangeError(`Frame ${frame} cannot be negative`);
|
|
13
|
+
}
|
|
14
|
+
if (!Number.isFinite(frame)) {
|
|
15
|
+
throw new RangeError(`Frame ${frame} is not finite`);
|
|
16
|
+
}
|
|
17
|
+
if (frame % 1 !== 0) {
|
|
18
|
+
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const validRenderers: readonly ["swangle", "angle", "egl", "swiftshader"];
|
|
2
|
+
export declare type OpenGlRenderer = typeof validRenderers[number];
|
|
3
|
+
export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
|
|
4
|
+
export declare const validateOpenGlRenderer: (option: OpenGlRenderer | null) => OpenGlRenderer | null;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateOpenGlRenderer = exports.DEFAULT_OPENGL_RENDERER = void 0;
|
|
4
|
+
const validRenderers = ['swangle', 'angle', 'egl', 'swiftshader'];
|
|
5
|
+
exports.DEFAULT_OPENGL_RENDERER = null;
|
|
6
|
+
const validateOpenGlRenderer = (option) => {
|
|
7
|
+
if (option === null) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (!validRenderers.includes(option)) {
|
|
11
|
+
throw new TypeError(`${option} is not a valid GL backend. Accepted values: ${validRenderers.join(', ')}`);
|
|
12
|
+
}
|
|
13
|
+
return option;
|
|
14
|
+
};
|
|
15
|
+
exports.validateOpenGlRenderer = validateOpenGlRenderer;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Codec } from '
|
|
1
|
+
import type { Codec } from './codec';
|
|
2
2
|
export declare const validateOutputFilename: (codec: Codec, extension: string | null) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
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.1.
|
|
25
|
+
"remotion": "3.1.7",
|
|
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": "599379fef6043a7125d1979766f915580ec1cf77"
|
|
61
61
|
}
|