@remotion/renderer 3.2.21 → 3.2.22
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/ffmpeg-args-hook.d.ts +4 -1
- package/dist/ffmpeg-override.d.ts +4 -0
- package/dist/ffmpeg-override.js +2 -0
- package/dist/get-extension-from-codec.d.ts +1 -1
- package/dist/guess-extension-for-media.d.ts +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/last-frame-from-video-cache.d.ts +0 -1
- package/dist/prespawn-ffmpeg.d.ts +2 -0
- package/dist/prespawn-ffmpeg.js +4 -1
- package/dist/render-media.d.ts +3 -1
- package/dist/render-media.js +5 -1
- package/dist/stitch-frames-to-video.d.ts +2 -0
- package/dist/stitch-frames-to-video.js +11 -1
- package/dist/validate-ffmpeg-args-hook.d.ts +2 -2
- package/dist/validate-ffmpeg-args-hook.js +3 -0
- package/dist/validate-ffmpeg-override-fn.d.ts +2 -0
- package/dist/validate-ffmpeg-override-fn.js +12 -0
- package/dist/validate-ffmpeg-override.d.ts +2 -0
- package/dist/validate-ffmpeg-override.js +12 -0
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Codec } from './codec';
|
|
2
|
-
export declare const getFileExtensionFromCodec: (codec: Codec, type: 'chunk' | 'final') => "mp3" | "aac" | "wav" | "gif" | "
|
|
2
|
+
export declare const getFileExtensionFromCodec: (codec: Codec, type: 'chunk' | 'final') => "mp3" | "aac" | "wav" | "gif" | "mp4" | "mkv" | "mov" | "webm";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const guessExtensionForVideo: (src: string) => Promise<"mp3" | "wav" | "
|
|
1
|
+
export declare const guessExtensionForVideo: (src: string) => Promise<"mp3" | "wav" | "mp4" | "webm">;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import execa from 'execa';
|
|
2
3
|
import { SymbolicateableError } from './error-handling/symbolicateable-error';
|
|
3
4
|
import { mimeContentType, mimeLookup } from './mime-types';
|
|
@@ -13,6 +14,7 @@ export { Crf } from './crf';
|
|
|
13
14
|
export { ErrorWithStackFrame } from './error-handling/handle-javascript-exception';
|
|
14
15
|
export { FfmpegExecutable } from './ffmpeg-executable';
|
|
15
16
|
export { FfmpegVersion } from './ffmpeg-flags';
|
|
17
|
+
export type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
16
18
|
export { FrameRange } from './frame-range';
|
|
17
19
|
export { getCompositions } from './get-compositions';
|
|
18
20
|
export { ImageFormat, StillImageFormat, validateSelectedPixelFormatAndImageFormatCombination, validImageFormats, } from './image-format';
|
|
@@ -136,11 +138,11 @@ export declare const RenderInternals: {
|
|
|
136
138
|
getValidCrfRanges: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => [number, number];
|
|
137
139
|
validateSelectedPixelFormatAndCodecCombination: (pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le", codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif") => void;
|
|
138
140
|
validateSelectedCodecAndProResCombination: (actualCodec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif", actualProResProfile: "4444-xq" | "4444" | "hq" | "standard" | "light" | "proxy" | undefined) => void;
|
|
139
|
-
validateSelectedPixelFormatAndImageFormatCombination: (pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le", imageFormat: "
|
|
141
|
+
validateSelectedPixelFormatAndImageFormatCombination: (pixelFormat: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le", imageFormat: "none" | "png" | "jpeg") => "none" | "valid";
|
|
140
142
|
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
141
143
|
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
142
144
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
143
|
-
isEqualOrBelowLogLevel: (currentLevel: "
|
|
145
|
+
isEqualOrBelowLogLevel: (currentLevel: "verbose" | "error" | "info" | "warn", level: "verbose" | "error" | "info" | "warn") => boolean;
|
|
144
146
|
isValidLogLevel: (level: string) => boolean;
|
|
145
147
|
validateEveryNthFrame: (everyNthFrame: unknown) => void;
|
|
146
148
|
perf: typeof perf;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import execa from 'execa';
|
|
2
2
|
import type { Codec } from './codec';
|
|
3
3
|
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
|
+
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
4
5
|
import type { ImageFormat } from './image-format';
|
|
5
6
|
import type { CancelSignal } from './make-cancel-signal';
|
|
6
7
|
import type { PixelFormat } from './pixel-format';
|
|
@@ -18,6 +19,7 @@ declare type PreSticherOptions = {
|
|
|
18
19
|
verbose: boolean;
|
|
19
20
|
ffmpegExecutable: FfmpegExecutable | undefined;
|
|
20
21
|
imageFormat: ImageFormat;
|
|
22
|
+
ffmpegOverride?: FfmpegOverrideFn;
|
|
21
23
|
signal: CancelSignal;
|
|
22
24
|
};
|
|
23
25
|
export declare const prespawnFfmpeg: (options: PreSticherOptions) => Promise<{
|
package/dist/prespawn-ffmpeg.js
CHANGED
|
@@ -75,7 +75,10 @@ const prespawnFfmpeg = async (options) => {
|
|
|
75
75
|
console.log(ffmpegArgs);
|
|
76
76
|
}
|
|
77
77
|
const ffmpegString = ffmpegArgs.flat(2).filter(Boolean);
|
|
78
|
-
const
|
|
78
|
+
const finalFfmpegString = options.ffmpegOverride
|
|
79
|
+
? options.ffmpegOverride({ type: 'pre-stitcher', args: ffmpegString })
|
|
80
|
+
: ffmpegString;
|
|
81
|
+
const task = (0, execa_1.default)((_f = options.ffmpegExecutable) !== null && _f !== void 0 ? _f : 'ffmpeg', finalFfmpegString);
|
|
79
82
|
options.signal(() => {
|
|
80
83
|
task.kill();
|
|
81
84
|
});
|
package/dist/render-media.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { BrowserLog } from './browser-log';
|
|
|
6
6
|
import type { Browser as PuppeteerBrowser } from './browser/Browser';
|
|
7
7
|
import type { Codec } from './codec';
|
|
8
8
|
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
9
|
+
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
9
10
|
import type { FrameRange } from './frame-range';
|
|
10
11
|
import type { ServeUrlOrWebpackBundle } from './legacy-webpack-config';
|
|
11
12
|
import type { CancelSignal } from './make-cancel-signal';
|
|
@@ -58,6 +59,7 @@ export declare type RenderMediaOptions = {
|
|
|
58
59
|
downloadMap?: DownloadMap;
|
|
59
60
|
muted?: boolean;
|
|
60
61
|
enforceAudioTrack?: boolean;
|
|
62
|
+
ffmpegOverride?: FfmpegOverrideFn;
|
|
61
63
|
} & ServeUrlOrWebpackBundle & ConcurrencyOrParallelism;
|
|
62
64
|
declare type ConcurrencyOrParallelism = {
|
|
63
65
|
concurrency?: number | null;
|
|
@@ -72,5 +74,5 @@ declare type ConcurrencyOrParallelism = {
|
|
|
72
74
|
* @description Render a video from a composition
|
|
73
75
|
* @link https://www.remotion.dev/docs/renderer/render-media
|
|
74
76
|
*/
|
|
75
|
-
export declare const renderMedia: ({ proResProfile, crf, composition, ffmpegExecutable, ffprobeExecutable, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ...options }: RenderMediaOptions) => Promise<Buffer | null>;
|
|
77
|
+
export declare const renderMedia: ({ proResProfile, crf, composition, ffmpegExecutable, ffprobeExecutable, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, ...options }: RenderMediaOptions) => Promise<Buffer | null>;
|
|
76
78
|
export {};
|
package/dist/render-media.js
CHANGED
|
@@ -30,6 +30,7 @@ const quality_1 = require("./quality");
|
|
|
30
30
|
const render_frames_1 = require("./render-frames");
|
|
31
31
|
const stitch_frames_to_video_1 = require("./stitch-frames-to-video");
|
|
32
32
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
33
|
+
const validate_ffmpeg_override_1 = require("./validate-ffmpeg-override");
|
|
33
34
|
const validate_output_filename_1 = require("./validate-output-filename");
|
|
34
35
|
const validate_scale_1 = require("./validate-scale");
|
|
35
36
|
const getConcurrency = (others) => {
|
|
@@ -46,7 +47,7 @@ const getConcurrency = (others) => {
|
|
|
46
47
|
* @description Render a video from a composition
|
|
47
48
|
* @link https://www.remotion.dev/docs/renderer/render-media
|
|
48
49
|
*/
|
|
49
|
-
const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprobeExecutable, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ...options }) => {
|
|
50
|
+
const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprobeExecutable, inputProps, pixelFormat, codec, envVariables, frameRange, puppeteerInstance, outputLocation, onProgress, overwrite, onDownload, dumpBrowserLogs, onBrowserLog, onStart, timeoutInMilliseconds, chromiumOptions, scale, browserExecutable, port, cancelSignal, muted, enforceAudioTrack, ffmpegOverride, ...options }) => {
|
|
50
51
|
var _a, _b, _c, _d;
|
|
51
52
|
(0, quality_1.validateQuality)(options.quality);
|
|
52
53
|
if (typeof crf !== 'undefined' && crf !== null) {
|
|
@@ -60,6 +61,7 @@ const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprob
|
|
|
60
61
|
: null;
|
|
61
62
|
(0, validate_scale_1.validateScale)(scale);
|
|
62
63
|
const concurrency = getConcurrency(options);
|
|
64
|
+
(0, validate_ffmpeg_override_1.validateFfmpegOverride)(ffmpegOverride);
|
|
63
65
|
const everyNthFrame = (_a = options.everyNthFrame) !== null && _a !== void 0 ? _a : 1;
|
|
64
66
|
const numberOfGifLoops = (_b = options.numberOfGifLoops) !== null && _b !== void 0 ? _b : null;
|
|
65
67
|
const serveUrl = (0, legacy_webpack_config_1.getServeUrlWithFallback)(options);
|
|
@@ -146,6 +148,7 @@ const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprob
|
|
|
146
148
|
ffmpegExecutable,
|
|
147
149
|
imageFormat,
|
|
148
150
|
signal: cancelPrestitcher.cancelSignal,
|
|
151
|
+
ffmpegOverride,
|
|
149
152
|
});
|
|
150
153
|
stitcherFfmpeg = preStitcher.task;
|
|
151
154
|
}
|
|
@@ -257,6 +260,7 @@ const renderMedia = ({ proResProfile, crf, composition, ffmpegExecutable, ffprob
|
|
|
257
260
|
cancelSignal: cancelStitcher.cancelSignal,
|
|
258
261
|
muted: disableAudio,
|
|
259
262
|
enforceAudioTrack,
|
|
263
|
+
ffmpegOverride,
|
|
260
264
|
}),
|
|
261
265
|
stitchStart,
|
|
262
266
|
]);
|
|
@@ -3,6 +3,7 @@ import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-
|
|
|
3
3
|
import type { RenderAssetInfo } from './assets/download-map';
|
|
4
4
|
import type { Codec } from './codec';
|
|
5
5
|
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
6
|
+
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
6
7
|
import type { ImageFormat } from './image-format';
|
|
7
8
|
import type { CancelSignal } from './make-cancel-signal';
|
|
8
9
|
import type { PixelFormat } from './pixel-format';
|
|
@@ -32,6 +33,7 @@ export declare type StitcherOptions = {
|
|
|
32
33
|
};
|
|
33
34
|
muted?: boolean;
|
|
34
35
|
enforceAudioTrack?: boolean;
|
|
36
|
+
ffmpegOverride?: FfmpegOverrideFn;
|
|
35
37
|
};
|
|
36
38
|
declare type ReturnType = {
|
|
37
39
|
task: Promise<Buffer | null>;
|
|
@@ -116,6 +116,9 @@ const spawnFfmpeg = async (options) => {
|
|
|
116
116
|
if (supportsCrf) {
|
|
117
117
|
console.log('[verbose] crf', crf);
|
|
118
118
|
}
|
|
119
|
+
if (options.ffmpegOverride) {
|
|
120
|
+
console.log('[verbose] ffmpegOverride', options.ffmpegOverride);
|
|
121
|
+
}
|
|
119
122
|
console.log('[verbose] codec', codec);
|
|
120
123
|
console.log('[verbose] shouldRenderAudio', shouldRenderAudio);
|
|
121
124
|
console.log('[verbose] shouldRenderVideo', shouldRenderVideo);
|
|
@@ -233,7 +236,14 @@ const spawnFfmpeg = async (options) => {
|
|
|
233
236
|
console.log(ffmpegArgs);
|
|
234
237
|
}
|
|
235
238
|
const ffmpegString = ffmpegArgs.flat(2).filter(Boolean);
|
|
236
|
-
const
|
|
239
|
+
const finalFfmpegString = options.ffmpegOverride
|
|
240
|
+
? options.ffmpegOverride({ type: 'stitcher', args: ffmpegString })
|
|
241
|
+
: ffmpegString;
|
|
242
|
+
if (options.verbose && options.ffmpegOverride) {
|
|
243
|
+
console.log('Generated final FFMPEG command:');
|
|
244
|
+
console.log(finalFfmpegString);
|
|
245
|
+
}
|
|
246
|
+
const task = (0, execa_1.default)((_t = options.ffmpegExecutable) !== null && _t !== void 0 ? _t : 'ffmpeg', finalFfmpegString, {
|
|
237
247
|
cwd: options.dir,
|
|
238
248
|
});
|
|
239
249
|
(_u = options.cancelSignal) === null || _u === void 0 ? void 0 : _u.call(options, () => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const validateFfmpegArgsHook: (ffmpegArgsHook?:
|
|
1
|
+
import type { FfmpegOverrideFn } from './ffmpeg-override';
|
|
2
|
+
export declare const validateFfmpegArgsHook: (ffmpegArgsHook?: FfmpegOverrideFn) => void;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateFfmpegArgsHook = void 0;
|
|
4
4
|
const validateFfmpegArgsHook = (ffmpegArgsHook) => {
|
|
5
|
+
if (typeof ffmpegArgsHook === 'undefined') {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
5
8
|
if (ffmpegArgsHook && typeof ffmpegArgsHook !== 'function') {
|
|
6
9
|
throw new TypeError(`Argument passed for "ffmpegArgsHook" is not a function: ${ffmpegArgsHook}`);
|
|
7
10
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFfmpegOverride = void 0;
|
|
4
|
+
const validateFfmpegOverride = (ffmpegArgsHook) => {
|
|
5
|
+
if (typeof ffmpegArgsHook === 'undefined') {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (ffmpegArgsHook && typeof ffmpegArgsHook !== 'function') {
|
|
9
|
+
throw new TypeError(`Argument passed for "ffmpegArgsHook" is not a function: ${ffmpegArgsHook}`);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.validateFfmpegOverride = validateFfmpegOverride;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFfmpegOverride = void 0;
|
|
4
|
+
const validateFfmpegOverride = (ffmpegArgsHook) => {
|
|
5
|
+
if (typeof ffmpegArgsHook === 'undefined') {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (ffmpegArgsHook && typeof ffmpegArgsHook !== 'function') {
|
|
9
|
+
throw new TypeError(`Argument passed for "ffmpegArgsHook" is not a function: ${ffmpegArgsHook}`);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
exports.validateFfmpegOverride = validateFfmpegOverride;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.22",
|
|
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.22",
|
|
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": "1c35638566717760bb394e0748b088cea15faff4"
|
|
61
61
|
}
|