@remotion/renderer 4.1.0-alpha4 → 4.1.0-alpha7
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/browser/Browser.js +1 -1
- package/dist/browser/BrowserPage.js +41 -5
- package/dist/browser/Connection.d.ts +9 -3
- package/dist/browser/Connection.js +11 -3
- package/dist/browser/ConsoleMessage.d.ts +8 -1
- package/dist/browser/ConsoleMessage.js +2 -1
- package/dist/browser/ExecutionContext.js +4 -4
- package/dist/browser/FrameManager.js +2 -2
- package/dist/browser/NetworkManager.d.ts +4 -1
- package/dist/browser/devtools-types.d.ts +59 -0
- package/dist/browser/should-log-message.js +6 -0
- package/dist/chalk/index.d.ts +2 -1
- package/dist/chalk/index.js +3 -8
- package/dist/chalk/is-color-supported.d.ts +1 -1
- package/dist/chalk/is-color-supported.js +18 -10
- package/dist/compositor/compose.js +5 -0
- package/dist/compositor/compositor.js +3 -4
- package/dist/create-ffmpeg-merge-filter.js +1 -2
- package/dist/format-logs.js +7 -1
- package/dist/get-compositions.d.ts +3 -3
- package/dist/get-compositions.js +1 -1
- package/dist/index.d.ts +27 -23
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +9 -9
- package/dist/offthread-video-server.js +8 -0
- package/dist/options/crf.js +1 -1
- package/dist/options/video-codec.js +1 -1
- package/dist/puppeteer-evaluate.d.ts +4 -1
- package/dist/puppeteer-evaluate.js +5 -5
- package/dist/render-frames.d.ts +3 -3
- package/dist/render-frames.js +12 -7
- package/dist/render-media.d.ts +3 -3
- package/dist/render-media.js +7 -5
- package/dist/render-still.d.ts +3 -3
- package/dist/render-still.js +5 -6
- package/dist/screenshot-task.js +4 -2
- package/dist/seek-to-frame.d.ts +2 -1
- package/dist/seek-to-frame.js +5 -5
- package/dist/select-composition.d.ts +7 -3
- package/dist/select-composition.js +7 -6
- package/dist/set-props-and-env.js +8 -7
- package/dist/take-frame-and-compose.js +1 -1
- package/package.json +9 -9
- package/dist/assets/get-video-stream-duration.d.ts +0 -9
- package/dist/assets/get-video-stream-duration.js +0 -71
- package/dist/calculate-sar-dar-pixels.d.ts +0 -9
- package/dist/calculate-sar-dar-pixels.js +0 -19
- package/dist/determine-resize-params.d.ts +0 -4
- package/dist/determine-resize-params.js +0 -10
- package/dist/determine-vcodec-ffmpeg-flags.d.ts +0 -2
- package/dist/determine-vcodec-ffmpeg-flags.js +0 -13
- package/dist/ensure-ffmpeg.d.ts +0 -18
- package/dist/ensure-ffmpeg.js +0 -58
- package/dist/ensure-presentation-timestamp.d.ts +0 -15
- package/dist/ensure-presentation-timestamp.js +0 -88
- package/dist/extract-frame-from-video.d.ts +0 -16
- package/dist/extract-frame-from-video.js +0 -191
- package/dist/ffmpeg-executable.d.ts +0 -1
- package/dist/ffmpeg-executable.js +0 -2
- package/dist/ffmpeg-flags.d.ts +0 -31
- package/dist/ffmpeg-flags.js +0 -245
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
- package/dist/frame-to-ffmpeg-timestamp.js +0 -8
- package/dist/get-can-extract-frames-fast.d.ts +0 -14
- package/dist/get-can-extract-frames-fast.js +0 -71
- package/dist/get-frame-of-video-slow.d.ts +0 -17
- package/dist/get-frame-of-video-slow.js +0 -72
- package/dist/get-video-info.d.ts +0 -8
- package/dist/get-video-info.js +0 -59
- package/dist/is-beyond-last-frame.d.ts +0 -3
- package/dist/is-beyond-last-frame.js +0 -12
- package/dist/last-frame-from-video-cache.d.ts +0 -17
- package/dist/last-frame-from-video-cache.js +0 -55
- package/dist/legacy-webpack-config.d.ts +0 -9
- package/dist/legacy-webpack-config.js +0 -13
- package/dist/quality.d.ts +0 -1
- package/dist/quality.js +0 -21
- package/dist/try-to-extract-frame-of-video-fast.d.ts +0 -12
- package/dist/try-to-extract-frame-of-video-fast.js +0 -55
- package/dist/validate-ffmpeg.d.ts +0 -7
- package/dist/validate-ffmpeg.js +0 -77
- package/dist/warn-about-ffmpeg-version.d.ts +0 -5
- package/dist/warn-about-ffmpeg-version.js +0 -37
|
@@ -1,191 +0,0 @@
|
|
|
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.extractFrameFromVideo = exports.getLastFrameOfVideo = void 0;
|
|
7
|
-
const execa_1 = __importDefault(require("execa"));
|
|
8
|
-
const get_video_stream_duration_1 = require("./assets/get-video-stream-duration");
|
|
9
|
-
const determine_resize_params_1 = require("./determine-resize-params");
|
|
10
|
-
const determine_vcodec_ffmpeg_flags_1 = require("./determine-vcodec-ffmpeg-flags");
|
|
11
|
-
const ensure_presentation_timestamp_1 = require("./ensure-presentation-timestamp");
|
|
12
|
-
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
13
|
-
const frame_to_ffmpeg_timestamp_1 = require("./frame-to-ffmpeg-timestamp");
|
|
14
|
-
const get_can_extract_frames_fast_1 = require("./get-can-extract-frames-fast");
|
|
15
|
-
const get_frame_of_video_slow_1 = require("./get-frame-of-video-slow");
|
|
16
|
-
const get_video_info_1 = require("./get-video-info");
|
|
17
|
-
const is_beyond_last_frame_1 = require("./is-beyond-last-frame");
|
|
18
|
-
const last_frame_from_video_cache_1 = require("./last-frame-from-video-cache");
|
|
19
|
-
const p_limit_1 = require("./p-limit");
|
|
20
|
-
const perf_1 = require("./perf");
|
|
21
|
-
const truthy_1 = require("./truthy");
|
|
22
|
-
const try_to_extract_frame_of_video_fast_1 = require("./try-to-extract-frame-of-video-fast");
|
|
23
|
-
const lastFrameLimit = (0, p_limit_1.pLimit)(1);
|
|
24
|
-
const mainLimit = (0, p_limit_1.pLimit)(5);
|
|
25
|
-
const getLastFrameOfVideoFastUnlimited = async (options) => {
|
|
26
|
-
const { ffmpegExecutable, ffprobeExecutable, offset, src, downloadMap } = options;
|
|
27
|
-
const fromCache = (0, last_frame_from_video_cache_1.getLastFrameFromCache)({ ...options, offset: 0 });
|
|
28
|
-
if (fromCache) {
|
|
29
|
-
return fromCache;
|
|
30
|
-
}
|
|
31
|
-
const { duration, fps } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(downloadMap, src, ffprobeExecutable, options.remotionRoot);
|
|
32
|
-
if (duration === null) {
|
|
33
|
-
throw new Error(`Could not determine the duration of ${src} using FFMPEG. The file is not supported.`);
|
|
34
|
-
}
|
|
35
|
-
if (options.specialVCodecForTransparency === 'vp8' ||
|
|
36
|
-
offset > get_can_extract_frames_fast_1.ACCEPTABLE_OFFSET_THRESHOLD) {
|
|
37
|
-
const last = await (0, get_frame_of_video_slow_1.getFrameOfVideoSlow)({
|
|
38
|
-
duration,
|
|
39
|
-
ffmpegExecutable,
|
|
40
|
-
src,
|
|
41
|
-
imageFormat: options.imageFormat,
|
|
42
|
-
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
43
|
-
needsResize: options.needsResize,
|
|
44
|
-
offset: offset - 1000 / (fps === null ? 10 : fps),
|
|
45
|
-
fps,
|
|
46
|
-
remotionRoot: options.remotionRoot,
|
|
47
|
-
});
|
|
48
|
-
return last;
|
|
49
|
-
}
|
|
50
|
-
const actualOffset = `${duration * 1000 - offset}ms`;
|
|
51
|
-
const [stdErr, stdoutBuffer] = await (0, try_to_extract_frame_of_video_fast_1.tryToExtractFrameOfVideoFast)({
|
|
52
|
-
actualOffset,
|
|
53
|
-
ffmpegExecutable,
|
|
54
|
-
imageFormat: options.imageFormat,
|
|
55
|
-
needsResize: options.needsResize,
|
|
56
|
-
remotionRoot: options.remotionRoot,
|
|
57
|
-
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
58
|
-
src,
|
|
59
|
-
});
|
|
60
|
-
const isEmpty = stdErr.includes('Output file is empty');
|
|
61
|
-
if (isEmpty) {
|
|
62
|
-
const unlimited = await getLastFrameOfVideoFastUnlimited({
|
|
63
|
-
ffmpegExecutable,
|
|
64
|
-
// Decrement in 10ms increments, or 1 frame (e.g. fps = 25 --> 40ms)
|
|
65
|
-
offset: offset + (fps === null ? 10 : 1000 / fps),
|
|
66
|
-
src,
|
|
67
|
-
ffprobeExecutable,
|
|
68
|
-
imageFormat: options.imageFormat,
|
|
69
|
-
specialVCodecForTransparency: options.specialVCodecForTransparency,
|
|
70
|
-
needsResize: options.needsResize,
|
|
71
|
-
downloadMap: options.downloadMap,
|
|
72
|
-
remotionRoot: options.remotionRoot,
|
|
73
|
-
});
|
|
74
|
-
return unlimited;
|
|
75
|
-
}
|
|
76
|
-
return stdoutBuffer;
|
|
77
|
-
};
|
|
78
|
-
const getLastFrameOfVideo = async (options) => {
|
|
79
|
-
const result = await lastFrameLimit(getLastFrameOfVideoFastUnlimited, options);
|
|
80
|
-
(0, last_frame_from_video_cache_1.setLastFrameInCache)(options, result);
|
|
81
|
-
return result;
|
|
82
|
-
};
|
|
83
|
-
exports.getLastFrameOfVideo = getLastFrameOfVideo;
|
|
84
|
-
const extractFrameFromVideoFn = async ({ time, ffmpegExecutable, ffprobeExecutable, imageFormat, downloadMap, remotionRoot, ...options }) => {
|
|
85
|
-
// We make a new copy of the video only for video because the conversion may affect
|
|
86
|
-
// audio rendering, so we work with 2 different files
|
|
87
|
-
const src = await (0, ensure_presentation_timestamp_1.ensurePresentationTimestamps)({
|
|
88
|
-
downloadMap,
|
|
89
|
-
src: options.src,
|
|
90
|
-
remotionRoot,
|
|
91
|
-
ffmpegExecutable,
|
|
92
|
-
ffprobeExecutable,
|
|
93
|
-
});
|
|
94
|
-
const { specialVcodecForTransparency: specialVcodec, needsResize } = await (0, get_video_info_1.getVideoInfo)(downloadMap, src, ffprobeExecutable, remotionRoot);
|
|
95
|
-
if (specialVcodec === 'vp8') {
|
|
96
|
-
const { fps } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(downloadMap, src, ffprobeExecutable, remotionRoot);
|
|
97
|
-
return (0, get_frame_of_video_slow_1.getFrameOfVideoSlow)({
|
|
98
|
-
ffmpegExecutable,
|
|
99
|
-
imageFormat,
|
|
100
|
-
specialVCodecForTransparency: specialVcodec,
|
|
101
|
-
src,
|
|
102
|
-
duration: time,
|
|
103
|
-
needsResize,
|
|
104
|
-
offset: 0,
|
|
105
|
-
fps,
|
|
106
|
-
remotionRoot,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
if ((0, is_beyond_last_frame_1.isBeyondLastFrame)(downloadMap, src, time)) {
|
|
110
|
-
const lastFrame = await (0, exports.getLastFrameOfVideo)({
|
|
111
|
-
ffmpegExecutable,
|
|
112
|
-
ffprobeExecutable,
|
|
113
|
-
offset: 0,
|
|
114
|
-
src,
|
|
115
|
-
imageFormat,
|
|
116
|
-
specialVCodecForTransparency: specialVcodec,
|
|
117
|
-
needsResize,
|
|
118
|
-
downloadMap,
|
|
119
|
-
remotionRoot,
|
|
120
|
-
});
|
|
121
|
-
return lastFrame;
|
|
122
|
-
}
|
|
123
|
-
const ffmpegTimestamp = (0, frame_to_ffmpeg_timestamp_1.frameToFfmpegTimestamp)(time);
|
|
124
|
-
const { stdout, stderr } = (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
|
|
125
|
-
'-ss',
|
|
126
|
-
ffmpegTimestamp,
|
|
127
|
-
...(0, determine_vcodec_ffmpeg_flags_1.determineVcodecFfmpegFlags)(specialVcodec),
|
|
128
|
-
'-i',
|
|
129
|
-
src,
|
|
130
|
-
'-frames:v',
|
|
131
|
-
'1',
|
|
132
|
-
'-f',
|
|
133
|
-
'image2pipe',
|
|
134
|
-
'-vcodec',
|
|
135
|
-
imageFormat === 'jpeg' ? 'mjpeg' : 'png',
|
|
136
|
-
...(0, determine_resize_params_1.determineResizeParams)(needsResize),
|
|
137
|
-
'-',
|
|
138
|
-
].filter(truthy_1.truthy), {
|
|
139
|
-
buffer: false,
|
|
140
|
-
});
|
|
141
|
-
if (!stderr) {
|
|
142
|
-
throw new Error('unexpectedly did not get stderr');
|
|
143
|
-
}
|
|
144
|
-
if (!stdout) {
|
|
145
|
-
throw new Error('unexpectedly did not get stdout');
|
|
146
|
-
}
|
|
147
|
-
const stdoutChunks = [];
|
|
148
|
-
const stderrChunks = [];
|
|
149
|
-
const stderrStringProm = new Promise((resolve, reject) => {
|
|
150
|
-
stderr.on('data', (d) => stderrChunks.push(d));
|
|
151
|
-
stderr.on('error', (err) => reject(err));
|
|
152
|
-
stderr.on('end', () => resolve(Buffer.concat(stderrChunks).toString('utf8')));
|
|
153
|
-
});
|
|
154
|
-
const stdoutBuffer = new Promise((resolve, reject) => {
|
|
155
|
-
stdout.on('data', (d) => stdoutChunks.push(d));
|
|
156
|
-
stdout.on('error', (err) => reject(err));
|
|
157
|
-
stdout.on('end', () => resolve(Buffer.concat(stdoutChunks)));
|
|
158
|
-
});
|
|
159
|
-
const [stderrStr, stdOut] = await Promise.all([
|
|
160
|
-
stderrStringProm,
|
|
161
|
-
stdoutBuffer,
|
|
162
|
-
]);
|
|
163
|
-
if (stderrStr.includes('Output file is empty')) {
|
|
164
|
-
(0, is_beyond_last_frame_1.markAsBeyondLastFrame)(downloadMap, src, time);
|
|
165
|
-
const last = await (0, exports.getLastFrameOfVideo)({
|
|
166
|
-
ffmpegExecutable,
|
|
167
|
-
ffprobeExecutable,
|
|
168
|
-
offset: 0,
|
|
169
|
-
src,
|
|
170
|
-
imageFormat,
|
|
171
|
-
specialVCodecForTransparency: specialVcodec,
|
|
172
|
-
needsResize,
|
|
173
|
-
downloadMap,
|
|
174
|
-
remotionRoot,
|
|
175
|
-
});
|
|
176
|
-
return last;
|
|
177
|
-
}
|
|
178
|
-
if (stdOut.length === 0) {
|
|
179
|
-
console.log('FFMPEG Logs:');
|
|
180
|
-
console.log(stderrStr);
|
|
181
|
-
throw new Error("Couldn't extract frame from video - FFMPEG did not return any data. Check logs to see more information");
|
|
182
|
-
}
|
|
183
|
-
return stdOut;
|
|
184
|
-
};
|
|
185
|
-
const extractFrameFromVideo = async (options) => {
|
|
186
|
-
const perf = (0, perf_1.startPerfMeasure)('extract-frame');
|
|
187
|
-
const res = await mainLimit(extractFrameFromVideoFn, options);
|
|
188
|
-
(0, perf_1.stopPerfMeasure)(perf);
|
|
189
|
-
return res;
|
|
190
|
-
};
|
|
191
|
-
exports.extractFrameFromVideo = extractFrameFromVideo;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type FfmpegExecutable = string | null;
|
package/dist/ffmpeg-flags.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
2
|
-
export type FfmpegVersion = [number, number, number] | null;
|
|
3
|
-
export declare const getFfmpegBuildInfo: (options: {
|
|
4
|
-
ffmpegExecutable: string | null;
|
|
5
|
-
remotionRoot: string;
|
|
6
|
-
}) => Promise<string>;
|
|
7
|
-
export declare const ffmpegInNodeModules: (remotionRoot: string, binary: 'ffmpeg' | 'ffprobe') => string | null;
|
|
8
|
-
export declare const ffmpegHasFeature: ({ ffmpegExecutable, feature, remotionRoot, }: {
|
|
9
|
-
ffmpegExecutable: string | null;
|
|
10
|
-
feature: 'enable-gpl' | 'enable-libx265' | 'enable-libvpx';
|
|
11
|
-
remotionRoot: string;
|
|
12
|
-
}) => Promise<boolean>;
|
|
13
|
-
export declare const parseFfmpegVersion: (buildconf: string) => FfmpegVersion;
|
|
14
|
-
export declare const getFfmpegVersion: (options: {
|
|
15
|
-
ffmpegExecutable: string | null;
|
|
16
|
-
remotionRoot: string;
|
|
17
|
-
}) => Promise<FfmpegVersion>;
|
|
18
|
-
export declare const downloadBinary: (remotionRoot: string, url: string, binary: 'ffmpeg' | 'ffprobe') => Promise<string>;
|
|
19
|
-
export declare const lambdaFfmpegPaths: {
|
|
20
|
-
readonly ffmpeg: "/opt/bin/ffmpeg";
|
|
21
|
-
readonly ffprobe: "/opt/bin/ffprobe";
|
|
22
|
-
};
|
|
23
|
-
export declare const getExecutableBinary: (ffmpegExecutable: FfmpegExecutable, remotionRoot: string, binary: 'ffmpeg' | 'ffprobe') => string | Promise<string>;
|
|
24
|
-
export declare const getBinaryDownloadUrl: (binary: 'ffmpeg' | 'ffprobe') => {
|
|
25
|
-
url: string;
|
|
26
|
-
contentLength: number;
|
|
27
|
-
} | null;
|
|
28
|
-
export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
|
|
29
|
-
ffmpegVersion: FfmpegVersion;
|
|
30
|
-
buildConf: string | null;
|
|
31
|
-
}) => null | undefined;
|
package/dist/ffmpeg-flags.js
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
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.warnAboutFfmpegVersion = exports.getBinaryDownloadUrl = exports.getExecutableBinary = exports.lambdaFfmpegPaths = exports.downloadBinary = exports.getFfmpegVersion = exports.parseFfmpegVersion = exports.ffmpegHasFeature = exports.ffmpegInNodeModules = exports.getFfmpegBuildInfo = void 0;
|
|
7
|
-
const execa_1 = __importDefault(require("execa"));
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const os_1 = __importDefault(require("os"));
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const BrowserFetcher_1 = require("./browser/BrowserFetcher");
|
|
12
|
-
const validate_ffmpeg_1 = require("./validate-ffmpeg");
|
|
13
|
-
let buildConfig = null;
|
|
14
|
-
const listeners = {};
|
|
15
|
-
const isDownloading = {};
|
|
16
|
-
const getFfmpegBuildInfo = async (options) => {
|
|
17
|
-
if (buildConfig !== null) {
|
|
18
|
-
return buildConfig;
|
|
19
|
-
}
|
|
20
|
-
const data = await (0, execa_1.default)(await (0, exports.getExecutableBinary)(options.ffmpegExecutable, options.remotionRoot, 'ffmpeg'), ['-buildconf'], {
|
|
21
|
-
reject: false,
|
|
22
|
-
});
|
|
23
|
-
buildConfig = data.stderr;
|
|
24
|
-
return buildConfig;
|
|
25
|
-
};
|
|
26
|
-
exports.getFfmpegBuildInfo = getFfmpegBuildInfo;
|
|
27
|
-
const getFfmpegFolderName = (remotionRoot) => {
|
|
28
|
-
return path_1.default.resolve(remotionRoot, 'node_modules/.ffmpeg');
|
|
29
|
-
};
|
|
30
|
-
const binaryPrefix = { ffmpeg: 'ffmpeg-', ffprobe: 'ffprobe-' };
|
|
31
|
-
const randomFfmpegRuntimeId = String(Math.random()).replace('0.', '');
|
|
32
|
-
const ffmpegInNodeModules = (remotionRoot, binary) => {
|
|
33
|
-
const folderName = getFfmpegFolderName(remotionRoot);
|
|
34
|
-
if (!fs_1.default.existsSync(folderName)) {
|
|
35
|
-
fs_1.default.mkdirSync(folderName, {
|
|
36
|
-
recursive: true,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
// Check if a version of FFMPEG is already installed.
|
|
40
|
-
// To qualify, it must have the expected file size
|
|
41
|
-
// to avoid finding binaries that are still being downloaded
|
|
42
|
-
// A random ID is being assigned to the download to avoid conflicts when multiple Remotion processes are running
|
|
43
|
-
const ffmpegInstalled = fs_1.default.readdirSync(folderName).find((filename) => {
|
|
44
|
-
if (!filename.startsWith(binaryPrefix[binary])) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
const dlUrl = (0, exports.getBinaryDownloadUrl)(binary);
|
|
48
|
-
if (!dlUrl) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
const expectedLength = dlUrl.contentLength;
|
|
52
|
-
if (fs_1.default.statSync(path_1.default.join(folderName, filename)).size === expectedLength) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
});
|
|
57
|
-
if (ffmpegInstalled) {
|
|
58
|
-
return path_1.default.join(folderName, ffmpegInstalled);
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
};
|
|
62
|
-
exports.ffmpegInNodeModules = ffmpegInNodeModules;
|
|
63
|
-
const getFfmpegAbsolutePath = (remotionRoot, binary) => {
|
|
64
|
-
const folderName = getFfmpegFolderName(remotionRoot);
|
|
65
|
-
if (!fs_1.default.existsSync(folderName)) {
|
|
66
|
-
fs_1.default.mkdirSync(folderName);
|
|
67
|
-
}
|
|
68
|
-
if (os_1.default.platform() === 'win32') {
|
|
69
|
-
return path_1.default.resolve(folderName, `${binaryPrefix[binary]}${randomFfmpegRuntimeId}.exe`);
|
|
70
|
-
}
|
|
71
|
-
return path_1.default.resolve(folderName, `${binaryPrefix[binary]}${randomFfmpegRuntimeId}`);
|
|
72
|
-
};
|
|
73
|
-
const ffmpegHasFeature = async ({ ffmpegExecutable, feature, remotionRoot, }) => {
|
|
74
|
-
if (ffmpegExecutable && !(0, validate_ffmpeg_1.customExecutableExists)(ffmpegExecutable)) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
if (!(0, validate_ffmpeg_1.binaryExists)('ffmpeg')) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
const config = await (0, exports.getFfmpegBuildInfo)({ ffmpegExecutable, remotionRoot });
|
|
81
|
-
return config.includes(feature);
|
|
82
|
-
};
|
|
83
|
-
exports.ffmpegHasFeature = ffmpegHasFeature;
|
|
84
|
-
const parseFfmpegVersion = (buildconf) => {
|
|
85
|
-
var _a;
|
|
86
|
-
const match = buildconf.match(/ffmpeg version ([0-9]+).([0-9]+)(?:.([0-9]+))?/);
|
|
87
|
-
if (!match) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
return [Number(match[1]), Number(match[2]), Number((_a = match[3]) !== null && _a !== void 0 ? _a : 0)];
|
|
91
|
-
};
|
|
92
|
-
exports.parseFfmpegVersion = parseFfmpegVersion;
|
|
93
|
-
const getFfmpegVersion = async (options) => {
|
|
94
|
-
const buildInfo = await (0, exports.getFfmpegBuildInfo)({
|
|
95
|
-
ffmpegExecutable: options.ffmpegExecutable,
|
|
96
|
-
remotionRoot: options.remotionRoot,
|
|
97
|
-
});
|
|
98
|
-
return (0, exports.parseFfmpegVersion)(buildInfo);
|
|
99
|
-
};
|
|
100
|
-
exports.getFfmpegVersion = getFfmpegVersion;
|
|
101
|
-
const waitForFfmpegToBeDownloaded = (url) => {
|
|
102
|
-
return new Promise((resolve) => {
|
|
103
|
-
if (!listeners[url]) {
|
|
104
|
-
listeners[url] = [];
|
|
105
|
-
}
|
|
106
|
-
listeners[url].push((src) => resolve(src));
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
const onProgress = (downloadedBytes, totalBytesToDownload, binary) => {
|
|
110
|
-
console.log('Downloading ', binary, `${toMegabytes(downloadedBytes)}/${toMegabytes(totalBytesToDownload)}`);
|
|
111
|
-
};
|
|
112
|
-
const downloadBinary = async (remotionRoot, url, binary) => {
|
|
113
|
-
const destinationPath = getFfmpegAbsolutePath(remotionRoot, binary);
|
|
114
|
-
const onProgressCallback = (downloadedBytes, _totalBytes) => {
|
|
115
|
-
onProgress(downloadedBytes, _totalBytes, binary);
|
|
116
|
-
};
|
|
117
|
-
isDownloading[url] = true;
|
|
118
|
-
const totalBytes = await (0, BrowserFetcher_1._downloadFile)(url, destinationPath, onProgressCallback);
|
|
119
|
-
onProgress(totalBytes, totalBytes, binary);
|
|
120
|
-
if (os_1.default.platform() !== 'win32') {
|
|
121
|
-
fs_1.default.chmodSync(destinationPath, '777');
|
|
122
|
-
}
|
|
123
|
-
isDownloading[url] = false;
|
|
124
|
-
if (!listeners[url]) {
|
|
125
|
-
listeners[url] = [];
|
|
126
|
-
}
|
|
127
|
-
listeners[url].forEach((listener) => listener(destinationPath));
|
|
128
|
-
listeners[url] = [];
|
|
129
|
-
return destinationPath;
|
|
130
|
-
};
|
|
131
|
-
exports.downloadBinary = downloadBinary;
|
|
132
|
-
exports.lambdaFfmpegPaths = {
|
|
133
|
-
ffmpeg: '/opt/bin/ffmpeg',
|
|
134
|
-
ffprobe: '/opt/bin/ffprobe',
|
|
135
|
-
};
|
|
136
|
-
const getExecutableBinary = (ffmpegExecutable, remotionRoot, binary) => {
|
|
137
|
-
if (fs_1.default.existsSync(exports.lambdaFfmpegPaths[binary])) {
|
|
138
|
-
return exports.lambdaFfmpegPaths[binary];
|
|
139
|
-
}
|
|
140
|
-
if (ffmpegExecutable && (0, validate_ffmpeg_1.customExecutableExists)(ffmpegExecutable)) {
|
|
141
|
-
return ffmpegExecutable;
|
|
142
|
-
}
|
|
143
|
-
if ((0, validate_ffmpeg_1.binaryExists)(binary)) {
|
|
144
|
-
return binary;
|
|
145
|
-
}
|
|
146
|
-
const dlUrl = (0, exports.getBinaryDownloadUrl)(binary);
|
|
147
|
-
if (dlUrl && isDownloading[dlUrl.url]) {
|
|
148
|
-
return waitForFfmpegToBeDownloaded(dlUrl.url);
|
|
149
|
-
}
|
|
150
|
-
const inNodeMod = (0, exports.ffmpegInNodeModules)(remotionRoot, binary);
|
|
151
|
-
if (inNodeMod) {
|
|
152
|
-
return inNodeMod;
|
|
153
|
-
}
|
|
154
|
-
if (!dlUrl) {
|
|
155
|
-
throw new Error(`${binary} could not be installed automatically. Your architecture and OS combination (os = ${os_1.default.platform()}, arch = ${process.arch}) is not supported. Please install ${binary} manually and add "${binary}" to your PATH.`);
|
|
156
|
-
}
|
|
157
|
-
return (0, exports.downloadBinary)(remotionRoot, dlUrl.url, binary);
|
|
158
|
-
};
|
|
159
|
-
exports.getExecutableBinary = getExecutableBinary;
|
|
160
|
-
function toMegabytes(bytes) {
|
|
161
|
-
const mb = bytes / 1024 / 1024;
|
|
162
|
-
return `${Math.round(mb * 10) / 10} Mb`;
|
|
163
|
-
}
|
|
164
|
-
const getBinaryDownloadUrl = (binary) => {
|
|
165
|
-
if (os_1.default.platform() === 'win32' && process.arch === 'x64') {
|
|
166
|
-
return binary === 'ffmpeg'
|
|
167
|
-
? {
|
|
168
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffmpeg-win-x86.exe',
|
|
169
|
-
contentLength: 127531008,
|
|
170
|
-
}
|
|
171
|
-
: {
|
|
172
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffprobe-win-x86.exe',
|
|
173
|
-
contentLength: 127425536,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
if (os_1.default.platform() === 'darwin' && process.arch === 'arm64') {
|
|
177
|
-
return binary === 'ffmpeg'
|
|
178
|
-
? {
|
|
179
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffmpeg-macos-arm64',
|
|
180
|
-
contentLength: 42093320,
|
|
181
|
-
}
|
|
182
|
-
: {
|
|
183
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffprobe-macos-arm64-v2',
|
|
184
|
-
contentLength: 46690008,
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
if (os_1.default.platform() === 'darwin' && process.arch === 'x64') {
|
|
188
|
-
return binary === 'ffmpeg'
|
|
189
|
-
? {
|
|
190
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffmpeg-macos-x86',
|
|
191
|
-
contentLength: 78380700,
|
|
192
|
-
}
|
|
193
|
-
: {
|
|
194
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffprobe-macos-x86',
|
|
195
|
-
contentLength: 77364284,
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
if (os_1.default.platform() === 'linux' && process.arch === 'x64') {
|
|
199
|
-
return binary === 'ffmpeg'
|
|
200
|
-
? {
|
|
201
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffmpeg-linux-amd64',
|
|
202
|
-
contentLength: 78502560,
|
|
203
|
-
}
|
|
204
|
-
: {
|
|
205
|
-
url: 'https://remotion-ffmpeg-binaries.s3.eu-central-1.amazonaws.com/ffprobe-linux-amd64',
|
|
206
|
-
contentLength: 78400704,
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
return null;
|
|
210
|
-
};
|
|
211
|
-
exports.getBinaryDownloadUrl = getBinaryDownloadUrl;
|
|
212
|
-
const printMessage = (ffmpegVersion) => {
|
|
213
|
-
console.warn('⚠️Old FFMPEG version detected: ' + ffmpegVersion.join('.'));
|
|
214
|
-
console.warn(' You need at least version 4.1.0.');
|
|
215
|
-
console.warn(' Upgrade FFMPEG to get rid of this warning.');
|
|
216
|
-
};
|
|
217
|
-
const printBuildConfMessage = () => {
|
|
218
|
-
console.error('⚠️ Unsupported FFMPEG version detected.');
|
|
219
|
-
console.error(" Your version doesn't support the -buildconf flag");
|
|
220
|
-
console.error(' Audio will not be supported and you may experience other issues.');
|
|
221
|
-
console.error(' Upgrade FFMPEG to at least v4.1.0 to get rid of this warning.');
|
|
222
|
-
};
|
|
223
|
-
const warnAboutFfmpegVersion = ({ ffmpegVersion, buildConf, }) => {
|
|
224
|
-
if (buildConf === null) {
|
|
225
|
-
printBuildConfMessage();
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
if (ffmpegVersion === null) {
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
const [major, minor] = ffmpegVersion;
|
|
232
|
-
// 3.x and below definitely is too old
|
|
233
|
-
if (major < 4) {
|
|
234
|
-
printMessage(ffmpegVersion);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
// 5.x will be all good
|
|
238
|
-
if (major > 4) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
if (minor < 1) {
|
|
242
|
-
printMessage(ffmpegVersion);
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
exports.warnAboutFfmpegVersion = warnAboutFfmpegVersion;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const frameToFfmpegTimestamp: (time: number) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.frameToFfmpegTimestamp = void 0;
|
|
4
|
-
const frameToFfmpegTimestamp = (time) => {
|
|
5
|
-
// We ceil because FFMPEG seeks to the closest frame BEFORE the position
|
|
6
|
-
return (Math.ceil(time * 1000000) / 1000).toFixed(3) + 'ms';
|
|
7
|
-
};
|
|
8
|
-
exports.frameToFfmpegTimestamp = frameToFfmpegTimestamp;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
2
|
-
export declare const ACCEPTABLE_OFFSET_THRESHOLD = 50;
|
|
3
|
-
/**
|
|
4
|
-
* @description Probes whether frames of a video can be efficiently extracted when using <OffthreadVideo>.
|
|
5
|
-
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-can-extract-frames-fast)
|
|
6
|
-
*/
|
|
7
|
-
export declare const getCanExtractFramesFast: ({ src, ffmpegExecutable, ffprobeExecutable, }: {
|
|
8
|
-
src: string;
|
|
9
|
-
ffmpegExecutable?: FfmpegExecutable | undefined;
|
|
10
|
-
ffprobeExecutable?: FfmpegExecutable | undefined;
|
|
11
|
-
}) => Promise<{
|
|
12
|
-
canExtractFramesFast: boolean;
|
|
13
|
-
shouldReencode: boolean;
|
|
14
|
-
}>;
|
|
@@ -1,71 +0,0 @@
|
|
|
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.getCanExtractFramesFast = exports.ACCEPTABLE_OFFSET_THRESHOLD = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const get_video_stream_duration_1 = require("./assets/get-video-stream-duration");
|
|
9
|
-
const ensure_presentation_timestamp_1 = require("./ensure-presentation-timestamp");
|
|
10
|
-
const find_closest_package_json_1 = require("./find-closest-package-json");
|
|
11
|
-
const get_video_info_1 = require("./get-video-info");
|
|
12
|
-
const try_to_extract_frame_of_video_fast_1 = require("./try-to-extract-frame-of-video-fast");
|
|
13
|
-
exports.ACCEPTABLE_OFFSET_THRESHOLD = 50;
|
|
14
|
-
/**
|
|
15
|
-
* @description Probes whether frames of a video can be efficiently extracted when using <OffthreadVideo>.
|
|
16
|
-
* @see [Documentation](https://www.remotion.dev/docs/renderer/get-can-extract-frames-fast)
|
|
17
|
-
*/
|
|
18
|
-
const getCanExtractFramesFast = async ({ src, ffmpegExecutable, ffprobeExecutable, }) => {
|
|
19
|
-
const remotionRoot = (0, find_closest_package_json_1.findRemotionRoot)();
|
|
20
|
-
const out = await (0, ensure_presentation_timestamp_1.ensurePresentationTimestampWithoutCache)({
|
|
21
|
-
ffmpegExecutable: ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : null,
|
|
22
|
-
ffprobeExecutable: ffprobeExecutable !== null && ffprobeExecutable !== void 0 ? ffprobeExecutable : null,
|
|
23
|
-
remotionRoot,
|
|
24
|
-
src,
|
|
25
|
-
});
|
|
26
|
-
const { specialVcodecForTransparency: specialVcodec } = await (0, get_video_info_1.getVideoInfoUncached)({
|
|
27
|
-
src: out,
|
|
28
|
-
ffprobeExecutable: ffprobeExecutable !== null && ffprobeExecutable !== void 0 ? ffprobeExecutable : null,
|
|
29
|
-
remotionRoot,
|
|
30
|
-
});
|
|
31
|
-
if (specialVcodec === 'vp8') {
|
|
32
|
-
fs_1.default.unlinkSync(out);
|
|
33
|
-
return {
|
|
34
|
-
canExtractFramesFast: false,
|
|
35
|
-
shouldReencode: false,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const { duration } = await (0, get_video_stream_duration_1.getVideoStreamDurationwithoutCache)({
|
|
39
|
-
ffprobeExecutable: ffprobeExecutable !== null && ffprobeExecutable !== void 0 ? ffprobeExecutable : null,
|
|
40
|
-
remotionRoot,
|
|
41
|
-
src: out,
|
|
42
|
-
});
|
|
43
|
-
if (duration === null) {
|
|
44
|
-
fs_1.default.unlinkSync(out);
|
|
45
|
-
throw new Error(`Could not determine the duration of ${src} using FFMPEG. The file is not supported.`);
|
|
46
|
-
}
|
|
47
|
-
const actualOffset = `${duration * 1000 - exports.ACCEPTABLE_OFFSET_THRESHOLD}ms`;
|
|
48
|
-
const [stdErr] = await (0, try_to_extract_frame_of_video_fast_1.tryToExtractFrameOfVideoFast)({
|
|
49
|
-
actualOffset,
|
|
50
|
-
ffmpegExecutable: ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : null,
|
|
51
|
-
imageFormat: 'jpeg',
|
|
52
|
-
// Intentionally leaving needsResize as null, because we don't need to resize
|
|
53
|
-
needsResize: null,
|
|
54
|
-
remotionRoot,
|
|
55
|
-
specialVCodecForTransparency: specialVcodec,
|
|
56
|
-
src: out,
|
|
57
|
-
});
|
|
58
|
-
fs_1.default.unlinkSync(out);
|
|
59
|
-
const isEmpty = stdErr.includes('Output file is empty');
|
|
60
|
-
if (isEmpty) {
|
|
61
|
-
return {
|
|
62
|
-
canExtractFramesFast: false,
|
|
63
|
-
shouldReencode: true,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
canExtractFramesFast: true,
|
|
68
|
-
shouldReencode: false,
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
exports.getCanExtractFramesFast = getCanExtractFramesFast;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { OffthreadVideoImageFormat } from 'remotion';
|
|
2
|
-
import type { SpecialVCodecForTransparency } from './assets/download-map';
|
|
3
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
4
|
-
export declare const getFrameOfVideoSlow: ({ src, duration, ffmpegExecutable, imageFormat, specialVCodecForTransparency, needsResize, offset, fps, remotionRoot, }: {
|
|
5
|
-
ffmpegExecutable: FfmpegExecutable;
|
|
6
|
-
src: string;
|
|
7
|
-
duration: number;
|
|
8
|
-
imageFormat: OffthreadVideoImageFormat;
|
|
9
|
-
specialVCodecForTransparency: SpecialVCodecForTransparency;
|
|
10
|
-
needsResize: [
|
|
11
|
-
number,
|
|
12
|
-
number
|
|
13
|
-
] | null;
|
|
14
|
-
offset: number;
|
|
15
|
-
fps: number | null;
|
|
16
|
-
remotionRoot: string;
|
|
17
|
-
}) => Promise<Buffer>;
|
|
@@ -1,72 +0,0 @@
|
|
|
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.getFrameOfVideoSlow = void 0;
|
|
7
|
-
// Uses no seeking, therefore the whole video has to be decoded. This is a last resort and should only happen
|
|
8
|
-
// if the video is corrupted
|
|
9
|
-
const execa_1 = __importDefault(require("execa"));
|
|
10
|
-
const determine_resize_params_1 = require("./determine-resize-params");
|
|
11
|
-
const determine_vcodec_ffmpeg_flags_1 = require("./determine-vcodec-ffmpeg-flags");
|
|
12
|
-
const ffmpeg_flags_1 = require("./ffmpeg-flags");
|
|
13
|
-
const truthy_1 = require("./truthy");
|
|
14
|
-
const getFrameOfVideoSlow = async ({ src, duration, ffmpegExecutable, imageFormat, specialVCodecForTransparency, needsResize, offset, fps, remotionRoot, }) => {
|
|
15
|
-
console.warn(`\nUsing a slow method to extract the frame at ${duration}ms of ${src}. See https://remotion.dev/docs/slow-method-to-extract-frame for advice`);
|
|
16
|
-
const actualOffset = `-${duration * 1000 - offset}ms`;
|
|
17
|
-
const command = [
|
|
18
|
-
'-itsoffset',
|
|
19
|
-
actualOffset,
|
|
20
|
-
...(0, determine_vcodec_ffmpeg_flags_1.determineVcodecFfmpegFlags)(specialVCodecForTransparency),
|
|
21
|
-
'-i',
|
|
22
|
-
src,
|
|
23
|
-
'-frames:v',
|
|
24
|
-
'1',
|
|
25
|
-
'-c:v',
|
|
26
|
-
imageFormat === 'jpeg' ? 'mjpeg' : 'png',
|
|
27
|
-
'-f',
|
|
28
|
-
'image2pipe',
|
|
29
|
-
...(0, determine_resize_params_1.determineResizeParams)(needsResize),
|
|
30
|
-
'-',
|
|
31
|
-
].filter(truthy_1.truthy);
|
|
32
|
-
const { stdout, stderr } = (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), command);
|
|
33
|
-
if (!stderr) {
|
|
34
|
-
throw new Error('unexpectedly did not get stderr');
|
|
35
|
-
}
|
|
36
|
-
if (!stdout) {
|
|
37
|
-
throw new Error('unexpectedly did not get stdout');
|
|
38
|
-
}
|
|
39
|
-
const stderrChunks = [];
|
|
40
|
-
const stdoutChunks = [];
|
|
41
|
-
const stdErrString = new Promise((resolve, reject) => {
|
|
42
|
-
stderr.on('data', (d) => stderrChunks.push(d));
|
|
43
|
-
stderr.on('error', (err) => reject(err));
|
|
44
|
-
stderr.on('end', () => resolve(Buffer.concat(stderrChunks).toString('utf-8')));
|
|
45
|
-
});
|
|
46
|
-
const stdoutChunk = new Promise((resolve, reject) => {
|
|
47
|
-
stdout.on('data', (d) => stdoutChunks.push(d));
|
|
48
|
-
stdout.on('error', (err) => reject(err));
|
|
49
|
-
stdout.on('end', () => resolve(Buffer.concat(stdoutChunks)));
|
|
50
|
-
});
|
|
51
|
-
const [stdErr, stdoutBuffer] = await Promise.all([stdErrString, stdoutChunk]);
|
|
52
|
-
const isEmpty = stdErr.includes('Output file is empty');
|
|
53
|
-
if (isEmpty) {
|
|
54
|
-
if (offset > 70) {
|
|
55
|
-
throw new Error(`Could not get last frame of ${src}. Tried to seek to the end using the command "ffmpeg ${command.join(' ')}" but got no frame. Most likely this video is corrupted.`);
|
|
56
|
-
}
|
|
57
|
-
return (0, exports.getFrameOfVideoSlow)({
|
|
58
|
-
ffmpegExecutable,
|
|
59
|
-
duration,
|
|
60
|
-
// Decrement in 10ms increments, or 1 frame (e.g. fps = 25 --> 40ms)
|
|
61
|
-
offset: offset + (fps === null ? 10 : 1000 / fps),
|
|
62
|
-
src,
|
|
63
|
-
imageFormat,
|
|
64
|
-
specialVCodecForTransparency,
|
|
65
|
-
needsResize,
|
|
66
|
-
fps,
|
|
67
|
-
remotionRoot,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return stdoutBuffer;
|
|
71
|
-
};
|
|
72
|
-
exports.getFrameOfVideoSlow = getFrameOfVideoSlow;
|
package/dist/get-video-info.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { DownloadMap, Vp9Result } from './assets/download-map';
|
|
2
|
-
import type { FfmpegExecutable } from './ffmpeg-executable';
|
|
3
|
-
export declare function getVideoInfoUncached({ src, ffprobeExecutable, remotionRoot, }: {
|
|
4
|
-
src: string;
|
|
5
|
-
ffprobeExecutable: FfmpegExecutable;
|
|
6
|
-
remotionRoot: string;
|
|
7
|
-
}): Promise<Vp9Result>;
|
|
8
|
-
export declare const getVideoInfo: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable, remotionRoot: string) => Promise<Vp9Result>;
|