@remotion/renderer 4.0.0-alpha11 → 4.0.0-alpha13

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 (41) hide show
  1. package/package.json +9 -9
  2. package/dist/assets/get-video-stream-duration.d.ts +0 -9
  3. package/dist/assets/get-video-stream-duration.js +0 -71
  4. package/dist/calculate-sar-dar-pixels.d.ts +0 -9
  5. package/dist/calculate-sar-dar-pixels.js +0 -19
  6. package/dist/determine-resize-params.d.ts +0 -1
  7. package/dist/determine-resize-params.js +0 -10
  8. package/dist/determine-vcodec-ffmpeg-flags.d.ts +0 -2
  9. package/dist/determine-vcodec-ffmpeg-flags.js +0 -13
  10. package/dist/ensure-ffmpeg.d.ts +0 -18
  11. package/dist/ensure-ffmpeg.js +0 -58
  12. package/dist/ensure-presentation-timestamp.d.ts +0 -15
  13. package/dist/ensure-presentation-timestamp.js +0 -88
  14. package/dist/extract-frame-from-video.d.ts +0 -16
  15. package/dist/extract-frame-from-video.js +0 -191
  16. package/dist/ffmpeg-executable.d.ts +0 -1
  17. package/dist/ffmpeg-executable.js +0 -2
  18. package/dist/ffmpeg-flags.d.ts +0 -31
  19. package/dist/ffmpeg-flags.js +0 -245
  20. package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -1
  21. package/dist/frame-to-ffmpeg-timestamp.js +0 -8
  22. package/dist/get-can-extract-frames-fast.d.ts +0 -14
  23. package/dist/get-can-extract-frames-fast.js +0 -71
  24. package/dist/get-frame-of-video-slow.d.ts +0 -17
  25. package/dist/get-frame-of-video-slow.js +0 -72
  26. package/dist/get-video-info.d.ts +0 -8
  27. package/dist/get-video-info.js +0 -59
  28. package/dist/is-beyond-last-frame.d.ts +0 -3
  29. package/dist/is-beyond-last-frame.js +0 -12
  30. package/dist/last-frame-from-video-cache.d.ts +0 -17
  31. package/dist/last-frame-from-video-cache.js +0 -55
  32. package/dist/legacy-webpack-config.d.ts +0 -9
  33. package/dist/legacy-webpack-config.js +0 -13
  34. package/dist/quality.d.ts +0 -1
  35. package/dist/quality.js +0 -21
  36. package/dist/try-to-extract-frame-of-video-fast.d.ts +0 -12
  37. package/dist/try-to-extract-frame-of-video-fast.js +0 -55
  38. package/dist/validate-ffmpeg.d.ts +0 -7
  39. package/dist/validate-ffmpeg.js +0 -77
  40. package/dist/warn-about-ffmpeg-version.d.ts +0 -5
  41. package/dist/warn-about-ffmpeg-version.js +0 -37
@@ -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;