@remotion/renderer 4.0.0-alpha.217 → 4.0.0-alpha4
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/README.md +18 -12
- package/dist/assets/get-audio-channels.d.ts +2 -1
- package/dist/assets/get-audio-channels.js +9 -5
- package/dist/assets/get-video-stream-duration.d.ts +5 -2
- package/dist/assets/get-video-stream-duration.js +12 -6
- package/dist/audio-codec.d.ts +3 -4
- package/dist/audio-codec.js +9 -3
- package/dist/browser/BrowserFetcher.d.ts +16 -63
- package/dist/browser/BrowserFetcher.js +126 -213
- package/dist/browser/BrowserRunner.js +2 -8
- package/dist/browser/FrameManager.js +3 -2
- package/dist/browser/LaunchOptions.d.ts +0 -1
- package/dist/browser/Launcher.js +3 -9
- package/dist/browser/PuppeteerNode.d.ts +0 -3
- package/dist/browser/PuppeteerNode.js +0 -5
- package/dist/browser/create-browser-fetcher.js +34 -48
- package/dist/browser/devtools-commands.d.ts +1 -5
- package/dist/browser/devtools-types.d.ts +0 -78
- package/dist/check-apple-silicon.js +45 -2
- package/dist/client.d.ts +5 -29
- package/dist/client.js +1 -26
- package/dist/codec-supports-media.d.ts +1 -1
- package/dist/codec-supports-media.js +1 -1
- package/dist/combine-videos.d.ts +3 -0
- package/dist/combine-videos.js +9 -5
- package/dist/compositor/compose.js +2 -3
- package/dist/compositor/get-executable-path.d.ts +1 -1
- package/dist/compositor/get-executable-path.js +8 -15
- package/dist/create-ffmpeg-complex-filter.d.ts +4 -1
- package/dist/create-ffmpeg-complex-filter.js +4 -2
- package/dist/create-ffmpeg-merge-filter.d.ts +5 -2
- package/dist/create-ffmpeg-merge-filter.js +10 -2
- package/dist/create-silent-audio.d.ts +4 -1
- package/dist/create-silent-audio.js +7 -3
- package/dist/delete-directory.js +16 -16
- package/dist/ensure-presentation-timestamp.d.ts +9 -2
- package/dist/ensure-presentation-timestamp.js +13 -5
- package/dist/extract-frame-from-video.d.ts +3 -0
- package/dist/extract-frame-from-video.js +29 -7
- package/dist/file-extensions.d.ts +12 -1
- package/dist/file-extensions.js +13 -1
- package/dist/get-can-extract-frames-fast.d.ts +4 -1
- package/dist/get-can-extract-frames-fast.js +12 -1
- package/dist/get-compositions.d.ts +5 -2
- package/dist/get-compositions.js +11 -6
- package/dist/get-frame-of-video-slow.d.ts +4 -1
- package/dist/get-frame-of-video-slow.js +11 -3
- package/dist/get-frame-padded-index.d.ts +1 -2
- package/dist/get-local-browser-executable.js +3 -12
- package/dist/get-video-info.d.ts +5 -2
- package/dist/get-video-info.js +12 -6
- package/dist/guess-extension-for-media.d.ts +3 -1
- package/dist/guess-extension-for-media.js +8 -4
- package/dist/image-format.d.ts +6 -12
- package/dist/image-format.js +13 -16
- package/dist/index.d.ts +25 -36
- package/dist/index.js +15 -17
- package/dist/last-frame-from-video-cache.d.ts +4 -0
- package/dist/last-frame-from-video-cache.js +1 -0
- package/dist/merge-audio-track.d.ts +2 -0
- package/dist/merge-audio-track.js +10 -3
- package/dist/offthread-video-server.d.ts +4 -1
- package/dist/offthread-video-server.js +3 -1
- package/dist/open-browser.d.ts +0 -1
- package/dist/open-browser.js +6 -7
- package/dist/perf.d.ts +1 -1
- package/dist/perf.js +7 -9
- package/dist/prepare-server.d.ts +4 -1
- package/dist/prepare-server.js +5 -1
- package/dist/preprocess-audio-track.d.ts +4 -0
- package/dist/preprocess-audio-track.js +8 -4
- package/dist/prespawn-ffmpeg.d.ts +9 -6
- package/dist/prespawn-ffmpeg.js +12 -7
- package/dist/prestitcher-memory-usage.d.ts +4 -0
- package/dist/prestitcher-memory-usage.js +3 -2
- package/dist/prores-profile.d.ts +2 -1
- package/dist/prores-profile.js +4 -4
- package/dist/provide-screenshot.d.ts +4 -4
- package/dist/provide-screenshot.js +2 -2
- package/dist/puppeteer-screenshot.d.ts +2 -3
- package/dist/puppeteer-screenshot.js +32 -9
- package/dist/render-frames.d.ts +25 -12
- package/dist/render-frames.js +40 -27
- package/dist/render-media.d.ts +18 -16
- package/dist/render-media.js +43 -31
- package/dist/render-still.d.ts +8 -9
- package/dist/render-still.js +13 -12
- package/dist/screenshot-dom-element.d.ts +4 -4
- package/dist/screenshot-dom-element.js +3 -6
- package/dist/screenshot-task.d.ts +2 -2
- package/dist/screenshot-task.js +23 -38
- package/dist/serve-handler/index.js +4 -6
- package/dist/serve-static.d.ts +3 -0
- package/dist/serve-static.js +3 -3
- package/dist/stitch-frames-to-video.d.ts +11 -2
- package/dist/stitch-frames-to-video.js +33 -24
- package/dist/take-frame-and-compose.d.ts +4 -4
- package/dist/take-frame-and-compose.js +6 -12
- package/dist/tmp-dir.js +2 -1
- package/dist/try-to-extract-frame-of-video-fast.d.ts +4 -1
- package/dist/try-to-extract-frame-of-video-fast.js +7 -3
- package/dist/validate-concurrency.d.ts +0 -2
- package/dist/validate-concurrency.js +5 -11
- package/dist/validate-puppeteer-timeout.js +0 -1
- package/package.json +68 -71
- package/dist/browser/is-target-closed-err.d.ts +0 -1
- package/dist/browser/is-target-closed-err.js +0 -9
- package/dist/call-ffmpeg.d.ts +0 -17
- package/dist/call-ffmpeg.js +0 -34
- package/dist/compositor/compositor.d.ts +0 -15
- package/dist/compositor/compositor.js +0 -193
- package/dist/compositor/make-nonce.d.ts +0 -1
- package/dist/compositor/make-nonce.js +0 -8
- package/dist/jpeg-quality.d.ts +0 -1
- package/dist/jpeg-quality.js +0 -21
- package/dist/options/audio-bitrate.d.ts +0 -2
- package/dist/options/audio-bitrate.js +0 -11
- package/dist/options/crf.d.ts +0 -2
- package/dist/options/crf.js +0 -11
- package/dist/options/enforce-audio.d.ts +0 -2
- package/dist/options/enforce-audio.js +0 -11
- package/dist/options/jpeg-quality.d.ts +0 -2
- package/dist/options/jpeg-quality.js +0 -11
- package/dist/options/mute.d.ts +0 -2
- package/dist/options/mute.js +0 -11
- package/dist/options/option.d.ts +0 -8
- package/dist/options/option.js +0 -2
- package/dist/options/scale.d.ts +0 -2
- package/dist/options/scale.js +0 -11
- package/dist/options/video-bitrate.d.ts +0 -2
- package/dist/options/video-bitrate.js +0 -11
- package/dist/options/video-codec.d.ts +0 -2
- package/dist/options/video-codec.js +0 -11
- package/ffmpeg/SOURCE.md +0 -1
- package/ffmpeg/linux-arm-musl.gz +0 -0
- package/ffmpeg/linux-arm.gz +0 -0
- package/ffmpeg/linux-x64-musl.gz +0 -0
- package/ffmpeg/linux-x64.gz +0 -0
- package/ffmpeg/macos-arm.gz +0 -0
- package/ffmpeg/macos-x64.gz +0 -0
- package/ffmpeg/windows.gz +0 -0
- package/install-toolchain.mjs +0 -42
package/dist/image-format.js
CHANGED
|
@@ -2,36 +2,33 @@
|
|
|
2
2
|
// Keeping the default image format PNG if you don't pass a
|
|
3
3
|
// value to the renderer for backwards compatibility.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
exports.
|
|
9
|
-
exports.DEFAULT_STILL_IMAGE_FORMAT = 'png';
|
|
5
|
+
exports.validateNonNullImageFormat = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.DEFAULT_IMAGE_FORMAT = exports.validImageFormats = void 0;
|
|
6
|
+
exports.validImageFormats = ['png', 'jpeg', 'none'];
|
|
7
|
+
// However, the CLI will override it and use JPEG if suitable.
|
|
8
|
+
exports.DEFAULT_IMAGE_FORMAT = 'png';
|
|
10
9
|
// By returning a value, we improve testability as we can specifically test certain branches
|
|
11
|
-
const validateSelectedPixelFormatAndImageFormatCombination = (pixelFormat,
|
|
12
|
-
if (
|
|
10
|
+
const validateSelectedPixelFormatAndImageFormatCombination = (pixelFormat, imageFormat) => {
|
|
11
|
+
if (imageFormat === 'none') {
|
|
13
12
|
return 'none';
|
|
14
13
|
}
|
|
15
14
|
if (typeof pixelFormat === 'undefined') {
|
|
16
15
|
return 'valid';
|
|
17
16
|
}
|
|
18
|
-
if (!exports.
|
|
19
|
-
throw new TypeError(`Value ${
|
|
17
|
+
if (!exports.validImageFormats.includes(imageFormat)) {
|
|
18
|
+
throw new TypeError(`Value ${imageFormat} is not valid as an image format.`);
|
|
20
19
|
}
|
|
21
20
|
if (pixelFormat !== 'yuva420p' && pixelFormat !== 'yuva444p10le') {
|
|
22
21
|
return 'valid';
|
|
23
22
|
}
|
|
24
|
-
if (
|
|
23
|
+
if (imageFormat !== 'png') {
|
|
25
24
|
throw new TypeError(`Pixel format was set to '${pixelFormat}' but the image format is not PNG. To render transparent videos, you need to set PNG as the image format.`);
|
|
26
25
|
}
|
|
27
26
|
return 'valid';
|
|
28
27
|
};
|
|
29
28
|
exports.validateSelectedPixelFormatAndImageFormatCombination = validateSelectedPixelFormatAndImageFormatCombination;
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
throw new TypeError(
|
|
33
|
-
.map((v) => `"${v}"`)
|
|
34
|
-
.join(', ')}`));
|
|
29
|
+
const validateNonNullImageFormat = (imageFormat) => {
|
|
30
|
+
if (imageFormat !== 'jpeg' && imageFormat !== 'png') {
|
|
31
|
+
throw new TypeError('Image format should be either "png" or "jpeg"');
|
|
35
32
|
}
|
|
36
33
|
};
|
|
37
|
-
exports.
|
|
34
|
+
exports.validateNonNullImageFormat = validateNonNullImageFormat;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,23 +11,24 @@ export { BrowserExecutable } from './browser-executable';
|
|
|
11
11
|
export { BrowserLog } from './browser-log';
|
|
12
12
|
export { Codec, CodecOrUndefined } from './codec';
|
|
13
13
|
export { Crf } from './crf';
|
|
14
|
+
export { ensureFfmpeg, EnsureFfmpegOptions, ensureFfprobe, } from './ensure-ffmpeg';
|
|
14
15
|
export { ErrorWithStackFrame } from './error-handling/handle-javascript-exception';
|
|
16
|
+
export { FfmpegExecutable } from './ffmpeg-executable';
|
|
17
|
+
export { FfmpegVersion } from './ffmpeg-flags';
|
|
15
18
|
export type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
16
19
|
export { FileExtension } from './file-extensions';
|
|
17
20
|
export { FrameRange } from './frame-range';
|
|
18
21
|
export { getCanExtractFramesFast } from './get-can-extract-frames-fast';
|
|
19
22
|
export { getCompositions } from './get-compositions';
|
|
20
|
-
export {
|
|
21
|
-
export { ImageFormat, StillImageFormat, validateSelectedPixelFormatAndImageFormatCombination, VideoImageFormat, } from './image-format';
|
|
23
|
+
export { ImageFormat, StillImageFormat, validateSelectedPixelFormatAndImageFormatCombination, validImageFormats, } from './image-format';
|
|
22
24
|
export type { LogLevel } from './log-level';
|
|
23
25
|
export { CancelSignal, makeCancelSignal } from './make-cancel-signal';
|
|
24
26
|
export { openBrowser } from './open-browser';
|
|
25
27
|
export type { ChromiumOptions } from './open-browser';
|
|
26
|
-
export { RemotionOption } from './options/option';
|
|
27
28
|
export { PixelFormat } from './pixel-format';
|
|
28
29
|
export { ProResProfile } from './prores-profile';
|
|
29
30
|
export { renderFrames } from './render-frames';
|
|
30
|
-
export { renderMedia, RenderMediaOnProgress, RenderMediaOptions, SlowFrame, StitchingState, } from './render-media';
|
|
31
|
+
export { OnSlowestFrames, renderMedia, RenderMediaOnProgress, RenderMediaOptions, SlowFrame, StitchingState, } from './render-media';
|
|
31
32
|
export { renderStill, RenderStillOptions } from './render-still';
|
|
32
33
|
export { StitcherOptions, stitchFramesToVideo } from './stitch-frames-to-video';
|
|
33
34
|
export { SymbolicatedStackFrame } from './symbolicate-stacktrace';
|
|
@@ -36,9 +37,17 @@ export { OpenGlRenderer } from './validate-opengl-renderer';
|
|
|
36
37
|
export { validateOutputFilename } from './validate-output-filename';
|
|
37
38
|
export declare const RenderInternals: {
|
|
38
39
|
ensureLocalBrowser: (browser: import("./browser").Browser, preferredBrowserExecutable: import("./browser-executable").BrowserExecutable) => Promise<void>;
|
|
40
|
+
ffmpegHasFeature: ({ ffmpegExecutable, feature, remotionRoot, }: {
|
|
41
|
+
ffmpegExecutable: string | null;
|
|
42
|
+
feature: "enable-gpl" | "enable-libx265" | "enable-libvpx";
|
|
43
|
+
remotionRoot: string;
|
|
44
|
+
}) => Promise<boolean>;
|
|
39
45
|
getActualConcurrency: (userPreference: string | number | null) => number;
|
|
46
|
+
validateFfmpeg: (customFfmpegBinary: string | null, remotionRoot: string, binary: "ffmpeg" | "ffprobe") => Promise<void>;
|
|
40
47
|
serveStatic: (path: string | null, options: {
|
|
41
48
|
port: number | null;
|
|
49
|
+
ffmpegExecutable: import("./ffmpeg-executable").FfmpegExecutable;
|
|
50
|
+
ffprobeExecutable: import("./ffmpeg-executable").FfmpegExecutable;
|
|
42
51
|
onDownload: import("./assets/download-and-map-assets-to-file").RenderMediaOnDownload;
|
|
43
52
|
onError: (err: Error) => void;
|
|
44
53
|
downloadMap: import("./assets/download-map").DownloadMap;
|
|
@@ -112,9 +121,10 @@ export declare const RenderInternals: {
|
|
|
112
121
|
validateFrameRange: (frameRange: import("./frame-range").FrameRange | null) => void;
|
|
113
122
|
DEFAULT_OPENGL_RENDERER: "angle" | "swangle" | "egl" | "swiftshader" | null;
|
|
114
123
|
validateOpenGlRenderer: (option: "angle" | "swangle" | "egl" | "swiftshader" | null) => "angle" | "swangle" | "egl" | "swiftshader" | null;
|
|
124
|
+
validImageFormats: readonly ["png", "jpeg", "none"];
|
|
115
125
|
validCodecs: readonly ["h264", "h265", "vp8", "vp9", "mp3", "aac", "wav", "prores", "h264-mkv", "gif"];
|
|
116
126
|
DEFAULT_PIXEL_FORMAT: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le";
|
|
117
|
-
|
|
127
|
+
validateQuality: (q: number | undefined) => void;
|
|
118
128
|
DEFAULT_TIMEOUT: number;
|
|
119
129
|
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
120
130
|
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
@@ -129,7 +139,12 @@ export declare const RenderInternals: {
|
|
|
129
139
|
durationInFrames: number;
|
|
130
140
|
}) => number;
|
|
131
141
|
findRemotionRoot: () => string;
|
|
142
|
+
getExecutableBinary: (ffmpegExecutable: import("./ffmpeg-executable").FfmpegExecutable, remotionRoot: string, binary: "ffmpeg" | "ffprobe") => string | Promise<string>;
|
|
132
143
|
validateBitrate: (bitrate: unknown, name: string) => void;
|
|
144
|
+
getFfmpegVersion: (options: {
|
|
145
|
+
ffmpegExecutable: string | null;
|
|
146
|
+
remotionRoot: string;
|
|
147
|
+
}) => Promise<import("./ffmpeg-flags").FfmpegVersion>;
|
|
133
148
|
combineVideos: (options: {
|
|
134
149
|
files: string[];
|
|
135
150
|
filelistDir: string;
|
|
@@ -139,10 +154,10 @@ export declare const RenderInternals: {
|
|
|
139
154
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
140
155
|
fps: number;
|
|
141
156
|
numberOfGifLoops: number | null;
|
|
157
|
+
remotionRoot: string;
|
|
158
|
+
ffmpegExecutable: import("./ffmpeg-executable").FfmpegExecutable;
|
|
142
159
|
audioCodec: "mp3" | "aac" | "pcm-16" | "opus" | null;
|
|
143
160
|
}) => Promise<void>;
|
|
144
|
-
getMinConcurrency: () => number;
|
|
145
|
-
getMaxConcurrency: () => any;
|
|
146
161
|
getDefaultAudioCodec: ({ codec, preferLossless, }: {
|
|
147
162
|
codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
148
163
|
preferLossless: boolean;
|
|
@@ -260,47 +275,21 @@ export declare const RenderInternals: {
|
|
|
260
275
|
};
|
|
261
276
|
gif: {
|
|
262
277
|
default: import("./file-extensions").FileExtension;
|
|
263
|
-
forAudioCodec: {
|
|
264
|
-
[x: string]: {
|
|
265
|
-
possible: import("./file-extensions").FileExtension[];
|
|
266
|
-
default: import("./file-extensions").FileExtension;
|
|
267
|
-
};
|
|
268
|
-
};
|
|
278
|
+
forAudioCodec: {};
|
|
269
279
|
};
|
|
270
280
|
};
|
|
271
281
|
supportedAudioCodecs: {
|
|
272
282
|
readonly h264: readonly ["aac", "pcm-16"];
|
|
273
283
|
readonly 'h264-mkv': readonly ["pcm-16"];
|
|
274
284
|
readonly aac: readonly ["aac", "pcm-16"];
|
|
275
|
-
readonly gif:
|
|
285
|
+
readonly gif: readonly [];
|
|
276
286
|
readonly h265: readonly ["aac", "pcm-16"];
|
|
277
287
|
readonly mp3: readonly ["mp3", "pcm-16"];
|
|
278
|
-
readonly prores: readonly ["
|
|
288
|
+
readonly prores: readonly ["pcm-16", "aac"];
|
|
279
289
|
readonly vp8: readonly ["opus", "pcm-16"];
|
|
280
290
|
readonly vp9: readonly ["opus", "pcm-16"];
|
|
281
291
|
readonly wav: readonly ["pcm-16"];
|
|
282
292
|
};
|
|
283
293
|
makeFileExtensionMap: () => Record<string, ("h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif")[]>;
|
|
284
294
|
defaultCodecsForFileExtension: Record<import("./file-extensions").FileExtension, "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif">;
|
|
285
|
-
getExecutablePath: (type: "compositor" | "ffmpeg" | "ffprobe" | "ffmpeg-cwd") => string;
|
|
286
|
-
callFf: (bin: "ffmpeg" | "ffprobe", args: (string | null)[], options?: execa.Options<string> | undefined) => execa.ExecaChildProcess<string>;
|
|
287
|
-
callFfExtraOptions: () => {
|
|
288
|
-
env: {
|
|
289
|
-
DYLD_LIBRARY_PATH: string;
|
|
290
|
-
PATH?: undefined;
|
|
291
|
-
LD_LIBRARY_PATH?: undefined;
|
|
292
|
-
} | {
|
|
293
|
-
PATH: string;
|
|
294
|
-
DYLD_LIBRARY_PATH?: undefined;
|
|
295
|
-
LD_LIBRARY_PATH?: undefined;
|
|
296
|
-
} | {
|
|
297
|
-
LD_LIBRARY_PATH: string;
|
|
298
|
-
DYLD_LIBRARY_PATH?: undefined;
|
|
299
|
-
PATH?: undefined;
|
|
300
|
-
};
|
|
301
|
-
};
|
|
302
|
-
validStillImageFormats: readonly ["png", "jpeg", "pdf", "webp"];
|
|
303
|
-
validVideoImageFormats: readonly ["png", "jpeg", "none"];
|
|
304
|
-
DEFAULT_STILL_IMAGE_FORMAT: "jpeg" | "png" | "webp" | "pdf";
|
|
305
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: "jpeg" | "png" | "none";
|
|
306
295
|
};
|
package/dist/index.js
CHANGED
|
@@ -26,24 +26,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.RenderInternals = exports.validateOutputFilename = exports.stitchFramesToVideo = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.
|
|
29
|
+
exports.RenderInternals = exports.validateOutputFilename = exports.stitchFramesToVideo = exports.renderStill = exports.renderMedia = exports.renderFrames = exports.openBrowser = exports.makeCancelSignal = exports.validImageFormats = exports.validateSelectedPixelFormatAndImageFormatCombination = exports.getCompositions = exports.getCanExtractFramesFast = exports.ErrorWithStackFrame = exports.ensureFfprobe = exports.ensureFfmpeg = void 0;
|
|
30
30
|
const execa_1 = __importDefault(require("execa"));
|
|
31
31
|
const download_file_1 = require("./assets/download-file");
|
|
32
32
|
const download_map_1 = require("./assets/download-map");
|
|
33
33
|
const audio_codec_1 = require("./audio-codec");
|
|
34
34
|
const browser_1 = require("./browser");
|
|
35
35
|
const TimeoutSettings_1 = require("./browser/TimeoutSettings");
|
|
36
|
-
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
37
36
|
const can_use_parallel_encoding_1 = require("./can-use-parallel-encoding");
|
|
38
37
|
const check_apple_silicon_1 = require("./check-apple-silicon");
|
|
39
38
|
const codec_1 = require("./codec");
|
|
40
39
|
const combine_videos_1 = require("./combine-videos");
|
|
41
|
-
const get_executable_path_1 = require("./compositor/get-executable-path");
|
|
42
40
|
const convert_to_positive_frame_index_1 = require("./convert-to-positive-frame-index");
|
|
43
41
|
const delete_directory_1 = require("./delete-directory");
|
|
44
42
|
const ensure_output_directory_1 = require("./ensure-output-directory");
|
|
45
43
|
const symbolicate_error_1 = require("./error-handling/symbolicate-error");
|
|
46
44
|
const symbolicateable_error_1 = require("./error-handling/symbolicateable-error");
|
|
45
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
47
46
|
const file_extensions_1 = require("./file-extensions");
|
|
48
47
|
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
49
48
|
const frame_range_1 = require("./frame-range");
|
|
@@ -57,32 +56,35 @@ const get_port_1 = require("./get-port");
|
|
|
57
56
|
const image_format_1 = require("./image-format");
|
|
58
57
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
59
58
|
const is_serve_url_1 = require("./is-serve-url");
|
|
60
|
-
const jpeg_quality_1 = require("./jpeg-quality");
|
|
61
59
|
const log_level_1 = require("./log-level");
|
|
62
60
|
const mime_types_1 = require("./mime-types");
|
|
63
61
|
const open_browser_1 = require("./open-browser");
|
|
64
62
|
const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
|
|
65
63
|
const perf = __importStar(require("./perf"));
|
|
66
64
|
const pixel_format_1 = require("./pixel-format");
|
|
65
|
+
const quality_1 = require("./quality");
|
|
67
66
|
const is_path_inside_1 = require("./serve-handler/is-path-inside");
|
|
68
67
|
const serve_static_1 = require("./serve-static");
|
|
69
68
|
const tmp_dir_1 = require("./tmp-dir");
|
|
70
69
|
const validate_concurrency_1 = require("./validate-concurrency");
|
|
71
70
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
71
|
+
const validate_ffmpeg_1 = require("./validate-ffmpeg");
|
|
72
72
|
const validate_opengl_renderer_1 = require("./validate-opengl-renderer");
|
|
73
73
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
74
74
|
const validate_videobitrate_1 = require("./validate-videobitrate");
|
|
75
75
|
const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
|
|
76
|
+
var ensure_ffmpeg_1 = require("./ensure-ffmpeg");
|
|
77
|
+
Object.defineProperty(exports, "ensureFfmpeg", { enumerable: true, get: function () { return ensure_ffmpeg_1.ensureFfmpeg; } });
|
|
78
|
+
Object.defineProperty(exports, "ensureFfprobe", { enumerable: true, get: function () { return ensure_ffmpeg_1.ensureFfprobe; } });
|
|
76
79
|
var handle_javascript_exception_1 = require("./error-handling/handle-javascript-exception");
|
|
77
80
|
Object.defineProperty(exports, "ErrorWithStackFrame", { enumerable: true, get: function () { return handle_javascript_exception_1.ErrorWithStackFrame; } });
|
|
78
81
|
var get_can_extract_frames_fast_1 = require("./get-can-extract-frames-fast");
|
|
79
82
|
Object.defineProperty(exports, "getCanExtractFramesFast", { enumerable: true, get: function () { return get_can_extract_frames_fast_1.getCanExtractFramesFast; } });
|
|
80
83
|
var get_compositions_1 = require("./get-compositions");
|
|
81
84
|
Object.defineProperty(exports, "getCompositions", { enumerable: true, get: function () { return get_compositions_1.getCompositions; } });
|
|
82
|
-
var get_concurrency_2 = require("./get-concurrency");
|
|
83
|
-
Object.defineProperty(exports, "getActualConcurrency", { enumerable: true, get: function () { return get_concurrency_2.getActualConcurrency; } });
|
|
84
85
|
var image_format_2 = require("./image-format");
|
|
85
86
|
Object.defineProperty(exports, "validateSelectedPixelFormatAndImageFormatCombination", { enumerable: true, get: function () { return image_format_2.validateSelectedPixelFormatAndImageFormatCombination; } });
|
|
87
|
+
Object.defineProperty(exports, "validImageFormats", { enumerable: true, get: function () { return image_format_2.validImageFormats; } });
|
|
86
88
|
var make_cancel_signal_1 = require("./make-cancel-signal");
|
|
87
89
|
Object.defineProperty(exports, "makeCancelSignal", { enumerable: true, get: function () { return make_cancel_signal_1.makeCancelSignal; } });
|
|
88
90
|
var open_browser_2 = require("./open-browser");
|
|
@@ -99,7 +101,9 @@ var validate_output_filename_1 = require("./validate-output-filename");
|
|
|
99
101
|
Object.defineProperty(exports, "validateOutputFilename", { enumerable: true, get: function () { return validate_output_filename_1.validateOutputFilename; } });
|
|
100
102
|
exports.RenderInternals = {
|
|
101
103
|
ensureLocalBrowser: get_local_browser_executable_1.ensureLocalBrowser,
|
|
104
|
+
ffmpegHasFeature: ffmpeg_flags_1.ffmpegHasFeature,
|
|
102
105
|
getActualConcurrency: get_concurrency_1.getActualConcurrency,
|
|
106
|
+
validateFfmpeg: validate_ffmpeg_1.validateFfmpeg,
|
|
103
107
|
serveStatic: serve_static_1.serveStatic,
|
|
104
108
|
validateEvenDimensionsWithCodec: validate_even_dimensions_with_codec_1.validateEvenDimensionsWithCodec,
|
|
105
109
|
getFileExtensionFromCodec: get_extension_from_codec_1.getFileExtensionFromCodec,
|
|
@@ -130,9 +134,10 @@ exports.RenderInternals = {
|
|
|
130
134
|
validateFrameRange: frame_range_1.validateFrameRange,
|
|
131
135
|
DEFAULT_OPENGL_RENDERER: validate_opengl_renderer_1.DEFAULT_OPENGL_RENDERER,
|
|
132
136
|
validateOpenGlRenderer: validate_opengl_renderer_1.validateOpenGlRenderer,
|
|
137
|
+
validImageFormats: image_format_1.validImageFormats,
|
|
133
138
|
validCodecs: codec_1.validCodecs,
|
|
134
139
|
DEFAULT_PIXEL_FORMAT: pixel_format_1.DEFAULT_PIXEL_FORMAT,
|
|
135
|
-
|
|
140
|
+
validateQuality: quality_1.validateQuality,
|
|
136
141
|
DEFAULT_TIMEOUT: TimeoutSettings_1.DEFAULT_TIMEOUT,
|
|
137
142
|
DEFAULT_CODEC: codec_1.DEFAULT_CODEC,
|
|
138
143
|
isAudioCodec: is_audio_codec_1.isAudioCodec,
|
|
@@ -144,23 +149,16 @@ exports.RenderInternals = {
|
|
|
144
149
|
cleanDownloadMap: download_map_1.cleanDownloadMap,
|
|
145
150
|
convertToPositiveFrameIndex: convert_to_positive_frame_index_1.convertToPositiveFrameIndex,
|
|
146
151
|
findRemotionRoot: find_closest_package_json_1.findRemotionRoot,
|
|
152
|
+
getExecutableBinary: ffmpeg_flags_1.getExecutableBinary,
|
|
147
153
|
validateBitrate: validate_videobitrate_1.validateBitrate,
|
|
154
|
+
getFfmpegVersion: ffmpeg_flags_1.getFfmpegVersion,
|
|
148
155
|
combineVideos: combine_videos_1.combineVideos,
|
|
149
|
-
getMinConcurrency: validate_concurrency_1.getMinConcurrency,
|
|
150
|
-
getMaxConcurrency: validate_concurrency_1.getMaxConcurrency,
|
|
151
156
|
getDefaultAudioCodec: audio_codec_1.getDefaultAudioCodec,
|
|
152
157
|
validAudioCodecs: audio_codec_1.validAudioCodecs,
|
|
153
158
|
defaultFileExtensionMap: file_extensions_1.defaultFileExtensionMap,
|
|
154
|
-
supportedAudioCodecs:
|
|
159
|
+
supportedAudioCodecs: file_extensions_1.supportedAudioCodecs,
|
|
155
160
|
makeFileExtensionMap: get_extension_from_codec_1.makeFileExtensionMap,
|
|
156
161
|
defaultCodecsForFileExtension: get_extension_from_codec_1.defaultCodecsForFileExtension,
|
|
157
|
-
getExecutablePath: get_executable_path_1.getExecutablePath,
|
|
158
|
-
callFf: call_ffmpeg_1.callFf,
|
|
159
|
-
callFfExtraOptions: call_ffmpeg_1.callFfExtraOptions,
|
|
160
|
-
validStillImageFormats: image_format_1.validStillImageFormats,
|
|
161
|
-
validVideoImageFormats: image_format_1.validVideoImageFormats,
|
|
162
|
-
DEFAULT_STILL_IMAGE_FORMAT: image_format_1.DEFAULT_STILL_IMAGE_FORMAT,
|
|
163
|
-
DEFAULT_VIDEO_IMAGE_FORMAT: image_format_1.DEFAULT_VIDEO_IMAGE_FORMAT,
|
|
164
162
|
};
|
|
165
163
|
// Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
|
|
166
164
|
(0, check_apple_silicon_1.checkNodeVersionAndWarnAboutRosetta)();
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { OffthreadVideoImageFormat } from 'remotion';
|
|
3
3
|
import type { DownloadMap, SpecialVCodecForTransparency } from './assets/download-map';
|
|
4
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
5
|
export declare type LastFrameOptions = {
|
|
6
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
7
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
5
8
|
offset: number;
|
|
6
9
|
src: string;
|
|
7
10
|
specialVCodecForTransparency: SpecialVCodecForTransparency;
|
|
8
11
|
imageFormat: OffthreadVideoImageFormat;
|
|
9
12
|
needsResize: [number, number] | null;
|
|
10
13
|
downloadMap: DownloadMap;
|
|
14
|
+
remotionRoot: string;
|
|
11
15
|
};
|
|
12
16
|
export declare const setLastFrameInCache: (options: LastFrameOptions, data: Buffer) => void;
|
|
13
17
|
export declare const getLastFrameFromCache: (options: LastFrameOptions) => Buffer | null;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
2
3
|
import type { PreprocessedAudioTrack } from './preprocess-audio-track';
|
|
3
4
|
declare type Options = {
|
|
5
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
4
6
|
files: PreprocessedAudioTrack[];
|
|
5
7
|
outName: string;
|
|
6
8
|
numberOfSeconds: number;
|
|
@@ -4,21 +4,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.mergeAudioTrack = void 0;
|
|
7
|
+
const execa_1 = __importDefault(require("execa"));
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
9
9
|
const chunk_1 = require("./chunk");
|
|
10
10
|
const create_ffmpeg_complex_filter_1 = require("./create-ffmpeg-complex-filter");
|
|
11
11
|
const create_ffmpeg_merge_filter_1 = require("./create-ffmpeg-merge-filter");
|
|
12
12
|
const create_silent_audio_1 = require("./create-silent-audio");
|
|
13
13
|
const delete_directory_1 = require("./delete-directory");
|
|
14
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
14
15
|
const p_limit_1 = require("./p-limit");
|
|
15
16
|
const tmp_dir_1 = require("./tmp-dir");
|
|
16
17
|
const truthy_1 = require("./truthy");
|
|
17
|
-
const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downloadMap, remotionRoot, }) => {
|
|
18
|
+
const mergeAudioTrackUnlimited = async ({ ffmpegExecutable, outName, files, numberOfSeconds, downloadMap, remotionRoot, }) => {
|
|
18
19
|
if (files.length === 0) {
|
|
19
20
|
await (0, create_silent_audio_1.createSilentAudio)({
|
|
20
21
|
outName,
|
|
22
|
+
ffmpegExecutable,
|
|
21
23
|
numberOfSeconds,
|
|
24
|
+
remotionRoot,
|
|
22
25
|
});
|
|
23
26
|
return;
|
|
24
27
|
}
|
|
@@ -31,6 +34,7 @@ const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downl
|
|
|
31
34
|
const chunkNames = await Promise.all(chunked.map(async (chunkFiles, i) => {
|
|
32
35
|
const chunkOutname = path_1.default.join(tempPath, `chunk-${i}.wav`);
|
|
33
36
|
await (0, exports.mergeAudioTrack)({
|
|
37
|
+
ffmpegExecutable,
|
|
34
38
|
files: chunkFiles,
|
|
35
39
|
numberOfSeconds,
|
|
36
40
|
outName: chunkOutname,
|
|
@@ -40,6 +44,7 @@ const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downl
|
|
|
40
44
|
return chunkOutname;
|
|
41
45
|
}));
|
|
42
46
|
await (0, exports.mergeAudioTrack)({
|
|
47
|
+
ffmpegExecutable,
|
|
43
48
|
files: chunkNames.map((c) => ({
|
|
44
49
|
filter: {
|
|
45
50
|
pad_end: null,
|
|
@@ -61,6 +66,8 @@ const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downl
|
|
|
61
66
|
const { complexFilterFlag: mergeFilter, cleanup } = await (0, create_ffmpeg_complex_filter_1.createFfmpegComplexFilter)({
|
|
62
67
|
filters: files,
|
|
63
68
|
downloadMap,
|
|
69
|
+
ffmpegExecutable,
|
|
70
|
+
remotionRoot,
|
|
64
71
|
});
|
|
65
72
|
const args = [
|
|
66
73
|
...files.map((f) => ['-i', f.outName]),
|
|
@@ -71,7 +78,7 @@ const mergeAudioTrackUnlimited = async ({ outName, files, numberOfSeconds, downl
|
|
|
71
78
|
]
|
|
72
79
|
.filter(truthy_1.truthy)
|
|
73
80
|
.flat(2);
|
|
74
|
-
const task = (0,
|
|
81
|
+
const task = (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), args);
|
|
75
82
|
await task;
|
|
76
83
|
cleanup();
|
|
77
84
|
};
|
|
@@ -2,12 +2,15 @@ import type { RequestListener } from 'http';
|
|
|
2
2
|
import type { OffthreadVideoImageFormat } from 'remotion';
|
|
3
3
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
4
4
|
import type { DownloadMap } from './assets/download-map';
|
|
5
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
5
6
|
export declare const extractUrlAndSourceFromUrl: (url: string) => {
|
|
6
7
|
src: string;
|
|
7
8
|
time: number;
|
|
8
9
|
imageFormat: OffthreadVideoImageFormat;
|
|
9
10
|
};
|
|
10
|
-
export declare const startOffthreadVideoServer: ({ onDownload, onError, downloadMap, remotionRoot, }: {
|
|
11
|
+
export declare const startOffthreadVideoServer: ({ ffmpegExecutable, ffprobeExecutable, onDownload, onError, downloadMap, remotionRoot, }: {
|
|
12
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
13
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
11
14
|
onDownload: RenderMediaOnDownload;
|
|
12
15
|
onError: (err: Error) => void;
|
|
13
16
|
downloadMap: DownloadMap;
|
|
@@ -32,7 +32,7 @@ const extractUrlAndSourceFromUrl = (url) => {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
exports.extractUrlAndSourceFromUrl = extractUrlAndSourceFromUrl;
|
|
35
|
-
const startOffthreadVideoServer = ({ onDownload, onError, downloadMap, remotionRoot, }) => {
|
|
35
|
+
const startOffthreadVideoServer = ({ ffmpegExecutable, ffprobeExecutable, onDownload, onError, downloadMap, remotionRoot, }) => {
|
|
36
36
|
return (req, res) => {
|
|
37
37
|
if (!req.url) {
|
|
38
38
|
throw new Error('Request came in without URL');
|
|
@@ -61,6 +61,8 @@ const startOffthreadVideoServer = ({ onDownload, onError, downloadMap, remotionR
|
|
|
61
61
|
return (0, extract_frame_from_video_1.extractFrameFromVideo)({
|
|
62
62
|
time,
|
|
63
63
|
src: to,
|
|
64
|
+
ffmpegExecutable,
|
|
65
|
+
ffprobeExecutable,
|
|
64
66
|
imageFormat,
|
|
65
67
|
downloadMap,
|
|
66
68
|
remotionRoot,
|
package/dist/open-browser.d.ts
CHANGED
package/dist/open-browser.js
CHANGED
|
@@ -32,7 +32,7 @@ exports.killAllBrowsers = killAllBrowsers;
|
|
|
32
32
|
* @see [Documentation](https://www.remotion.dev/docs/renderer/open-browser)
|
|
33
33
|
*/
|
|
34
34
|
const openBrowser = async (browser, options) => {
|
|
35
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
36
36
|
if (browser === 'firefox') {
|
|
37
37
|
throw new TypeError('Firefox supported is not yet turned on. Stay tuned for the future.');
|
|
38
38
|
}
|
|
@@ -43,7 +43,6 @@ const openBrowser = async (browser, options) => {
|
|
|
43
43
|
executablePath,
|
|
44
44
|
product: browser,
|
|
45
45
|
dumpio: (_e = options === null || options === void 0 ? void 0 : options.shouldDumpIo) !== null && _e !== void 0 ? _e : false,
|
|
46
|
-
indentationString: (_f = options === null || options === void 0 ? void 0 : options.indentationString) !== null && _f !== void 0 ? _f : '',
|
|
47
46
|
args: [
|
|
48
47
|
'about:blank',
|
|
49
48
|
'--allow-pre-commit-input',
|
|
@@ -76,7 +75,7 @@ const openBrowser = async (browser, options) => {
|
|
|
76
75
|
'--enable-blink-features=IdleDetection',
|
|
77
76
|
'--export-tagged-pdf',
|
|
78
77
|
'--intensive-wake-up-throttling-policy=0',
|
|
79
|
-
((
|
|
78
|
+
((_g = (_f = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _f === void 0 ? void 0 : _f.headless) !== null && _g !== void 0 ? _g : true) ? '--headless' : null,
|
|
80
79
|
'--no-sandbox',
|
|
81
80
|
'--disable-setuid-sandbox',
|
|
82
81
|
...customGlRenderer,
|
|
@@ -97,17 +96,17 @@ const openBrowser = async (browser, options) => {
|
|
|
97
96
|
(options === null || options === void 0 ? void 0 : options.forceDeviceScaleFactor)
|
|
98
97
|
? `--force-device-scale-factor=${options.forceDeviceScaleFactor}`
|
|
99
98
|
: null,
|
|
100
|
-
((
|
|
99
|
+
((_h = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _h === void 0 ? void 0 : _h.ignoreCertificateErrors)
|
|
101
100
|
? '--ignore-certificate-errors'
|
|
102
101
|
: null,
|
|
103
|
-
...(((
|
|
102
|
+
...(((_j = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _j === void 0 ? void 0 : _j.disableWebSecurity)
|
|
104
103
|
? ['--disable-web-security']
|
|
105
104
|
: []),
|
|
106
|
-
((
|
|
105
|
+
((_k = options === null || options === void 0 ? void 0 : options.chromiumOptions) === null || _k === void 0 ? void 0 : _k.userAgent)
|
|
107
106
|
? `--user-agent="${options.chromiumOptions.userAgent}"`
|
|
108
107
|
: null,
|
|
109
108
|
].filter(Boolean),
|
|
110
|
-
defaultViewport: (
|
|
109
|
+
defaultViewport: (_l = options === null || options === void 0 ? void 0 : options.viewport) !== null && _l !== void 0 ? _l : {
|
|
111
110
|
height: 720,
|
|
112
111
|
width: 1280,
|
|
113
112
|
deviceScaleFactor: 1,
|
package/dist/perf.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare type PerfId = 'activate-target' | 'capture' | 'save' | 'extract-frame' | 'piping';
|
|
2
2
|
export declare const startPerfMeasure: (marker: PerfId) => number;
|
|
3
3
|
export declare const stopPerfMeasure: (id: number) => void;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const logPerf: () => void;
|
|
5
5
|
export {};
|
package/dist/perf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.logPerf = exports.stopPerfMeasure = exports.startPerfMeasure = void 0;
|
|
4
4
|
const perf = {
|
|
5
5
|
'activate-target': [],
|
|
6
6
|
capture: [],
|
|
@@ -26,12 +26,10 @@ const stopPerfMeasure = (id) => {
|
|
|
26
26
|
delete map[id];
|
|
27
27
|
};
|
|
28
28
|
exports.stopPerfMeasure = stopPerfMeasure;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}),
|
|
35
|
-
];
|
|
29
|
+
const logPerf = () => {
|
|
30
|
+
console.log('Render performance:');
|
|
31
|
+
Object.keys(perf).forEach((p) => {
|
|
32
|
+
console.log(` ${p} => ${perf[p].reduce((a, b) => a + b, 0) / perf[p].length} (n = ${perf[p].length})`);
|
|
33
|
+
});
|
|
36
34
|
};
|
|
37
|
-
exports.
|
|
35
|
+
exports.logPerf = logPerf;
|
package/dist/prepare-server.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
2
2
|
import type { DownloadMap } from './assets/download-map';
|
|
3
|
-
|
|
3
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
|
+
export declare const prepareServer: ({ ffmpegExecutable, ffprobeExecutable, onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, }: {
|
|
4
5
|
webpackConfigOrServeUrl: string;
|
|
5
6
|
onDownload: RenderMediaOnDownload;
|
|
6
7
|
onError: (err: Error) => void;
|
|
8
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
9
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
7
10
|
port: number | null;
|
|
8
11
|
downloadMap: DownloadMap;
|
|
9
12
|
remotionRoot: string;
|
package/dist/prepare-server.js
CHANGED
|
@@ -9,11 +9,13 @@ const path_1 = __importDefault(require("path"));
|
|
|
9
9
|
const is_serve_url_1 = require("./is-serve-url");
|
|
10
10
|
const serve_static_1 = require("./serve-static");
|
|
11
11
|
const wait_for_symbolication_error_to_be_done_1 = require("./wait-for-symbolication-error-to-be-done");
|
|
12
|
-
const prepareServer = async ({ onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, }) => {
|
|
12
|
+
const prepareServer = async ({ ffmpegExecutable, ffprobeExecutable, onDownload, onError, webpackConfigOrServeUrl, port, downloadMap, remotionRoot, }) => {
|
|
13
13
|
if ((0, is_serve_url_1.isServeUrl)(webpackConfigOrServeUrl)) {
|
|
14
14
|
const { port: offthreadPort, close: closeProxy } = await (0, serve_static_1.serveStatic)(null, {
|
|
15
15
|
onDownload,
|
|
16
16
|
onError,
|
|
17
|
+
ffmpegExecutable,
|
|
18
|
+
ffprobeExecutable,
|
|
17
19
|
port,
|
|
18
20
|
downloadMap,
|
|
19
21
|
remotionRoot,
|
|
@@ -35,6 +37,8 @@ const prepareServer = async ({ onDownload, onError, webpackConfigOrServeUrl, por
|
|
|
35
37
|
const { port: serverPort, close } = await (0, serve_static_1.serveStatic)(webpackConfigOrServeUrl, {
|
|
36
38
|
onDownload,
|
|
37
39
|
onError,
|
|
40
|
+
ffmpegExecutable,
|
|
41
|
+
ffprobeExecutable,
|
|
38
42
|
port,
|
|
39
43
|
downloadMap,
|
|
40
44
|
remotionRoot,
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { DownloadMap } from './assets/download-map';
|
|
2
2
|
import type { MediaAsset } from './assets/types';
|
|
3
|
+
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
3
4
|
import type { ProcessedTrack } from './stringify-ffmpeg-filter';
|
|
4
5
|
declare type Options = {
|
|
6
|
+
ffmpegExecutable: FfmpegExecutable;
|
|
7
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
5
8
|
outName: string;
|
|
6
9
|
asset: MediaAsset;
|
|
7
10
|
expectedFrames: number;
|
|
8
11
|
fps: number;
|
|
9
12
|
downloadMap: DownloadMap;
|
|
13
|
+
remotionRoot: string;
|
|
10
14
|
};
|
|
11
15
|
export declare type PreprocessedAudioTrack = {
|
|
12
16
|
outName: string;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.preprocessAudioTrack = void 0;
|
|
7
|
+
const execa_1 = __importDefault(require("execa"));
|
|
4
8
|
const get_audio_channels_1 = require("./assets/get-audio-channels");
|
|
5
9
|
const calculate_ffmpeg_filters_1 = require("./calculate-ffmpeg-filters");
|
|
6
|
-
const call_ffmpeg_1 = require("./call-ffmpeg");
|
|
7
10
|
const ffmpeg_filter_file_1 = require("./ffmpeg-filter-file");
|
|
11
|
+
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
8
12
|
const p_limit_1 = require("./p-limit");
|
|
9
13
|
const resolve_asset_src_1 = require("./resolve-asset-src");
|
|
10
14
|
const sample_rate_1 = require("./sample-rate");
|
|
11
|
-
const preprocessAudioTrackUnlimited = async ({ outName, asset, expectedFrames, fps, downloadMap, }) => {
|
|
12
|
-
const { channels, duration } = await (0, get_audio_channels_1.getAudioChannelsAndDuration)(downloadMap, (0, resolve_asset_src_1.resolveAssetSrc)(asset.src));
|
|
15
|
+
const preprocessAudioTrackUnlimited = async ({ ffmpegExecutable, ffprobeExecutable, outName, asset, expectedFrames, fps, downloadMap, remotionRoot, }) => {
|
|
16
|
+
const { channels, duration } = await (0, get_audio_channels_1.getAudioChannelsAndDuration)(downloadMap, (0, resolve_asset_src_1.resolveAssetSrc)(asset.src), ffprobeExecutable, remotionRoot);
|
|
13
17
|
const filter = (0, calculate_ffmpeg_filters_1.calculateFfmpegFilter)({
|
|
14
18
|
asset,
|
|
15
19
|
durationInFrames: expectedFrames,
|
|
@@ -29,7 +33,7 @@ const preprocessAudioTrackUnlimited = async ({ outName, asset, expectedFrames, f
|
|
|
29
33
|
['-ar', String(sample_rate_1.DEFAULT_SAMPLE_RATE)],
|
|
30
34
|
['-y', outName],
|
|
31
35
|
].flat(2);
|
|
32
|
-
await (0,
|
|
36
|
+
await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), args);
|
|
33
37
|
cleanup();
|
|
34
38
|
return { outName, filter };
|
|
35
39
|
};
|