@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.
Files changed (83) hide show
  1. package/dist/browser/Browser.js +1 -1
  2. package/dist/browser/BrowserPage.js +41 -5
  3. package/dist/browser/Connection.d.ts +9 -3
  4. package/dist/browser/Connection.js +11 -3
  5. package/dist/browser/ConsoleMessage.d.ts +8 -1
  6. package/dist/browser/ConsoleMessage.js +2 -1
  7. package/dist/browser/ExecutionContext.js +4 -4
  8. package/dist/browser/FrameManager.js +2 -2
  9. package/dist/browser/NetworkManager.d.ts +4 -1
  10. package/dist/browser/devtools-types.d.ts +59 -0
  11. package/dist/browser/should-log-message.js +6 -0
  12. package/dist/chalk/index.d.ts +2 -1
  13. package/dist/chalk/index.js +3 -8
  14. package/dist/chalk/is-color-supported.d.ts +1 -1
  15. package/dist/chalk/is-color-supported.js +18 -10
  16. package/dist/compositor/compose.js +5 -0
  17. package/dist/compositor/compositor.js +3 -4
  18. package/dist/create-ffmpeg-merge-filter.js +1 -2
  19. package/dist/format-logs.js +7 -1
  20. package/dist/get-compositions.d.ts +3 -3
  21. package/dist/get-compositions.js +1 -1
  22. package/dist/index.d.ts +27 -23
  23. package/dist/logger.d.ts +1 -1
  24. package/dist/logger.js +9 -9
  25. package/dist/offthread-video-server.js +8 -0
  26. package/dist/options/crf.js +1 -1
  27. package/dist/options/video-codec.js +1 -1
  28. package/dist/puppeteer-evaluate.d.ts +4 -1
  29. package/dist/puppeteer-evaluate.js +5 -5
  30. package/dist/render-frames.d.ts +3 -3
  31. package/dist/render-frames.js +12 -7
  32. package/dist/render-media.d.ts +3 -3
  33. package/dist/render-media.js +7 -5
  34. package/dist/render-still.d.ts +3 -3
  35. package/dist/render-still.js +5 -6
  36. package/dist/screenshot-task.js +4 -2
  37. package/dist/seek-to-frame.d.ts +2 -1
  38. package/dist/seek-to-frame.js +5 -5
  39. package/dist/select-composition.d.ts +7 -3
  40. package/dist/select-composition.js +7 -6
  41. package/dist/set-props-and-env.js +8 -7
  42. package/dist/take-frame-and-compose.js +1 -1
  43. package/package.json +9 -9
  44. package/dist/assets/get-video-stream-duration.d.ts +0 -9
  45. package/dist/assets/get-video-stream-duration.js +0 -71
  46. package/dist/calculate-sar-dar-pixels.d.ts +0 -9
  47. package/dist/calculate-sar-dar-pixels.js +0 -19
  48. package/dist/determine-resize-params.d.ts +0 -4
  49. package/dist/determine-resize-params.js +0 -10
  50. package/dist/determine-vcodec-ffmpeg-flags.d.ts +0 -2
  51. package/dist/determine-vcodec-ffmpeg-flags.js +0 -13
  52. package/dist/ensure-ffmpeg.d.ts +0 -18
  53. package/dist/ensure-ffmpeg.js +0 -58
  54. package/dist/ensure-presentation-timestamp.d.ts +0 -15
  55. package/dist/ensure-presentation-timestamp.js +0 -88
  56. package/dist/extract-frame-from-video.d.ts +0 -16
  57. package/dist/extract-frame-from-video.js +0 -191
  58. package/dist/ffmpeg-executable.d.ts +0 -1
  59. package/dist/ffmpeg-executable.js +0 -2
  60. package/dist/ffmpeg-flags.d.ts +0 -31
  61. package/dist/ffmpeg-flags.js +0 -245
  62. package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
  63. package/dist/frame-to-ffmpeg-timestamp.js +0 -8
  64. package/dist/get-can-extract-frames-fast.d.ts +0 -14
  65. package/dist/get-can-extract-frames-fast.js +0 -71
  66. package/dist/get-frame-of-video-slow.d.ts +0 -17
  67. package/dist/get-frame-of-video-slow.js +0 -72
  68. package/dist/get-video-info.d.ts +0 -8
  69. package/dist/get-video-info.js +0 -59
  70. package/dist/is-beyond-last-frame.d.ts +0 -3
  71. package/dist/is-beyond-last-frame.js +0 -12
  72. package/dist/last-frame-from-video-cache.d.ts +0 -17
  73. package/dist/last-frame-from-video-cache.js +0 -55
  74. package/dist/legacy-webpack-config.d.ts +0 -9
  75. package/dist/legacy-webpack-config.js +0 -13
  76. package/dist/quality.d.ts +0 -1
  77. package/dist/quality.js +0 -21
  78. package/dist/try-to-extract-frame-of-video-fast.d.ts +0 -12
  79. package/dist/try-to-extract-frame-of-video-fast.js +0 -55
  80. package/dist/validate-ffmpeg.d.ts +0 -7
  81. package/dist/validate-ffmpeg.js +0 -77
  82. package/dist/warn-about-ffmpeg-version.d.ts +0 -5
  83. package/dist/warn-about-ffmpeg-version.js +0 -37
@@ -1,59 +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.getVideoInfo = exports.getVideoInfoUncached = void 0;
7
- const execa_1 = __importDefault(require("execa"));
8
- const calculate_sar_dar_pixels_1 = require("./calculate-sar-dar-pixels");
9
- const ffmpeg_flags_1 = require("./ffmpeg-flags");
10
- const p_limit_1 = require("./p-limit");
11
- const limit = (0, p_limit_1.pLimit)(1);
12
- async function getVideoInfoUncached({ src, ffprobeExecutable, remotionRoot, }) {
13
- var _a;
14
- const task = await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffprobeExecutable, remotionRoot, 'ffprobe'), [src]);
15
- const isVp9 = task.stderr.includes('Video: vp9');
16
- const isVp8 = task.stderr.includes('Video: vp8');
17
- const dimensions = (_a = task.stderr
18
- .split('\n')
19
- .find((n) => n.trim().startsWith('Stream #'))) === null || _a === void 0 ? void 0 : _a.match(/([0-9]{2,6})x([0-9]{2,6})/);
20
- const dar = task.stderr.match(/DAR\s([0-9]+):([0-9]+)/);
21
- let needsResize = null;
22
- if (dimensions && dar) {
23
- const width = parseInt(dimensions[1], 10);
24
- const height = parseInt(dimensions[2], 10);
25
- const darWidth = parseInt(dar[1], 10);
26
- const darHeight = parseInt(dar[2], 10);
27
- const { width: actualWidth, height: actualHeight } = (0, calculate_sar_dar_pixels_1.calculateDisplayVideoSize)({
28
- darX: darWidth,
29
- darY: darHeight,
30
- x: width,
31
- y: height,
32
- });
33
- if (actualWidth !== width || actualHeight !== height) {
34
- needsResize = [actualWidth, actualHeight];
35
- }
36
- }
37
- const result = {
38
- specialVcodecForTransparency: isVp9 ? 'vp9' : isVp8 ? 'vp8' : 'none',
39
- needsResize,
40
- };
41
- return result;
42
- }
43
- exports.getVideoInfoUncached = getVideoInfoUncached;
44
- async function getVideoInfoUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot) {
45
- if (typeof downloadMap.isVp9VideoCache[src] !== 'undefined') {
46
- return downloadMap.isVp9VideoCache[src];
47
- }
48
- const result = await getVideoInfoUncached({
49
- ffprobeExecutable,
50
- remotionRoot,
51
- src,
52
- });
53
- downloadMap.isVp9VideoCache[src] = result;
54
- return downloadMap.isVp9VideoCache[src];
55
- }
56
- const getVideoInfo = (downloadMap, src, ffprobeExecutable, remotionRoot) => {
57
- return limit(() => getVideoInfoUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot));
58
- };
59
- exports.getVideoInfo = getVideoInfo;
@@ -1,3 +0,0 @@
1
- import type { DownloadMap } from './assets/download-map';
2
- export declare const isBeyondLastFrame: (downloadMap: DownloadMap, src: string, time: number) => boolean | 0;
3
- export declare const markAsBeyondLastFrame: (downloadMap: DownloadMap, src: string, time: number) => void;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.markAsBeyondLastFrame = exports.isBeyondLastFrame = void 0;
4
- const isBeyondLastFrame = (downloadMap, src, time) => {
5
- return (downloadMap.isBeyondLastFrameMap[src] &&
6
- time >= downloadMap.isBeyondLastFrameMap[src]);
7
- };
8
- exports.isBeyondLastFrame = isBeyondLastFrame;
9
- const markAsBeyondLastFrame = (downloadMap, src, time) => {
10
- downloadMap.isBeyondLastFrameMap[src] = time;
11
- };
12
- exports.markAsBeyondLastFrame = markAsBeyondLastFrame;
@@ -1,17 +0,0 @@
1
- import type { OffthreadVideoImageFormat } from 'remotion';
2
- import type { DownloadMap, SpecialVCodecForTransparency } from './assets/download-map';
3
- import type { FfmpegExecutable } from './ffmpeg-executable';
4
- export type LastFrameOptions = {
5
- ffmpegExecutable: FfmpegExecutable;
6
- ffprobeExecutable: FfmpegExecutable;
7
- offset: number;
8
- src: string;
9
- specialVCodecForTransparency: SpecialVCodecForTransparency;
10
- imageFormat: OffthreadVideoImageFormat;
11
- needsResize: [number, number] | null;
12
- downloadMap: DownloadMap;
13
- remotionRoot: string;
14
- };
15
- export declare const setLastFrameInCache: (options: LastFrameOptions, data: Buffer) => void;
16
- export declare const getLastFrameFromCache: (options: LastFrameOptions) => Buffer | null;
17
- export declare const clearLastFileCache: (downloadMap: DownloadMap) => void;
@@ -1,55 +0,0 @@
1
- "use strict";
2
- // OffthreadVideo requires sometimes that the last frame of a video gets extracted, however, this can be slow. We allocate a cache for it but that can be garbage collected
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearLastFileCache = exports.getLastFrameFromCache = exports.setLastFrameInCache = void 0;
5
- const MAX_CACHE_SIZE = 50 * 1024 * 1024; // 50MB
6
- let bufferSize = 0;
7
- const makeLastFrameCacheKey = (options) => {
8
- return [
9
- options.ffmpegExecutable,
10
- options.offset,
11
- options.src,
12
- options.imageFormat,
13
- options.downloadMap.id,
14
- ].join('-');
15
- };
16
- const setLastFrameInCache = (options, data) => {
17
- const key = makeLastFrameCacheKey(options);
18
- if (options.downloadMap.lastFrameMap[key]) {
19
- bufferSize -= options.downloadMap.lastFrameMap[key].data.byteLength;
20
- }
21
- options.downloadMap.lastFrameMap[key] = { data, lastAccessed: Date.now() };
22
- bufferSize += data.byteLength;
23
- ensureMaxSize(options.downloadMap);
24
- };
25
- exports.setLastFrameInCache = setLastFrameInCache;
26
- const getLastFrameFromCache = (options) => {
27
- var _a;
28
- const key = makeLastFrameCacheKey(options);
29
- if (!options.downloadMap.lastFrameMap[key]) {
30
- return null;
31
- }
32
- options.downloadMap.lastFrameMap[key].lastAccessed = Date.now();
33
- return (_a = options.downloadMap.lastFrameMap[key].data) !== null && _a !== void 0 ? _a : null;
34
- };
35
- exports.getLastFrameFromCache = getLastFrameFromCache;
36
- const removedLastFrameFromCache = (key, downloadMap) => {
37
- if (!downloadMap.lastFrameMap[key]) {
38
- return;
39
- }
40
- bufferSize -= downloadMap.lastFrameMap[key].data.byteLength;
41
- delete downloadMap.lastFrameMap[key];
42
- };
43
- const ensureMaxSize = (downloadMap) => {
44
- // eslint-disable-next-line no-unmodified-loop-condition
45
- while (bufferSize > MAX_CACHE_SIZE) {
46
- const earliest = Object.entries(downloadMap.lastFrameMap).sort((a, b) => {
47
- return a[1].lastAccessed - b[1].lastAccessed;
48
- })[0];
49
- removedLastFrameFromCache(earliest[0], downloadMap);
50
- }
51
- };
52
- const clearLastFileCache = (downloadMap) => {
53
- downloadMap.lastFrameMap = {};
54
- };
55
- exports.clearLastFileCache = clearLastFileCache;
@@ -1,9 +0,0 @@
1
- export type ServeUrlOrWebpackBundle = {
2
- serveUrl: string;
3
- } | {
4
- /**
5
- * @deprecated Renamed to `serveUrl`
6
- */
7
- webpackBundle: string;
8
- };
9
- export declare const getServeUrlWithFallback: (serve: ServeUrlOrWebpackBundle) => string;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getServeUrlWithFallback = void 0;
4
- const getServeUrlWithFallback = (serve) => {
5
- if ('webpackBundle' in serve) {
6
- return serve.webpackBundle;
7
- }
8
- if ('serveUrl' in serve) {
9
- return serve.serveUrl;
10
- }
11
- throw new Error('You must pass the `serveUrl` parameter');
12
- };
13
- exports.getServeUrlWithFallback = getServeUrlWithFallback;
package/dist/quality.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const validateQuality: (q: number | undefined) => void;
package/dist/quality.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateQuality = void 0;
4
- const validateQuality = (q) => {
5
- if (typeof q !== 'undefined' && typeof q !== 'number') {
6
- throw new Error(`Quality option must be a number or undefined. Got ${typeof q} (${JSON.stringify(q)})`);
7
- }
8
- if (typeof q === 'undefined') {
9
- return;
10
- }
11
- if (!Number.isFinite(q)) {
12
- throw new RangeError(`Quality must be a finite number, but is ${q}`);
13
- }
14
- if (Number.isNaN(q)) {
15
- throw new RangeError(`Quality is NaN, but must be a real number`);
16
- }
17
- if (q > 100 || q < 0) {
18
- throw new RangeError('Quality option must be between 0 and 100.');
19
- }
20
- };
21
- exports.validateQuality = validateQuality;
@@ -1,12 +0,0 @@
1
- import type { OffthreadVideoImageFormat } from 'remotion';
2
- import type { NeedsResize, SpecialVCodecForTransparency } from './assets/download-map';
3
- import type { FfmpegExecutable } from './ffmpeg-executable';
4
- export declare const tryToExtractFrameOfVideoFast: ({ ffmpegExecutable, remotionRoot, specialVCodecForTransparency, imageFormat, needsResize, src, actualOffset, }: {
5
- ffmpegExecutable: FfmpegExecutable;
6
- remotionRoot: string;
7
- imageFormat: OffthreadVideoImageFormat;
8
- needsResize: NeedsResize;
9
- src: string;
10
- specialVCodecForTransparency: SpecialVCodecForTransparency;
11
- actualOffset: string;
12
- }) => Promise<readonly [string, Buffer]>;
@@ -1,55 +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.tryToExtractFrameOfVideoFast = void 0;
7
- const execa_1 = __importDefault(require("execa"));
8
- const determine_resize_params_1 = require("./determine-resize-params");
9
- const determine_vcodec_ffmpeg_flags_1 = require("./determine-vcodec-ffmpeg-flags");
10
- const ffmpeg_flags_1 = require("./ffmpeg-flags");
11
- const truthy_1 = require("./truthy");
12
- const tryToExtractFrameOfVideoFast = async ({ ffmpegExecutable, remotionRoot, specialVCodecForTransparency, imageFormat, needsResize, src, actualOffset, }) => {
13
- const { stdout, stderr } = (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffmpegExecutable, remotionRoot, 'ffmpeg'), [
14
- '-ss',
15
- actualOffset,
16
- ...(0, determine_vcodec_ffmpeg_flags_1.determineVcodecFfmpegFlags)(specialVCodecForTransparency),
17
- '-i',
18
- src,
19
- '-frames:v',
20
- '1',
21
- '-c:v',
22
- imageFormat === 'jpeg' ? 'mjpeg' : 'png',
23
- '-f',
24
- 'image2pipe',
25
- ...(0, determine_resize_params_1.determineResizeParams)(needsResize),
26
- '-',
27
- ].filter(truthy_1.truthy));
28
- if (!stderr) {
29
- throw new Error('unexpectedly did not get stderr');
30
- }
31
- if (!stdout) {
32
- throw new Error('unexpectedly did not get stdout');
33
- }
34
- const stderrChunks = [];
35
- const stdoutChunks = [];
36
- const stdErrString = new Promise((resolve, reject) => {
37
- stderr.on('data', (d) => stderrChunks.push(d));
38
- stderr.on('error', (err) => reject(err));
39
- stderr.on('end', () => resolve(Buffer.concat(stderrChunks).toString('utf-8')));
40
- });
41
- const stdoutChunk = new Promise((resolve, reject) => {
42
- stdout.on('data', (d) => {
43
- stdoutChunks.push(d);
44
- });
45
- stdout.on('error', (err) => {
46
- reject(err);
47
- });
48
- stdout.on('end', () => {
49
- resolve(Buffer.concat(stdoutChunks));
50
- });
51
- });
52
- const [stdErr, stdoutBuffer] = await Promise.all([stdErrString, stdoutChunk]);
53
- return [stdErr, stdoutBuffer];
54
- };
55
- exports.tryToExtractFrameOfVideoFast = tryToExtractFrameOfVideoFast;
@@ -1,7 +0,0 @@
1
- export declare const customExecutableExists: (localExecutable: string) => boolean;
2
- export declare const binaryExists: (name: 'ffmpeg' | 'ffprobe') => boolean;
3
- export declare const checkAndValidateFfmpegVersion: (options: {
4
- ffmpegExecutable: string | null;
5
- remotionRoot: string;
6
- }) => Promise<void>;
7
- export declare const validateFfmpeg: (customFfmpegBinary: string | null, remotionRoot: string, binary: 'ffmpeg' | 'ffprobe') => Promise<void>;
@@ -1,77 +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.validateFfmpeg = exports.checkAndValidateFfmpegVersion = exports.binaryExists = exports.customExecutableExists = void 0;
7
- const execa_1 = __importDefault(require("execa"));
8
- const fs_1 = require("fs");
9
- const os_1 = __importDefault(require("os"));
10
- const ffmpeg_flags_1 = require("./ffmpeg-flags");
11
- const warn_about_ffmpeg_version_1 = require("./warn-about-ffmpeg-version");
12
- const existsMap = {};
13
- const customExecutableExists = (localExecutable) => {
14
- try {
15
- (0, fs_1.statSync)(localExecutable);
16
- existsMap[localExecutable] = true;
17
- }
18
- catch (err) {
19
- existsMap[localExecutable] = false;
20
- }
21
- return existsMap[localExecutable];
22
- };
23
- exports.customExecutableExists = customExecutableExists;
24
- const binaryExists = (name) => {
25
- if (typeof existsMap[name] !== 'undefined') {
26
- return existsMap[name];
27
- }
28
- const isWin = os_1.default.platform() === 'win32';
29
- const where = isWin ? 'where' : 'which';
30
- try {
31
- execa_1.default.sync(where, [name]);
32
- existsMap[name] = true;
33
- return true;
34
- }
35
- catch (err) {
36
- existsMap[name] = false;
37
- return false;
38
- }
39
- };
40
- exports.binaryExists = binaryExists;
41
- const checkAndValidateFfmpegVersion = async (options) => {
42
- const ffmpegVersion = await (0, ffmpeg_flags_1.getFfmpegVersion)({
43
- ffmpegExecutable: options.ffmpegExecutable,
44
- remotionRoot: options.remotionRoot,
45
- });
46
- const buildConf = await (0, ffmpeg_flags_1.getFfmpegBuildInfo)({
47
- ffmpegExecutable: options.ffmpegExecutable,
48
- remotionRoot: options.remotionRoot,
49
- });
50
- (0, warn_about_ffmpeg_version_1.warnAboutFfmpegVersion)({ ffmpegVersion, buildConf });
51
- };
52
- exports.checkAndValidateFfmpegVersion = checkAndValidateFfmpegVersion;
53
- const validateFfmpeg = async (customFfmpegBinary, remotionRoot, binary) => {
54
- const ffmpegExists = (0, exports.binaryExists)(binary);
55
- if (ffmpegExists) {
56
- return;
57
- }
58
- if (customFfmpegBinary) {
59
- if (!(0, exports.customExecutableExists)(customFfmpegBinary)) {
60
- throw new Error('Custom FFmpeg executable not found: ' + customFfmpegBinary);
61
- }
62
- return;
63
- }
64
- if (process.platform === 'linux' && (0, fs_1.existsSync)(ffmpeg_flags_1.lambdaFfmpegPaths[binary])) {
65
- return;
66
- }
67
- if ((0, ffmpeg_flags_1.ffmpegInNodeModules)(remotionRoot, binary)) {
68
- return;
69
- }
70
- const binaryUrl = (0, ffmpeg_flags_1.getBinaryDownloadUrl)(binary);
71
- if (binaryUrl) {
72
- await (0, ffmpeg_flags_1.downloadBinary)(remotionRoot, binaryUrl.url, binary);
73
- return (0, exports.validateFfmpeg)(customFfmpegBinary, remotionRoot, binary);
74
- }
75
- 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.`);
76
- };
77
- exports.validateFfmpeg = validateFfmpeg;
@@ -1,5 +0,0 @@
1
- import type { FfmpegVersion } from './ffmpeg-flags';
2
- export declare const warnAboutFfmpegVersion: ({ ffmpegVersion, buildConf, }: {
3
- ffmpegVersion: FfmpegVersion;
4
- buildConf: string | null;
5
- }) => null | undefined;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.warnAboutFfmpegVersion = void 0;
4
- const printMessage = (ffmpegVersion) => {
5
- console.warn('⚠️Old FFMPEG version detected: ' + ffmpegVersion.join('.'));
6
- console.warn(' For audio support, you need at least version 4.1.0.');
7
- console.warn(' Upgrade FFMPEG to get rid of this warning.');
8
- };
9
- const printBuildConfMessage = () => {
10
- console.error('⚠️ Unsupported FFMPEG version detected.');
11
- console.error(" Your version doesn't support the -buildconf flag");
12
- console.error(' Audio will not be supported and you may experience other issues.');
13
- console.error(' Upgrade FFMPEG to at least v4.1.0 to get rid of this warning.');
14
- };
15
- const warnAboutFfmpegVersion = ({ ffmpegVersion, buildConf, }) => {
16
- if (buildConf === null) {
17
- printBuildConfMessage();
18
- return;
19
- }
20
- if (ffmpegVersion === null) {
21
- return null;
22
- }
23
- const [major, minor] = ffmpegVersion;
24
- // 3.x and below definitely is too old
25
- if (major < 4) {
26
- printMessage(ffmpegVersion);
27
- return;
28
- }
29
- // 5.x will be all good
30
- if (major > 4) {
31
- return;
32
- }
33
- if (minor < 1) {
34
- printMessage(ffmpegVersion);
35
- }
36
- };
37
- exports.warnAboutFfmpegVersion = warnAboutFfmpegVersion;