@remotion/renderer 3.1.3 → 3.1.6
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/assets/download-and-map-assets-to-file.js +1 -1
- package/dist/assets/get-video-stream-duration.d.ts +6 -0
- package/dist/assets/get-video-stream-duration.js +34 -0
- package/dist/extract-frame-from-video.d.ts +0 -1
- package/dist/extract-frame-from-video.js +2 -2
- package/dist/get-extension-of-filename.d.ts +1 -1
- package/dist/get-extension-of-filename.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/render-media.d.ts +1 -0
- package/package.json +3 -3
|
@@ -98,7 +98,7 @@ const downloadAsset = async ({ src, onDownload, downloadDir, }) => {
|
|
|
98
98
|
if ((_a = hasBeenDownloadedMap[src]) === null || _a === void 0 ? void 0 : _a[downloadDir]) {
|
|
99
99
|
const claimedDownloadLocation = (_b = hasBeenDownloadedMap[src]) === null || _b === void 0 ? void 0 : _b[downloadDir];
|
|
100
100
|
// The OS might have deleted the file since even though we marked it as downloaded. In that case we reset the state and download it again
|
|
101
|
-
if (
|
|
101
|
+
if (fs_1.default.existsSync(claimedDownloadLocation)) {
|
|
102
102
|
return claimedDownloadLocation;
|
|
103
103
|
}
|
|
104
104
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -0,0 +1,34 @@
|
|
|
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.getVideoStreamDuration = void 0;
|
|
7
|
+
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const p_limit_1 = require("../p-limit");
|
|
9
|
+
const durationOfAssetCache = {};
|
|
10
|
+
const limit = (0, p_limit_1.pLimit)(1);
|
|
11
|
+
async function getVideoStreamDurationUnlimited(src, ffprobeExecutable) {
|
|
12
|
+
if (durationOfAssetCache[src]) {
|
|
13
|
+
return durationOfAssetCache[src];
|
|
14
|
+
}
|
|
15
|
+
const args = [
|
|
16
|
+
['-v', 'error'],
|
|
17
|
+
['-select_streams', 'v:0'],
|
|
18
|
+
['-show_entries', 'stream=duration'],
|
|
19
|
+
[src],
|
|
20
|
+
]
|
|
21
|
+
.reduce((acc, val) => acc.concat(val), [])
|
|
22
|
+
.filter(Boolean);
|
|
23
|
+
const task = await (0, execa_1.default)(ffprobeExecutable !== null && ffprobeExecutable !== void 0 ? ffprobeExecutable : 'ffprobe', args);
|
|
24
|
+
const duration = task.stdout.match(/duration=([0-9.]+)/);
|
|
25
|
+
const result = {
|
|
26
|
+
duration: duration ? parseFloat(duration[1]) : null,
|
|
27
|
+
};
|
|
28
|
+
durationOfAssetCache[src] = result;
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
const getVideoStreamDuration = (src, ffprobeExecutable) => {
|
|
32
|
+
return limit(() => getVideoStreamDurationUnlimited(src, ffprobeExecutable));
|
|
33
|
+
};
|
|
34
|
+
exports.getVideoStreamDuration = getVideoStreamDuration;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { FfmpegExecutable, OffthreadVideoImageFormat } from 'remotion';
|
|
3
2
|
import type { LastFrameOptions } from './last-frame-from-video-cache';
|
|
4
3
|
export declare const getLastFrameOfVideo: (options: LastFrameOptions) => Promise<Buffer>;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.extractFrameFromVideo = exports.getLastFrameOfVideo = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
8
|
const remotion_1 = require("remotion");
|
|
9
|
-
const
|
|
9
|
+
const get_video_stream_duration_1 = require("./assets/get-video-stream-duration");
|
|
10
10
|
const ensure_presentation_timestamp_1 = require("./ensure-presentation-timestamp");
|
|
11
11
|
const frame_to_ffmpeg_timestamp_1 = require("./frame-to-ffmpeg-timestamp");
|
|
12
12
|
const get_video_info_1 = require("./get-video-info");
|
|
@@ -81,7 +81,7 @@ const getLastFrameOfVideoFastUnlimited = async (options) => {
|
|
|
81
81
|
if (fromCache) {
|
|
82
82
|
return fromCache;
|
|
83
83
|
}
|
|
84
|
-
const { duration } = await (0,
|
|
84
|
+
const { duration } = await (0, get_video_stream_duration_1.getVideoStreamDuration)(src, ffprobeExecutable);
|
|
85
85
|
if (duration === null) {
|
|
86
86
|
throw new Error(`Could not determine the duration of ${src} using FFMPEG. The file is not supported.`);
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getExtensionOfFilename: (filename: string) => string | null;
|
|
1
|
+
export declare const getExtensionOfFilename: (filename: string | null) => string | null;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getExtensionOfFilename = void 0;
|
|
4
4
|
const getExtensionOfFilename = (filename) => {
|
|
5
|
+
if (filename === null) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
5
8
|
const filenameArr = filename.split('.');
|
|
6
9
|
const hasExtension = filenameArr.length >= 2;
|
|
7
10
|
const filenameArrLength = filenameArr.length;
|
package/dist/index.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export declare const RenderInternals: {
|
|
|
80
80
|
symbolicateError: (symbolicateableError: SymbolicateableError) => Promise<import("./error-handling/handle-javascript-exception").ErrorWithStackFrame>;
|
|
81
81
|
SymbolicateableError: typeof SymbolicateableError;
|
|
82
82
|
getFramesToRender: (frameRange: [number, number], everyNthFrame: number) => number[];
|
|
83
|
-
getExtensionOfFilename: (filename: string) => string | null;
|
|
83
|
+
getExtensionOfFilename: (filename: string | null) => string | null;
|
|
84
84
|
getDesiredPort: (desiredPort: number | undefined, from: number, to: number) => Promise<number>;
|
|
85
85
|
isPathInside: (thePath: string, potentialParent: string) => boolean;
|
|
86
86
|
execa: {
|
package/dist/render-media.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { BrowserExecutable, Codec, FfmpegExecutable, FrameRange, PixelFormat, ProResProfile, SmallTCompMetadata } from 'remotion';
|
|
2
3
|
import type { RenderMediaOnDownload } from './assets/download-and-map-assets-to-file';
|
|
3
4
|
import type { BrowserLog } from './browser-log';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
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.1.
|
|
25
|
+
"remotion": "3.1.6",
|
|
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": "188460243a533e1511b3f83fa8c77cd4c445553d"
|
|
61
61
|
}
|