@remotion/renderer 3.0.29 → 3.0.30
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/ensure-presentation-timestamp.js +20 -9
- package/dist/get-extension-from-codec.d.ts +1 -1
- package/dist/guess-extension-for-media.d.ts +1 -1
- package/dist/guess-extension-for-media.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -0
- package/dist/render-media.d.ts +0 -1
- package/dist/validate-concurrency.d.ts +1 -0
- package/dist/validate-concurrency.js +24 -0
- package/package.json +3 -3
|
@@ -7,8 +7,26 @@ exports.ensurePresentationTimestamps = void 0;
|
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
8
|
const promises_1 = require("fs/promises");
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const remotion_1 = require("remotion");
|
|
11
|
+
const guess_extension_for_media_1 = require("./guess-extension-for-media");
|
|
10
12
|
const ensureFileHasPresentationTimestamp = {};
|
|
11
13
|
let callbacks = [];
|
|
14
|
+
const getTemporaryOutputName = async (src) => {
|
|
15
|
+
const parts = src.split(path_1.default.sep);
|
|
16
|
+
// If there is no file extension for the video, then we need to temporarily add an extension
|
|
17
|
+
const lastPart = parts[parts.length - 1];
|
|
18
|
+
const extraExtension = lastPart.includes('.')
|
|
19
|
+
? null
|
|
20
|
+
: await (0, guess_extension_for_media_1.guessExtensionForVideo)(src);
|
|
21
|
+
return parts
|
|
22
|
+
.map((p, i) => {
|
|
23
|
+
if (i === parts.length - 1) {
|
|
24
|
+
return [`pts-${p}`, extraExtension].filter(remotion_1.Internals.truthy).join('.');
|
|
25
|
+
}
|
|
26
|
+
return p;
|
|
27
|
+
})
|
|
28
|
+
.join(path_1.default.sep);
|
|
29
|
+
};
|
|
12
30
|
const ensurePresentationTimestamps = async (src) => {
|
|
13
31
|
if (ensureFileHasPresentationTimestamp[src] === 'encoding') {
|
|
14
32
|
return new Promise((resolve) => {
|
|
@@ -22,15 +40,8 @@ const ensurePresentationTimestamps = async (src) => {
|
|
|
22
40
|
return;
|
|
23
41
|
}
|
|
24
42
|
ensureFileHasPresentationTimestamp[src] = 'encoding';
|
|
25
|
-
|
|
26
|
-
const output =
|
|
27
|
-
.map((p, i) => {
|
|
28
|
-
if (i === parts.length - 1) {
|
|
29
|
-
return `pts-${p}`;
|
|
30
|
-
}
|
|
31
|
-
return p;
|
|
32
|
-
})
|
|
33
|
-
.join(path_1.default.sep);
|
|
43
|
+
// If there is no file extension for the video, then we need to tempoa
|
|
44
|
+
const output = await getTemporaryOutputName(src);
|
|
34
45
|
await (0, execa_1.default)('ffmpeg', [
|
|
35
46
|
'-i',
|
|
36
47
|
src,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Codec } from 'remotion';
|
|
2
|
-
export declare const getFileExtensionFromCodec: (codec: Codec, type: 'chunk' | 'final') => "mp3" | "aac" | "wav" | "
|
|
2
|
+
export declare const getFileExtensionFromCodec: (codec: Codec, type: 'chunk' | 'final') => "mp3" | "aac" | "wav" | "webm" | "mp4" | "mov" | "mkv";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const guessExtensionForVideo: (src: string) => Promise<"
|
|
1
|
+
export declare const guessExtensionForVideo: (src: string) => Promise<"mp3" | "webm" | "wav" | "mp4">;
|
|
@@ -7,9 +7,6 @@ exports.guessExtensionForVideo = void 0;
|
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
8
|
const guessExtensionForVideo = async (src) => {
|
|
9
9
|
const { stderr } = await (0, execa_1.default)('ffprobe', [src]);
|
|
10
|
-
if (stderr.includes('h264')) {
|
|
11
|
-
return 'mp4';
|
|
12
|
-
}
|
|
13
10
|
if (stderr.includes('mp3,')) {
|
|
14
11
|
return 'mp3';
|
|
15
12
|
}
|
|
@@ -22,6 +19,9 @@ const guessExtensionForVideo = async (src) => {
|
|
|
22
19
|
if (stderr.includes('wav, ')) {
|
|
23
20
|
return 'wav';
|
|
24
21
|
}
|
|
22
|
+
if (stderr.includes('Video: h264')) {
|
|
23
|
+
return 'mp4';
|
|
24
|
+
}
|
|
25
25
|
throw new Error(`A media file ${src} which has no file extension and whose format could not be guessed. Is this a valid media file?`);
|
|
26
26
|
};
|
|
27
27
|
exports.guessExtensionForVideo = guessExtensionForVideo;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import execa from 'execa';
|
|
3
2
|
import { SymbolicateableError } from './error-handling/symbolicateable-error';
|
|
4
3
|
import { mimeContentType, mimeLookup } from './mime-types';
|
|
@@ -55,7 +54,7 @@ export declare const RenderInternals: {
|
|
|
55
54
|
task: Promise<Buffer | null>;
|
|
56
55
|
getLogs: () => string;
|
|
57
56
|
}>;
|
|
58
|
-
getFileExtensionFromCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv", type: "chunk" | "final") => "mp3" | "aac" | "wav" | "mp4" | "
|
|
57
|
+
getFileExtensionFromCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv", type: "chunk" | "final") => "mp3" | "aac" | "wav" | "mp4" | "mkv" | "mov" | "webm";
|
|
59
58
|
tmpDir: (str: string) => string;
|
|
60
59
|
deleteDirectory: (directory: string) => Promise<void>;
|
|
61
60
|
isServeUrl: (potentialUrl: string) => boolean;
|
|
@@ -105,4 +104,5 @@ export declare const RenderInternals: {
|
|
|
105
104
|
unlockErrorSymbolicationLock: (id: number) => void;
|
|
106
105
|
mimeContentType: typeof mimeContentType;
|
|
107
106
|
mimeLookup: typeof mimeLookup;
|
|
107
|
+
validateConcurrency: (value: unknown, setting: string) => void;
|
|
108
108
|
};
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ const is_path_inside_1 = require("./serve-handler/is-path-inside");
|
|
|
27
27
|
const serve_static_1 = require("./serve-static");
|
|
28
28
|
const stitch_frames_to_video_1 = require("./stitch-frames-to-video");
|
|
29
29
|
const tmp_dir_1 = require("./tmp-dir");
|
|
30
|
+
const validate_concurrency_1 = require("./validate-concurrency");
|
|
30
31
|
const validate_even_dimensions_with_codec_1 = require("./validate-even-dimensions-with-codec");
|
|
31
32
|
const validate_ffmpeg_1 = require("./validate-ffmpeg");
|
|
32
33
|
const validate_puppeteer_timeout_1 = require("./validate-puppeteer-timeout");
|
|
@@ -84,4 +85,5 @@ exports.RenderInternals = {
|
|
|
84
85
|
unlockErrorSymbolicationLock: wait_for_symbolication_error_to_be_done_1.unlockErrorSymbolicationLock,
|
|
85
86
|
mimeContentType: mime_types_1.mimeContentType,
|
|
86
87
|
mimeLookup: mime_types_1.mimeLookup,
|
|
88
|
+
validateConcurrency: validate_concurrency_1.validateConcurrency,
|
|
87
89
|
};
|
package/dist/render-media.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { BrowserExecutable, Codec, FfmpegExecutable, FrameRange, PixelFormat, ProResProfile, SmallTCompMetadata } from 'remotion';
|
|
3
2
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
4
3
|
import type { BrowserLog } from './browser-log';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const validateConcurrency: (value: unknown, setting: string) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateConcurrency = void 0;
|
|
4
|
+
const validateConcurrency = (value, setting) => {
|
|
5
|
+
if (typeof value === 'undefined') {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (value === null) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (typeof value !== 'number') {
|
|
12
|
+
throw new Error(setting + ' must be a number but is ' + value);
|
|
13
|
+
}
|
|
14
|
+
if (value % 1 !== 0) {
|
|
15
|
+
throw new Error(setting + ' must be an integer, but is ' + value);
|
|
16
|
+
}
|
|
17
|
+
if (value < 1) {
|
|
18
|
+
throw new Error(setting + ' must be at least 1, but is ' + value);
|
|
19
|
+
}
|
|
20
|
+
if (value > require('os').cpus().length) {
|
|
21
|
+
throw new Error(`${setting} is set higher than the amount of CPU cores available. Available CPU cores: ${require('os').cpus().length}, value set: ${value}`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.validateConcurrency = validateConcurrency;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.30",
|
|
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.0.
|
|
25
|
+
"remotion": "3.0.30",
|
|
26
26
|
"source-map": "^0.8.0-beta.0",
|
|
27
27
|
"ws": "8.7.0"
|
|
28
28
|
},
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "5af2bdb448a7ceadb6c3f9003b014d7566878c35"
|
|
63
63
|
}
|