@remotion/renderer 3.0.20 → 3.0.23

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 (185) hide show
  1. package/dist/assets/calculate-asset-positions.d.ts +2 -2
  2. package/dist/assets/convert-assets-to-file-urls.d.ts +2 -2
  3. package/dist/assets/download-and-map-assets-to-file.d.ts +1 -1
  4. package/dist/assets/ffmpeg-volume-expression.d.ts +1 -1
  5. package/dist/assets/flatten-volume-array.d.ts +1 -1
  6. package/dist/assets/get-audio-channels.d.ts +1 -2
  7. package/dist/assets/get-audio-channels.js +1 -2
  8. package/dist/assets/types.d.ts +1 -1
  9. package/dist/browser/Accessibility.d.ts +175 -0
  10. package/dist/browser/Accessibility.js +423 -0
  11. package/dist/browser/AriaQueryHandler.d.ts +20 -0
  12. package/dist/browser/AriaQueryHandler.js +108 -0
  13. package/dist/browser/Browser.d.ts +209 -0
  14. package/dist/browser/Browser.js +402 -0
  15. package/dist/browser/BrowserConnector.d.ts +26 -0
  16. package/dist/browser/BrowserConnector.js +49 -0
  17. package/dist/browser/BrowserFetcher.d.ts +89 -0
  18. package/dist/browser/BrowserFetcher.js +512 -0
  19. package/dist/browser/BrowserRunner.d.ts +39 -0
  20. package/dist/browser/BrowserRunner.js +308 -0
  21. package/dist/browser/Connection.d.ts +49 -0
  22. package/dist/browser/Connection.js +262 -0
  23. package/dist/browser/ConnectionTransport.d.ts +21 -0
  24. package/dist/browser/ConnectionTransport.js +17 -0
  25. package/dist/browser/ConsoleMessage.d.ts +55 -0
  26. package/dist/browser/ConsoleMessage.js +75 -0
  27. package/dist/browser/Coverage.d.ts +180 -0
  28. package/dist/browser/Coverage.js +371 -0
  29. package/dist/browser/DOMWorld.d.ts +50 -0
  30. package/dist/browser/DOMWorld.js +280 -0
  31. package/dist/browser/Debug.d.ts +19 -0
  32. package/dist/browser/Debug.js +42 -0
  33. package/dist/browser/DeviceDescriptors.d.ts +40 -0
  34. package/dist/browser/DeviceDescriptors.js +1407 -0
  35. package/dist/browser/EmulationManager.d.ts +7 -0
  36. package/dist/browser/EmulationManager.js +40 -0
  37. package/dist/browser/Errors.d.ts +25 -0
  38. package/dist/browser/Errors.js +35 -0
  39. package/dist/browser/EvalTypes.d.ts +27 -0
  40. package/dist/browser/EvalTypes.js +17 -0
  41. package/dist/browser/EventEmitter.d.ts +70 -0
  42. package/dist/browser/EventEmitter.js +102 -0
  43. package/dist/browser/ExecutionContext.d.ts +35 -0
  44. package/dist/browser/ExecutionContext.js +190 -0
  45. package/dist/browser/FileChooser.d.ts +56 -0
  46. package/dist/browser/FileChooser.js +86 -0
  47. package/dist/browser/FrameManager.d.ts +96 -0
  48. package/dist/browser/FrameManager.js +512 -0
  49. package/dist/browser/HTTPRequest.d.ts +42 -0
  50. package/dist/browser/HTTPRequest.js +82 -0
  51. package/dist/browser/HTTPResponse.d.ts +100 -0
  52. package/dist/browser/HTTPResponse.js +196 -0
  53. package/dist/browser/Input.d.ts +355 -0
  54. package/dist/browser/Input.js +592 -0
  55. package/dist/browser/JSHandle.d.ts +36 -0
  56. package/dist/browser/JSHandle.js +93 -0
  57. package/dist/browser/LaunchOptions.d.ts +117 -0
  58. package/dist/browser/LaunchOptions.js +17 -0
  59. package/dist/browser/Launcher.d.ts +9 -0
  60. package/dist/browser/Launcher.js +602 -0
  61. package/dist/browser/LifecycleWatcher.d.ts +29 -0
  62. package/dist/browser/LifecycleWatcher.js +193 -0
  63. package/dist/browser/NetworkConditions.d.ts +26 -0
  64. package/dist/browser/NetworkConditions.js +33 -0
  65. package/dist/browser/NetworkEventManager.d.ts +35 -0
  66. package/dist/browser/NetworkEventManager.js +128 -0
  67. package/dist/browser/NetworkManager.d.ts +36 -0
  68. package/dist/browser/NetworkManager.js +284 -0
  69. package/dist/browser/NodeWebSocketTransport.d.ts +11 -0
  70. package/dist/browser/NodeWebSocketTransport.js +90 -0
  71. package/dist/browser/PDFOptions.d.ts +165 -0
  72. package/dist/browser/PDFOptions.js +34 -0
  73. package/dist/browser/PipeTransport.d.ts +10 -0
  74. package/dist/browser/PipeTransport.js +86 -0
  75. package/dist/browser/Product.d.ts +16 -0
  76. package/dist/browser/Product.js +17 -0
  77. package/dist/browser/Puppeteer.d.ts +35 -0
  78. package/dist/browser/Puppeteer.js +17 -0
  79. package/dist/browser/PuppeteerNode.d.ts +92 -0
  80. package/dist/browser/PuppeteerNode.js +143 -0
  81. package/dist/browser/PuppeteerViewport.d.ts +5 -0
  82. package/dist/browser/PuppeteerViewport.js +2 -0
  83. package/dist/browser/QueryHandler.d.ts +64 -0
  84. package/dist/browser/QueryHandler.js +183 -0
  85. package/dist/browser/ScreenshotOptions.d.ts +14 -0
  86. package/dist/browser/ScreenshotOptions.js +2 -0
  87. package/dist/browser/SecurityDetails.d.ts +55 -0
  88. package/dist/browser/SecurityDetails.js +95 -0
  89. package/dist/browser/Target.d.ts +61 -0
  90. package/dist/browser/Target.js +146 -0
  91. package/dist/browser/TaskQueue.d.ts +20 -0
  92. package/dist/browser/TaskQueue.js +47 -0
  93. package/dist/browser/TimeoutSettings.d.ts +23 -0
  94. package/dist/browser/TimeoutSettings.js +62 -0
  95. package/dist/browser/Tracing.d.ts +45 -0
  96. package/dist/browser/Tracing.js +136 -0
  97. package/dist/browser/USKeyboardLayout.d.ts +39 -0
  98. package/dist/browser/USKeyboardLayout.js +406 -0
  99. package/dist/browser/WebWorker.d.ts +96 -0
  100. package/dist/browser/WebWorker.js +122 -0
  101. package/dist/browser/assert.d.ts +21 -0
  102. package/dist/browser/assert.js +29 -0
  103. package/dist/browser/compat.d.ts +2 -0
  104. package/dist/browser/compat.js +17 -0
  105. package/dist/browser/create-browser-fetcher.d.ts +17 -0
  106. package/dist/browser/create-browser-fetcher.js +140 -0
  107. package/dist/browser/dialog.d.ts +70 -0
  108. package/dist/browser/dialog.js +114 -0
  109. package/dist/browser/environment.d.ts +16 -0
  110. package/dist/browser/environment.js +19 -0
  111. package/dist/browser/fetch.d.ts +16 -0
  112. package/dist/browser/fetch.js +46 -0
  113. package/dist/browser/find-up.d.ts +4 -0
  114. package/dist/browser/find-up.js +85 -0
  115. package/dist/browser/get-download-destination.d.ts +1 -0
  116. package/dist/browser/get-download-destination.js +38 -0
  117. package/dist/browser/mitt/index.d.ts +22 -0
  118. package/dist/browser/mitt/index.js +49 -0
  119. package/dist/browser/node.d.ts +2 -0
  120. package/dist/browser/node.js +9 -0
  121. package/dist/browser/page.d.ts +78 -0
  122. package/dist/browser/page.js +277 -0
  123. package/dist/browser/pkg-dir.d.ts +3 -0
  124. package/dist/browser/pkg-dir.js +13 -0
  125. package/dist/browser/revisions.d.ts +21 -0
  126. package/dist/browser/revisions.js +22 -0
  127. package/dist/browser/util.d.ts +46 -0
  128. package/dist/browser/util.js +161 -0
  129. package/dist/browser-log.d.ts +1 -1
  130. package/dist/calculate-ffmpeg-filters.d.ts +1 -1
  131. package/dist/can-use-parallel-encoding.d.ts +1 -1
  132. package/dist/combine-videos.d.ts +1 -1
  133. package/dist/convert-to-pcm.d.ts +1 -1
  134. package/dist/create-silent-audio.d.ts +1 -1
  135. package/dist/cycle-browser-tabs.d.ts +1 -1
  136. package/dist/delay-render-embedded-stack.d.ts +1 -1
  137. package/dist/ensure-presentation-timestamp.d.ts +1 -1
  138. package/dist/ensure-presentation-timestamp.js +1 -1
  139. package/dist/error-handling/handle-javascript-exception.d.ts +2 -2
  140. package/dist/error-handling/symbolicate-error.d.ts +1 -1
  141. package/dist/error-handling/symbolicateable-error.d.ts +1 -1
  142. package/dist/extract-frame-from-video.d.ts +5 -6
  143. package/dist/extract-frame-from-video.js +51 -22
  144. package/dist/get-audio-codec-name.d.ts +1 -1
  145. package/dist/get-browser-instance.d.ts +3 -3
  146. package/dist/get-codec-name.d.ts +1 -1
  147. package/dist/get-compositions.d.ts +4 -4
  148. package/dist/get-duration-from-frame-range.d.ts +1 -1
  149. package/dist/get-extension-from-codec.d.ts +1 -1
  150. package/dist/get-frame-to-render.d.ts +1 -1
  151. package/dist/get-local-browser-executable.d.ts +1 -1
  152. package/dist/get-prores-profile-name.d.ts +1 -1
  153. package/dist/image-format.d.ts +1 -1
  154. package/dist/is-vp9-video.d.ts +3 -0
  155. package/dist/is-vp9-video.js +24 -0
  156. package/dist/last-frame-from-video-cache.d.ts +4 -4
  157. package/dist/last-frame-from-video-cache.js +9 -6
  158. package/dist/merge-audio-track.d.ts +1 -1
  159. package/dist/offthread-video-server.d.ts +4 -3
  160. package/dist/offthread-video-server.js +14 -3
  161. package/dist/open-browser.d.ts +1 -1
  162. package/dist/prepare-server.d.ts +2 -2
  163. package/dist/preprocess-audio-track.d.ts +2 -2
  164. package/dist/prespawn-ffmpeg.d.ts +2 -2
  165. package/dist/provide-screenshot.d.ts +2 -3
  166. package/dist/puppeteer-evaluate.d.ts +1 -1
  167. package/dist/puppeteer-evaluate.js +0 -1
  168. package/dist/puppeteer-screenshot.d.ts +1 -2
  169. package/dist/render-frames.d.ts +8 -8
  170. package/dist/render-media.d.ts +7 -7
  171. package/dist/render-still.d.ts +6 -6
  172. package/dist/screenshot-dom-element.d.ts +2 -3
  173. package/dist/screenshot-task.d.ts +2 -3
  174. package/dist/seek-to-frame.d.ts +1 -1
  175. package/dist/serve-handler/index.d.ts +1 -1
  176. package/dist/serve-handler/index.js +0 -1
  177. package/dist/serve-static.d.ts +2 -2
  178. package/dist/set-props-and-env.d.ts +1 -1
  179. package/dist/stitch-frames-to-video.d.ts +3 -3
  180. package/dist/stringify-ffmpeg-filter.d.ts +1 -1
  181. package/dist/symbolicate-stacktrace.d.ts +1 -1
  182. package/dist/types.d.ts +1 -1
  183. package/dist/validate-even-dimensions-with-codec.d.ts +1 -1
  184. package/dist/validate-output-filename.d.ts +1 -1
  185. package/package.json +4 -4
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright 2020 Google Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ declare type Revisions = Readonly<{
17
+ readonly chromium: string;
18
+ readonly firefox: string;
19
+ }>;
20
+ export declare const PUPPETEER_REVISIONS: Revisions;
21
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright 2020 Google Inc. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.PUPPETEER_REVISIONS = void 0;
19
+ exports.PUPPETEER_REVISIONS = {
20
+ chromium: '1002410',
21
+ firefox: 'latest',
22
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Copyright 2017 Google Inc. All rights reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /// <reference types="node" />
17
+ import { Protocol } from 'devtools-protocol';
18
+ import { CDPSession } from './Connection';
19
+ import { CommonEventEmitter } from './EventEmitter';
20
+ export declare function getExceptionMessage(exceptionDetails: Protocol.Runtime.ExceptionDetails): string;
21
+ export declare function valueFromRemoteObject(remoteObject: Protocol.Runtime.RemoteObject): any;
22
+ export declare function releaseObject(client: CDPSession, remoteObject: Protocol.Runtime.RemoteObject): Promise<void>;
23
+ export interface PuppeteerEventListener {
24
+ emitter: CommonEventEmitter;
25
+ eventName: string | symbol;
26
+ handler: (...args: any[]) => void;
27
+ }
28
+ export declare function addEventListener(emitter: CommonEventEmitter, eventName: string | symbol, handler: (...args: any[]) => void): PuppeteerEventListener;
29
+ export declare function removeEventListeners(listeners: Array<{
30
+ emitter: CommonEventEmitter;
31
+ eventName: string | symbol;
32
+ handler: (...args: any[]) => void;
33
+ }>): void;
34
+ export declare const isString: (obj: unknown) => obj is string;
35
+ export declare function evaluationString(fun: Function | string, ...args: unknown[]): string;
36
+ export declare function pageBindingDeliverResultString(name: string, seq: number, result: unknown): string;
37
+ export declare function pageBindingDeliverErrorString(name: string, seq: number, message: string, stack?: string): string;
38
+ export declare function pageBindingDeliverErrorValueString(name: string, seq: number, value: unknown): string;
39
+ export declare function waitWithTimeout<T>(promise: Promise<T>, taskName: string, timeout: number): Promise<T>;
40
+ interface ErrorLike extends Error {
41
+ name: string;
42
+ message: string;
43
+ }
44
+ export declare function isErrorLike(obj: unknown): obj is ErrorLike;
45
+ export declare function isErrnoException(obj: unknown): obj is NodeJS.ErrnoException;
46
+ export {};
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright 2017 Google Inc. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.isErrnoException = exports.isErrorLike = exports.waitWithTimeout = exports.pageBindingDeliverErrorValueString = exports.pageBindingDeliverErrorString = exports.pageBindingDeliverResultString = exports.evaluationString = exports.isString = exports.removeEventListeners = exports.addEventListener = exports.releaseObject = exports.valueFromRemoteObject = exports.getExceptionMessage = void 0;
19
+ const assert_1 = require("./assert");
20
+ const Errors_1 = require("./Errors");
21
+ function getExceptionMessage(exceptionDetails) {
22
+ if (exceptionDetails.exception) {
23
+ return (exceptionDetails.exception.description || exceptionDetails.exception.value);
24
+ }
25
+ let message = exceptionDetails.text;
26
+ if (exceptionDetails.stackTrace) {
27
+ for (const callframe of exceptionDetails.stackTrace.callFrames) {
28
+ const location = callframe.url +
29
+ ':' +
30
+ callframe.lineNumber +
31
+ ':' +
32
+ callframe.columnNumber;
33
+ const functionName = callframe.functionName || '<anonymous>';
34
+ message += `\n at ${functionName} (${location})`;
35
+ }
36
+ }
37
+ return message;
38
+ }
39
+ exports.getExceptionMessage = getExceptionMessage;
40
+ function valueFromRemoteObject(remoteObject) {
41
+ (0, assert_1.assert)(!remoteObject.objectId, 'Cannot extract value when objectId is given');
42
+ if (remoteObject.unserializableValue) {
43
+ if (remoteObject.type === 'bigint' && typeof BigInt !== 'undefined') {
44
+ return BigInt(remoteObject.unserializableValue.replace('n', ''));
45
+ }
46
+ switch (remoteObject.unserializableValue) {
47
+ case '-0':
48
+ return -0;
49
+ case 'NaN':
50
+ return NaN;
51
+ case 'Infinity':
52
+ return Infinity;
53
+ case '-Infinity':
54
+ return -Infinity;
55
+ default:
56
+ throw new Error('Unsupported unserializable value: ' +
57
+ remoteObject.unserializableValue);
58
+ }
59
+ }
60
+ return remoteObject.value;
61
+ }
62
+ exports.valueFromRemoteObject = valueFromRemoteObject;
63
+ async function releaseObject(client, remoteObject) {
64
+ if (!remoteObject.objectId) {
65
+ return;
66
+ }
67
+ await client
68
+ .send('Runtime.releaseObject', { objectId: remoteObject.objectId })
69
+ .catch(() => {
70
+ // Exceptions might happen in case of a page been navigated or closed.
71
+ // Swallow these since they are harmless and we don't leak anything in this case.
72
+ });
73
+ }
74
+ exports.releaseObject = releaseObject;
75
+ function addEventListener(emitter, eventName, handler) {
76
+ emitter.on(eventName, handler);
77
+ return { emitter, eventName, handler };
78
+ }
79
+ exports.addEventListener = addEventListener;
80
+ function removeEventListeners(listeners) {
81
+ for (const listener of listeners) {
82
+ listener.emitter.removeListener(listener.eventName, listener.handler);
83
+ }
84
+ listeners.length = 0;
85
+ }
86
+ exports.removeEventListeners = removeEventListeners;
87
+ const isString = (obj) => {
88
+ return typeof obj === 'string' || obj instanceof String;
89
+ };
90
+ exports.isString = isString;
91
+ function evaluationString(fun, ...args) {
92
+ if ((0, exports.isString)(fun)) {
93
+ (0, assert_1.assert)(args.length === 0, 'Cannot evaluate a string with arguments');
94
+ return fun;
95
+ }
96
+ function serializeArgument(arg) {
97
+ if (Object.is(arg, undefined)) {
98
+ return 'undefined';
99
+ }
100
+ return JSON.stringify(arg);
101
+ }
102
+ return `(${fun})(${args.map(serializeArgument).join(',')})`;
103
+ }
104
+ exports.evaluationString = evaluationString;
105
+ function pageBindingDeliverResultString(name, seq, result) {
106
+ function deliverResult(_name, _seq, _result) {
107
+ window[_name].callbacks.get(_seq).resolve(_result);
108
+ window[_name].callbacks.delete(_seq);
109
+ }
110
+ return evaluationString(deliverResult, name, seq, result);
111
+ }
112
+ exports.pageBindingDeliverResultString = pageBindingDeliverResultString;
113
+ function pageBindingDeliverErrorString(name, seq, message, stack) {
114
+ function deliverError(_name, _seq, _message, _stack) {
115
+ const error = new Error(_message);
116
+ error.stack = _stack;
117
+ window[_name].callbacks.get(_seq).reject(error);
118
+ window[_name].callbacks.delete(_seq);
119
+ }
120
+ return evaluationString(deliverError, name, seq, message, stack);
121
+ }
122
+ exports.pageBindingDeliverErrorString = pageBindingDeliverErrorString;
123
+ function pageBindingDeliverErrorValueString(name, seq, value) {
124
+ function deliverErrorValue(_name, _seq, _value) {
125
+ window[_name].callbacks.get(_seq).reject(_value);
126
+ window[_name].callbacks.delete(_seq);
127
+ }
128
+ return evaluationString(deliverErrorValue, name, seq, value);
129
+ }
130
+ exports.pageBindingDeliverErrorValueString = pageBindingDeliverErrorValueString;
131
+ async function waitWithTimeout(promise, taskName, timeout) {
132
+ let reject;
133
+ const timeoutError = new Errors_1.TimeoutError(`waiting for ${taskName} failed: timeout ${timeout}ms exceeded`);
134
+ const timeoutPromise = new Promise((_res, rej) => {
135
+ reject = rej;
136
+ });
137
+ let timeoutTimer = null;
138
+ if (timeout) {
139
+ timeoutTimer = setTimeout(() => {
140
+ return reject(timeoutError);
141
+ }, timeout);
142
+ }
143
+ try {
144
+ return await Promise.race([promise, timeoutPromise]);
145
+ }
146
+ finally {
147
+ if (timeoutTimer) {
148
+ clearTimeout(timeoutTimer);
149
+ }
150
+ }
151
+ }
152
+ exports.waitWithTimeout = waitWithTimeout;
153
+ function isErrorLike(obj) {
154
+ return (typeof obj === 'object' && obj !== null && 'name' in obj && 'message' in obj);
155
+ }
156
+ exports.isErrorLike = isErrorLike;
157
+ function isErrnoException(obj) {
158
+ return (isErrorLike(obj) &&
159
+ ('errno' in obj || 'code' in obj || 'path' in obj || 'syscall' in obj));
160
+ }
161
+ exports.isErrnoException = isErrnoException;
@@ -1,4 +1,4 @@
1
- import { ConsoleMessageLocation, ConsoleMessageType } from 'puppeteer-core';
1
+ import type { ConsoleMessageLocation, ConsoleMessageType } from 'puppeteer-core';
2
2
  export declare type BrowserLog = {
3
3
  text: string;
4
4
  stackTrace: ConsoleMessageLocation[];
@@ -1,4 +1,4 @@
1
- import { MediaAsset } from './assets/types';
1
+ import type { MediaAsset } from './assets/types';
2
2
  export declare const calculateFfmpegFilter: ({ asset, fps, durationInFrames, channels, assetDuration, }: {
3
3
  asset: MediaAsset;
4
4
  fps: number;
@@ -1,2 +1,2 @@
1
- import { Codec } from 'remotion';
1
+ import type { Codec } from 'remotion';
2
2
  export declare const canUseParallelEncoding: (codec: Codec) => boolean;
@@ -1,4 +1,4 @@
1
- import { Codec } from 'remotion';
1
+ import type { Codec } from 'remotion';
2
2
  export declare const combineVideos: ({ files, filelistDir, output, onProgress, numberOfFrames, codec, fps, }: {
3
3
  files: string[];
4
4
  filelistDir: string;
@@ -1,4 +1,4 @@
1
- import { FfmpegExecutable } from 'remotion';
1
+ import type { FfmpegExecutable } from 'remotion';
2
2
  export declare const convertToPcm: ({ ffmpegExecutable, input, outName, }: {
3
3
  ffmpegExecutable: FfmpegExecutable;
4
4
  input: string;
@@ -1,4 +1,4 @@
1
- import { FfmpegExecutable } from 'remotion';
1
+ import type { FfmpegExecutable } from 'remotion';
2
2
  export declare const createSilentAudio: ({ ffmpegExecutable, numberOfSeconds, outName, }: {
3
3
  ffmpegExecutable: FfmpegExecutable;
4
4
  numberOfSeconds: number;
@@ -1,4 +1,4 @@
1
- import { openBrowser } from './open-browser';
1
+ import type { openBrowser } from './open-browser';
2
2
  declare type Await<T> = T extends PromiseLike<infer U> ? U : T;
3
3
  declare type Browser = Await<ReturnType<typeof openBrowser>>;
4
4
  export declare const cycleBrowserTabs: (puppeteerInstance: Browser, concurrency: number) => {
@@ -1,2 +1,2 @@
1
- import { UnsymbolicatedStackFrame } from './parse-browser-error-stack';
1
+ import type { UnsymbolicatedStackFrame } from './parse-browser-error-stack';
2
2
  export declare const parseDelayRenderEmbeddedStack: (message: string) => UnsymbolicatedStackFrame[] | null;
@@ -1 +1 @@
1
- export declare const ensurePresentationTimestamps: (src: string) => Promise<unknown>;
1
+ export declare const ensurePresentationTimestamps: (src: string) => Promise<void>;
@@ -14,7 +14,7 @@ const ensurePresentationTimestamps = async (src) => {
14
14
  return new Promise((resolve) => {
15
15
  callbacks.push({
16
16
  src,
17
- fn: () => resolve,
17
+ fn: () => resolve(),
18
18
  });
19
19
  });
20
20
  }
@@ -1,5 +1,5 @@
1
- import { Page } from 'puppeteer-core';
2
- import { SymbolicatedStackFrame } from '../symbolicate-stacktrace';
1
+ import type { Page } from 'puppeteer-core';
2
+ import type { SymbolicatedStackFrame } from '../symbolicate-stacktrace';
3
3
  export declare class ErrorWithStackFrame extends Error {
4
4
  symbolicatedStackFrames: SymbolicatedStackFrame[] | null;
5
5
  frame: number | null;
@@ -1,3 +1,3 @@
1
1
  import { ErrorWithStackFrame } from './handle-javascript-exception';
2
- import { SymbolicateableError } from './symbolicateable-error';
2
+ import type { SymbolicateableError } from './symbolicateable-error';
3
3
  export declare const symbolicateError: (symbolicateableError: SymbolicateableError) => Promise<ErrorWithStackFrame>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A symbolicateable error is an error that can be symolicated by fetching the original sources. By throwing a symbolicateable error, Remotion CLI will attempt to symplicate it
3
3
  */
4
- import { UnsymbolicatedStackFrame } from '../parse-browser-error-stack';
4
+ import type { UnsymbolicatedStackFrame } from '../parse-browser-error-stack';
5
5
  export declare class SymbolicateableError extends Error {
6
6
  stackFrame: UnsymbolicatedStackFrame[] | null;
7
7
  delayRenderCall: UnsymbolicatedStackFrame[] | null;
@@ -1,15 +1,14 @@
1
- /// <reference types="node" />
2
- import { FfmpegExecutable } from 'remotion';
3
- import { Readable } from 'stream';
4
- import { LastFrameOptions } from './last-frame-from-video-cache';
5
- export declare function streamToString(stream: Readable): Promise<string>;
1
+ import type { FfmpegExecutable, OffthreadVideoImageFormat } from 'remotion';
2
+ import type { SpecialVCodecForTransparency } from './is-vp9-video';
3
+ import type { LastFrameOptions } from './last-frame-from-video-cache';
4
+ export declare const determineVcodecFfmepgFlags: (vcodecFlag: SpecialVCodecForTransparency) => string[];
6
5
  export declare const getLastFrameOfVideo: (options: LastFrameOptions) => Promise<Buffer>;
7
6
  declare type Options = {
8
7
  time: number;
9
8
  src: string;
10
9
  ffmpegExecutable: FfmpegExecutable;
11
10
  ffprobeExecutable: FfmpegExecutable;
11
+ imageFormat: OffthreadVideoImageFormat;
12
12
  };
13
- export declare const extractFrameFromVideoFn: ({ time, src, ffmpegExecutable, ffprobeExecutable, }: Options) => Promise<Buffer>;
14
13
  export declare const extractFrameFromVideo: (options: Options) => Promise<Buffer>;
15
14
  export {};
@@ -3,42 +3,46 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.extractFrameFromVideo = exports.extractFrameFromVideoFn = exports.getLastFrameOfVideo = exports.streamToString = void 0;
6
+ exports.extractFrameFromVideo = exports.getLastFrameOfVideo = exports.determineVcodecFfmepgFlags = void 0;
7
7
  const execa_1 = __importDefault(require("execa"));
8
8
  const remotion_1 = require("remotion");
9
9
  const get_audio_channels_1 = require("./assets/get-audio-channels");
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 is_beyond_last_frame_1 = require("./is-beyond-last-frame");
13
+ const is_vp9_video_1 = require("./is-vp9-video");
13
14
  const last_frame_from_video_cache_1 = require("./last-frame-from-video-cache");
14
15
  const p_limit_1 = require("./p-limit");
15
- function streamToString(stream) {
16
- const chunks = [];
17
- return new Promise((resolve, reject) => {
18
- stream.on('data', (chunk) => chunks.push(Buffer.from(chunk)));
19
- stream.on('error', (err) => reject(err));
20
- stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
21
- });
22
- }
23
- exports.streamToString = streamToString;
24
16
  const lastFrameLimit = (0, p_limit_1.pLimit)(1);
25
17
  const mainLimit = (0, p_limit_1.pLimit)(5);
18
+ const determineVcodecFfmepgFlags = (vcodecFlag) => {
19
+ return [
20
+ vcodecFlag === 'vp9' ? '-vcodec' : null,
21
+ vcodecFlag === 'vp9' ? 'libvpx-vp9' : null,
22
+ vcodecFlag === 'vp8' ? '-vcodec' : null,
23
+ vcodecFlag === 'vp8' ? 'libvpx' : null,
24
+ ].filter(remotion_1.Internals.truthy);
25
+ };
26
+ exports.determineVcodecFfmepgFlags = determineVcodecFfmepgFlags;
26
27
  // Uses no seeking, therefore the whole video has to be decoded. This is a last resort and should only happen
27
28
  // if the video is corrupted
28
- const getLastFrameOfVideoSlow = async ({ src, duration, ffmpegExecutable, }) => {
29
- console.warn(`\nUsing a slow method to determine the last frame of ${src}. The render can be sped up by re-encoding the video properly.`);
30
- const actualOffset = `-${duration * 1000}ms`;
29
+ const getFrameOfVideoSlow = async ({ src, timestamp, ffmpegExecutable, imageFormat, specialVCodecForTransparency, }) => {
30
+ console.warn(`\nUsing a slow method to extract the frame at ${timestamp}ms of ${src}. See https://remotion.dev/docs/slow-method-to-extract-frame for advice`);
31
+ const actualOffset = `-${timestamp * 1000}ms`;
31
32
  const command = [
32
33
  '-itsoffset',
33
34
  actualOffset,
35
+ ...(0, exports.determineVcodecFfmepgFlags)(specialVCodecForTransparency),
34
36
  '-i',
35
37
  src,
36
38
  '-frames:v',
37
39
  '1',
40
+ '-c:v',
41
+ imageFormat === 'jpeg' ? 'mjpeg' : 'png',
38
42
  '-f',
39
43
  'image2pipe',
40
44
  '-',
41
- ];
45
+ ].filter(remotion_1.Internals.truthy);
42
46
  const { stdout, stderr } = (0, execa_1.default)(ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : 'ffmpeg', command);
43
47
  if (!stderr) {
44
48
  throw new Error('unexpectedly did not get stderr');
@@ -75,11 +79,13 @@ const getLastFrameOfVideoFastUnlimited = async (options) => {
75
79
  if (duration === null) {
76
80
  throw new Error(`Could not determine the duration of ${src} using FFMPEG. The file is not supported.`);
77
81
  }
78
- if (offset > 40) {
79
- const last = await getLastFrameOfVideoSlow({
80
- duration,
82
+ if (options.specialVCodecForTransparency === 'vp8' || offset > 40) {
83
+ const last = await getFrameOfVideoSlow({
84
+ timestamp: duration,
81
85
  ffmpegExecutable,
82
86
  src,
87
+ imageFormat: options.imageFormat,
88
+ specialVCodecForTransparency: options.specialVCodecForTransparency,
83
89
  });
84
90
  return last;
85
91
  }
@@ -87,14 +93,17 @@ const getLastFrameOfVideoFastUnlimited = async (options) => {
87
93
  const { stdout, stderr } = (0, execa_1.default)(ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : 'ffmpeg', [
88
94
  '-ss',
89
95
  actualOffset,
96
+ ...(0, exports.determineVcodecFfmepgFlags)(options.specialVCodecForTransparency),
90
97
  '-i',
91
98
  src,
92
99
  '-frames:v',
93
100
  '1',
101
+ '-c:v',
102
+ options.imageFormat === 'jpeg' ? 'mjpeg' : 'png',
94
103
  '-f',
95
104
  'image2pipe',
96
105
  '-',
97
- ]);
106
+ ].filter(remotion_1.Internals.truthy));
98
107
  if (!stderr) {
99
108
  throw new Error('unexpectedly did not get stderr');
100
109
  }
@@ -127,6 +136,8 @@ const getLastFrameOfVideoFastUnlimited = async (options) => {
127
136
  offset: offset + 10,
128
137
  src,
129
138
  ffprobeExecutable,
139
+ imageFormat: options.imageFormat,
140
+ specialVCodecForTransparency: options.specialVCodecForTransparency,
130
141
  });
131
142
  return unlimited;
132
143
  }
@@ -138,14 +149,28 @@ const getLastFrameOfVideo = async (options) => {
138
149
  return result;
139
150
  };
140
151
  exports.getLastFrameOfVideo = getLastFrameOfVideo;
141
- const extractFrameFromVideoFn = async ({ time, src, ffmpegExecutable, ffprobeExecutable, }) => {
152
+ const extractFrameFromVideoFn = async ({ time, src, ffmpegExecutable, ffprobeExecutable, imageFormat, }) => {
142
153
  await (0, ensure_presentation_timestamp_1.ensurePresentationTimestamps)(src);
154
+ const specialVCodecForTransparency = imageFormat === 'jpeg'
155
+ ? 'none'
156
+ : await (0, is_vp9_video_1.getSpecialVCodecForTransparency)(src, ffprobeExecutable);
157
+ if (specialVCodecForTransparency === 'vp8') {
158
+ return getFrameOfVideoSlow({
159
+ ffmpegExecutable,
160
+ imageFormat,
161
+ specialVCodecForTransparency,
162
+ src,
163
+ timestamp: time,
164
+ });
165
+ }
143
166
  if ((0, is_beyond_last_frame_1.isBeyondLastFrame)(src, time)) {
144
167
  const lastFrame = await (0, exports.getLastFrameOfVideo)({
145
168
  ffmpegExecutable,
146
169
  ffprobeExecutable,
147
170
  offset: 0,
148
171
  src,
172
+ imageFormat,
173
+ specialVCodecForTransparency,
149
174
  });
150
175
  return lastFrame;
151
176
  }
@@ -153,14 +178,17 @@ const extractFrameFromVideoFn = async ({ time, src, ffmpegExecutable, ffprobeExe
153
178
  const { stdout, stderr } = (0, execa_1.default)(ffmpegExecutable !== null && ffmpegExecutable !== void 0 ? ffmpegExecutable : 'ffmpeg', [
154
179
  '-ss',
155
180
  ffmpegTimestamp,
181
+ ...(0, exports.determineVcodecFfmepgFlags)(specialVCodecForTransparency),
156
182
  '-i',
157
183
  src,
158
184
  '-frames:v',
159
185
  '1',
160
186
  '-f',
161
187
  'image2pipe',
188
+ '-vcodec',
189
+ imageFormat === 'jpeg' ? 'mjpeg' : 'png',
162
190
  '-',
163
- ], {
191
+ ].filter(remotion_1.Internals.truthy), {
164
192
  buffer: false,
165
193
  });
166
194
  if (!stderr) {
@@ -192,15 +220,16 @@ const extractFrameFromVideoFn = async ({ time, src, ffmpegExecutable, ffprobeExe
192
220
  ffprobeExecutable,
193
221
  offset: 0,
194
222
  src,
223
+ imageFormat,
224
+ specialVCodecForTransparency,
195
225
  });
196
226
  return last;
197
227
  }
198
228
  return stdOut;
199
229
  };
200
- exports.extractFrameFromVideoFn = extractFrameFromVideoFn;
201
230
  const extractFrameFromVideo = async (options) => {
202
231
  const perf = remotion_1.Internals.perf.startPerfMeasure('extract-frame');
203
- const res = await mainLimit(exports.extractFrameFromVideoFn, options);
232
+ const res = await mainLimit(extractFrameFromVideoFn, options);
204
233
  remotion_1.Internals.perf.stopPerfMeasure(perf);
205
234
  return res;
206
235
  };
@@ -1,2 +1,2 @@
1
- import { Codec } from 'remotion';
1
+ import type { Codec } from 'remotion';
2
2
  export declare const getAudioCodecName: (codec: Codec) => string | null;
@@ -1,6 +1,6 @@
1
- import { Browser, Page } from 'puppeteer-core';
2
- import { BrowserExecutable } from 'remotion';
3
- import { ChromiumOptions } from './open-browser';
1
+ import type { Browser, Page } from 'puppeteer-core';
2
+ import type { BrowserExecutable } from 'remotion';
3
+ import type { ChromiumOptions } from './open-browser';
4
4
  export declare const getPageAndCleanupFn: ({ passedInInstance, browserExecutable, chromiumOptions, }: {
5
5
  passedInInstance: Browser | undefined;
6
6
  browserExecutable: BrowserExecutable | null;
@@ -1,2 +1,2 @@
1
- import { Codec } from 'remotion';
1
+ import type { Codec } from 'remotion';
2
2
  export declare const getCodecName: (codec: Codec) => string | null;
@@ -1,7 +1,7 @@
1
- import { Browser } from 'puppeteer-core';
2
- import { BrowserExecutable, FfmpegExecutable, TCompMetadata } from 'remotion';
3
- import { BrowserLog } from './browser-log';
4
- import { ChromiumOptions } from './open-browser';
1
+ import type { Browser } from 'puppeteer-core';
2
+ import type { BrowserExecutable, FfmpegExecutable, TCompMetadata } from 'remotion';
3
+ import type { BrowserLog } from './browser-log';
4
+ import type { ChromiumOptions } from './open-browser';
5
5
  declare type GetCompositionsConfig = {
6
6
  inputProps?: object | null;
7
7
  envVariables?: Record<string, string>;
@@ -1,2 +1,2 @@
1
- import { FrameRange } from 'remotion';
1
+ import type { FrameRange } from 'remotion';
2
2
  export declare const getDurationFromFrameRange: (frameRange: FrameRange | null, durationInFrames: number) => number;
@@ -1,2 +1,2 @@
1
- import { Codec } from 'remotion';
1
+ import type { Codec } from 'remotion';
2
2
  export declare const getFileExtensionFromCodec: (codec: Codec, type: 'chunk' | 'final') => "mp3" | "aac" | "wav" | "mp4" | "mkv" | "mov" | "webm";
@@ -1,2 +1,2 @@
1
- import { FrameRange } from 'remotion';
1
+ import type { FrameRange } from 'remotion';
2
2
  export declare const getRealFrameRange: (durationInFrames: number, frameRange: FrameRange | null) => [number, number];
@@ -1,3 +1,3 @@
1
- import { Browser, BrowserExecutable } from 'remotion';
1
+ import type { Browser, BrowserExecutable } from 'remotion';
2
2
  export declare const ensureLocalBrowser: (browser: Browser, preferredBrowserExecutable: BrowserExecutable) => Promise<void>;
3
3
  export declare const getLocalBrowserExecutable: (browser: Browser, preferredBrowserExecutable: BrowserExecutable) => string;
@@ -1,2 +1,2 @@
1
- import { Codec, ProResProfile } from 'remotion';
1
+ import type { Codec, ProResProfile } from 'remotion';
2
2
  export declare const getProResProfileName: (codec: Codec, proResProfile: ProResProfile | undefined) => string | null;
@@ -1,2 +1,2 @@
1
- import { ImageFormat } from 'remotion';
1
+ import type { ImageFormat } from 'remotion';
2
2
  export declare const DEFAULT_IMAGE_FORMAT: ImageFormat;
@@ -0,0 +1,3 @@
1
+ import type { FfmpegExecutable } from 'remotion';
2
+ export declare type SpecialVCodecForTransparency = 'vp9' | 'vp8' | 'none';
3
+ export declare const getSpecialVCodecForTransparency: (src: string, ffprobeExecutable: FfmpegExecutable) => Promise<SpecialVCodecForTransparency>;
@@ -0,0 +1,24 @@
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.getSpecialVCodecForTransparency = void 0;
7
+ const execa_1 = __importDefault(require("execa"));
8
+ const p_limit_1 = require("./p-limit");
9
+ const isVp9VideoCache = {};
10
+ const limit = (0, p_limit_1.pLimit)(1);
11
+ async function getSpecialVCodecForTransparencyUnlimited(src, ffprobeExecutable) {
12
+ if (typeof isVp9VideoCache[src] !== 'undefined') {
13
+ return isVp9VideoCache[src];
14
+ }
15
+ const task = await (0, execa_1.default)(ffprobeExecutable !== null && ffprobeExecutable !== void 0 ? ffprobeExecutable : 'ffprobe', [src]);
16
+ const isVp9 = task.stderr.includes('Video: vp9');
17
+ const isVp8 = task.stderr.includes('Video: vp8');
18
+ isVp9VideoCache[src] = isVp9 ? 'vp9' : isVp8 ? 'vp8' : 'none';
19
+ return isVp9VideoCache[src];
20
+ }
21
+ const getSpecialVCodecForTransparency = (src, ffprobeExecutable) => {
22
+ return limit(() => getSpecialVCodecForTransparencyUnlimited(src, ffprobeExecutable));
23
+ };
24
+ exports.getSpecialVCodecForTransparency = getSpecialVCodecForTransparency;