Skip to content

🎥 Make videos programmatically with React

cool

Jonny Burgerc932a1941f36
diff --git a/packages/example/src/Encoder/SrcEncoder.tsx b/packages/example/src/Encoder/SrcEncoder.tsx
index a04a147092..7bcfb8854a 100644
--- a/packages/example/src/Encoder/SrcEncoder.tsx
+++ b/packages/example/src/Encoder/SrcEncoder.tsx
@@ -1,4 +1,11 @@
-import {OnAudioTrack, OnVideoTrack, parseMedia} from '@remotion/media-parser';
+import {
+ MediaParserInternals,
+ OnAudioTrack,
+ OnVideoTrack,
+ VideoTrack,
+ parseMedia,
+} from '@remotion/media-parser';
+import {createDecoder, createEncoder} from '@remotion/webcodecs';
import React, {useCallback, useRef} from 'react';
import {flushSync} from 'react-dom';
import {AbsoluteFill} from 'remotion';
@@ -58,137 +65,105 @@ export const SrcEncoder: React.FC<{
const i = useRef(0);
- const onVideoTrack: OnVideoTrack = useCallback(async (track) => {
- if (
- typeof VideoDecoder === 'undefined' ||
- typeof VideoEncoder === 'undefined'
- ) {
- return null;
- }
-
- const {supported} = await VideoDecoder.isConfigSupported(track);
-
- if (!supported) {
- setVideoError(new DOMException('Video decoder not supported'));
- return null;
- }
-
- const encoder = new VideoEncoder({
- error(error) {
- console.error(error);
- },
- output(chunk, metadata) {
- console.log('encoded as vp8', metadata);
- },
- });
-
- encoder.configure({
- codec: 'vp8',
- height: track.displayAspectWidth,
- width: track.displayAspectHeight,
- hardwareAcceleration: 'prefer-hardware',
- });
-
- const videoDecoder = new VideoDecoder({
- async output(inputFrame) {
- encoder.encode(inputFrame);
- i.current++;
-
- if (i.current % 10 === 1) {
- const rotatedWidth =
- track.rotation === -90 || track.rotation === 90
- ? CANVAS_HEIGHT
- : CANVAS_WIDTH;
- const rotatedHeight =
- track.rotation === -90 || track.rotation === 90
- ? CANVAS_WIDTH
- : CANVAS_HEIGHT;
-
- const fitted = fitElementSizeInContainer({
- containerSize: {
- width: rotatedWidth,
- height: rotatedHeight,
- },
- elementSize: {
- width: track.displayAspectWidth,
- height: track.displayAspectHeight,
- },
- });
-
- const image = await createImageBitmap(inputFrame, {
- resizeHeight: fitted.height * 2,
- resizeWidth: fitted.width * 2,
- });
-
- if (!ref.current) {
- return;
- }
+ const onVideoFrame = useCallback(
+ async (inputFrame: VideoFrame, track: VideoTrack) => {
+ i.current++;
+
+ if (i.current % 10 === 1) {
+ const rotatedWidth =
+ track.rotation === -90 || track.rotation === 90
+ ? CANVAS_HEIGHT
+ : CANVAS_WIDTH;
+ const rotatedHeight =
+ track.rotation === -90 || track.rotation === 90
+ ? CANVAS_WIDTH
+ : CANVAS_HEIGHT;
+
+ const fitted = fitElementSizeInContainer({
+ containerSize: {
+ width: rotatedWidth,
+ height: rotatedHeight,
+ },
+ elementSize: {
+ width: track.displayAspectWidth,
+ height: track.displayAspectHeight,
+ },
+ });
- const context = ref.current.getContext('2d');
- if (!context) {
- return;
- }
- ref.current.width = CANVAS_WIDTH;
- ref.current.height = CANVAS_HEIGHT;
+ const image = await createImageBitmap(inputFrame, {
+ resizeHeight: fitted.height * 2,
+ resizeWidth: fitted.width * 2,
+ });
- if (track.rotation === -90) {
- context.rotate((-track.rotation * Math.PI) / 180);
- context.drawImage(
- image,
- fitted.left,
- -CANVAS_WIDTH / 2 - fitted.height / 2,
- fitted.width,
- fitted.height,
- );
- context.setTransform(1, 0, 0, 1, 0, 0);
- }
- // TODO: Implement 90 and 180 rotations
- else {
- context.drawImage(
- image,
- fitted.left,
- 0,
- fitted.width,
- fitted.height,
- );
- }
+ if (!ref.current) {
+ return;
}
- flushSync(() => {
- setVideoFrames((prev) => prev + 1);
- });
- inputFrame.close();
- },
- error(error) {
- setVideoError(error);
- },
- });
- videoDecoder.configure(track);
- return async (chunk) => {
+ const context = ref.current.getContext('2d');
+ if (!context) {
+ return;
+ }
+ ref.current.width = CANVAS_WIDTH;
+ ref.current.height = CANVAS_HEIGHT;
+
+ if (track.rotation === -90) {
+ context.rotate((-track.rotation * Math.PI) / 180);
+ context.drawImage(
+ image,
+ fitted.left,
+ -CANVAS_WIDTH / 2 - fitted.height / 2,
+ fitted.width,
+ fitted.height,
+ );
+ context.setTransform(1, 0, 0, 1, 0, 0);
+ }
+ // TODO: Implement 90 and 180 rotations
+ else {
+ context.drawImage(image, fitted.left, 0, fitted.width, fitted.height);
+ }
+ }
flushSync(() => {
- setSamples((s) => s + 1);
+ setVideoFrames((prev) => prev + 1);
});
+ },
+ [],
+ );
- if (videoDecoder.state === 'closed') {
- return;
+ const onVideoTrack: OnVideoTrack = useCallback(
+ async (track) => {
+ const videoEncoder = createEncoder({
+ width: track.displayAspectWidth,
+ height: track.displayAspectHeight,
+ });
+ if (videoEncoder === null) {
+ setVideoError(new DOMException('Video encoder not supported'));
+ return null;
}
- if (videoDecoder.decodeQueueSize > 10) {
- let resolve = () => {};
+ const arr = await MediaParserInternals.createMedia();
- const cb = () => {
- resolve();
- };
+ const videoDecoder = await createDecoder({
+ track,
+ onFrame: (frame) => {
+ onVideoFrame(frame, track);
+ videoEncoder.encodeFrame(frame);
+ frame.close();
+ },
+ });
+ if (videoDecoder === null) {
+ setVideoError(new DOMException('Video decoder not supported'));
+ return null;
+ }
- await new Promise<void>((r) => {
- resolve = r;
- videoDecoder.addEventListener('dequeue', cb);
+ return async (chunk) => {
+ flushSync(() => {
+ setSamples((s) => s + 1);
});
- videoDecoder.removeEventListener('dequeue', cb);
- }
- videoDecoder.decode(new EncodedVideoChunk(chunk));
- };
- }, []);
+ videoDecoder.processSample(chunk);
+ };
+ },
+ [onVideoFrame],
+ );
const onAudioTrack: OnAudioTrack = useCallback(async (track) => {
if (typeof AudioDecoder === 'undefined') {
diff --git a/packages/media-parser/package.json b/packages/media-parser/package.json
index ce8767645c..9ad75d62f2 100644
--- a/packages/media-parser/package.json
+++ b/packages/media-parser/package.json
@@ -13,7 +13,8 @@
"watch": "tsc -w"
},
"devDependencies": {
- "@remotion/renderer": "workspace:*"
+ "@remotion/renderer": "workspace:*",
+ "@types/wicg-file-system-access": "2023.10.5"
},
"publishConfig": {
"access": "public"
diff --git a/packages/media-parser/src/boxes/webm/segments/all-segments.ts b/packages/media-parser/src/boxes/webm/segments/all-segments.ts
index d70a355f27..2ff00ca1b8 100644
--- a/packages/media-parser/src/boxes/webm/segments/all-segments.ts
+++ b/packages/media-parser/src/boxes/webm/segments/all-segments.ts
@@ -661,7 +661,7 @@ export type ClusterSegment = EbmlParsed<typeof cluster>;
export type Tracks = EbmlParsed<typeof tracks>;
export type FloatWithSize = {value: number; size: '32' | '64'};
-export type UintWithSize = {value: number; byteLength: number};
+export type UintWithSize = {value: number; byteLength: number | null};
export type EbmlValue<
T extends Ebml,
@@ -687,13 +687,13 @@ export type EbmlValueOrUint8Array<T extends Ebml> =
export type EbmlParsed<T extends Ebml> = {
type: T['name'];
value: EbmlValue<T>;
- minVintWidth: number;
+ minVintWidth: number | null;
};
export type EbmlParsedOrUint8Array<T extends Ebml> = {
type: T['name'];
value: EbmlValueOrUint8Array<T>;
- minVintWidth: number;
+ minVintWidth: number | null;
};
export const ebmlMap = {
diff --git a/packages/media-parser/src/create/create-media.ts b/packages/media-parser/src/create/create-media.ts
new file mode 100644
index 0000000000..c5ea8cf1f1
--- /dev/null
+++ b/packages/media-parser/src/create/create-media.ts
@@ -0,0 +1,20 @@
+import {makeMatroskaHeader} from './matroska-header';
+
+export const createMedia = async () => {
+ const header = makeMatroskaHeader();
+
+ const handle = await window.showSaveFilePicker({
+ suggestedName: 'out.webm',
+ types: [
+ {
+ description: 'WebM video',
+ accept: {'video/webm': ['.webm']},
+ },
+ ],
+ });
+
+ const writable = await handle.createWritable();
+ await writable.write(header);
+
+ writable.close();
+};
diff --git a/packages/media-parser/src/create/matroska-header.ts b/packages/media-parser/src/create/matroska-header.ts
new file mode 100644
index 0000000000..57d18d0f58
--- /dev/null
+++ b/packages/media-parser/src/create/matroska-header.ts
@@ -0,0 +1,63 @@
+import {makeMatroskaBytes} from '../boxes/webm/make-header';
+
+export const makeMatroskaHeader = () => {
+ return makeMatroskaBytes({
+ type: 'Header',
+ value: [
+ {
+ minVintWidth: null,
+ type: 'EBMLVersion',
+ value: {
+ value: 1,
+ byteLength: null,
+ },
+ },
+ {
+ minVintWidth: null,
+ type: 'EBMLReadVersion',
+ value: {
+ value: 1,
+ byteLength: null,
+ },
+ },
+ {
+ type: 'EBMLMaxIDLength',
+ value: {
+ byteLength: null,
+ value: 4,
+ },
+ minVintWidth: null,
+ },
+ {
+ type: 'EBMLMaxSizeLength',
+ value: {
+ byteLength: null,
+ value: 8,
+ },
+ minVintWidth: null,
+ },
+ {
+ type: 'DocType',
+ value: 'webm',
+ minVintWidth: null,
+ },
+ {
+ type: 'DocTypeVersion',
+ value: {
+ byteLength: null,
+ value: 4,
+ },
+ minVintWidth: null,
+ },
+ {
+ type: 'DocTypeReadVersion',
+ value: {
+ byteLength: null,
+ value: 2,
+ },
+ minVintWidth: null,
+ },
+ ],
+ minVintWidth: null,
+ });
+};
diff --git a/packages/media-parser/src/index.ts b/packages/media-parser/src/index.ts
index 83293e67aa..f5b0703c95 100644
--- a/packages/media-parser/src/index.ts
+++ b/packages/media-parser/src/index.ts
@@ -1,3 +1,6 @@
+import {createMedia} from './create/create-media';
+
+export {AudioTrack, OtherTrack, Track, VideoTrack} from './get-tracks';
export {parseMedia} from './parse-media';
export {
AudioSample,
@@ -7,3 +10,7 @@ export {
OnVideoTrack,
VideoSample,
} from './webcodec-sample-types';
+
+export const MediaParserInternals = {
+ createMedia,
+};
diff --git a/packages/webcodecs/package.json b/packages/webcodecs/package.json
index 45f09fe568..fa9b953180 100644
--- a/packages/webcodecs/package.json
+++ b/packages/webcodecs/package.json
@@ -20,9 +20,7 @@
],
"author": "Jonny Burger <[email protected]>",
"license": "SEE LICENSE IN LICENSE.md",
- "dependencies": {
- "mp4box": "0.5.2"
- },
+ "dependencies": {},
"peerDependencies": {},
"devDependencies": {
"@remotion/media-parser": "workspace:*",
diff --git a/packages/webcodecs/src/create-audio-decoder.ts b/packages/webcodecs/src/create-audio-decoder.ts
deleted file mode 100644
index 0e98aacc8a..0000000000
--- a/packages/webcodecs/src/create-audio-decoder.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-export const createAudioDecoder = ({
- onProgress,
- onFrame,
-}: {
- onProgress: (decoded: number) => void;
- onFrame: (frame: AudioData) => void;
-}) => {
- let decodedFrames = 0;
-
- const decoder = new AudioDecoder({
- output(inputFrame) {
- onFrame(inputFrame);
- inputFrame.close();
-
- onProgress(++decodedFrames);
- },
- error(error) {
- console.error(error);
- },
- });
-
- return {decoder};
-};
diff --git a/packages/webcodecs/src/create-encoder.ts b/packages/webcodecs/src/create-encoder.ts
deleted file mode 100644
index 20c734a575..0000000000
--- a/packages/webcodecs/src/create-encoder.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import {createFile} from 'mp4box';
-
-const timescale = 90000;
-
-export const createEncoder = ({
- width,
- height,
- onProgress,
-}: {
- width: number;
- height: number;
- onProgress: (encoded: number) => void;
-}) => {
- let trackID: number | null = null;
-
- let encodedFrames = 0;
-
- const outputMp4 = createFile();
-
- const encoder = new VideoEncoder({
- output(chunk, metadata) {
- const uint8 = new Uint8Array(chunk.byteLength);
- chunk.copyTo(uint8);
-
- if (trackID === null) {
- trackID = outputMp4.addTrack({
- width,
- height,
- timescale,
- avcDecoderConfigRecord: (
- metadata!.decoderConfig as VideoDecoderConfig
- ).description,
- });
- }
-
- if (chunk.duration === null) {
- throw new Error('No duration in the chunk');
- }
-
- const sampleDuration = chunk.duration / (1_000_000 / timescale);
-
- outputMp4.addSample(trackID, uint8, {
- duration: sampleDuration,
- is_sync: chunk.type === 'key',
- });
-
- encodedFrames++;
- onProgress(encodedFrames);
- },
- error(error) {
- console.error(error);
- },
- });
-
- encoder.configure({
- codec: 'avc1.4d0034',
- width,
- height,
- hardwareAcceleration: 'prefer-hardware',
- bitrate: 20_000_000,
- });
-
- return {encoder, outputMp4};
-};
diff --git a/packages/webcodecs/src/create-video-decoder.ts b/packages/webcodecs/src/create-video-decoder.ts
deleted file mode 100644
index b4eb6cc0a7..0000000000
--- a/packages/webcodecs/src/create-video-decoder.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-export const createVideoDecoder = ({
- onProgress,
- onFrame,
-}: {
- onProgress: (decoded: number) => void;
- onFrame: (frame: VideoFrame) => void;
-}) => {
- let decodedFrames = 0;
-
- const decoder = new VideoDecoder({
- output(inputFrame) {
- onFrame(inputFrame);
- inputFrame.close();
-
- onProgress(++decodedFrames);
- },
- error(error) {
- console.error(error);
- },
- });
-
- return {decoder};
-};
diff --git a/packages/webcodecs/src/decoder.ts b/packages/webcodecs/src/decoder.ts
new file mode 100644
index 0000000000..3fdacc5bab
--- /dev/null
+++ b/packages/webcodecs/src/decoder.ts
@@ -0,0 +1,43 @@
+import type {VideoSample, VideoTrack} from '@remotion/media-parser';
+import {decoderWaitForDequeue} from './wait-for-dequeue';
+
+export const createDecoder = async ({
+ track,
+ onFrame,
+}: {
+ track: VideoTrack;
+ onFrame: (frame: VideoFrame) => void;
+}) => {
+ if (typeof VideoDecoder === 'undefined') {
+ return null;
+ }
+
+ const {supported} = await VideoDecoder.isConfigSupported(track);
+
+ if (!supported) {
+ return null;
+ }
+
+ const videoDecoder = new VideoDecoder({
+ output(inputFrame) {
+ onFrame(inputFrame);
+ },
+ error(error) {
+ console.error(error);
+ },
+ });
+
+ videoDecoder.configure(track);
+
+ return {
+ processSample: async (sample: VideoSample) => {
+ if (videoDecoder.state === 'closed') {
+ return;
+ }
+
+ await decoderWaitForDequeue(videoDecoder);
+
+ videoDecoder.decode(new EncodedVideoChunk(sample));
+ },
+ };
+};
diff --git a/packages/webcodecs/src/encoder.ts b/packages/webcodecs/src/encoder.ts
new file mode 100644
index 0000000000..c267174184
--- /dev/null
+++ b/packages/webcodecs/src/encoder.ts
@@ -0,0 +1,33 @@
+export const createEncoder = ({
+ width,
+ height,
+}: {
+ width: number;
+ height: number;
+}) => {
+ if (typeof VideoEncoder === 'undefined') {
+ return null;
+ }
+
+ const encoder = new VideoEncoder({
+ error(error) {
+ console.error(error);
+ },
+ output(chunk, metadata) {
+ console.log('encoded as vp8', chunk, chunk, metadata?.decoderConfig);
+ },
+ });
+
+ // TODO: Enable hardware acceleration if possible
+ encoder.configure({
+ codec: 'vp8',
+ height,
+ width,
+ });
+
+ return {
+ encodeFrame: (_frame: VideoFrame) => {
+ // encoder.encode(frame);
+ },
+ };
+};
diff --git a/packages/webcodecs/src/get-description.ts b/packages/webcodecs/src/get-description.ts
deleted file mode 100644
index 91e9f030c6..0000000000
--- a/packages/webcodecs/src/get-description.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import type {MP4File, MP4MediaTrack} from 'mp4box';
-import {DataStream} from 'mp4box';
-
-export const getDescription = ({
- mp4File,
- track,
-}: {
- mp4File: MP4File;
- track: MP4MediaTrack;
-}) => {
- const trak = mp4File.getTrackById(track.id);
- for (const entry of trak.mdia.minf.stbl.stsd.entries) {
- if (entry.avcC || entry.hvcC) {
- const stream = new DataStream(undefined, 0, DataStream.BIG_ENDIAN);
- if (entry.avcC) {
- entry.avcC.write(stream);
- } else if (entry.hvcC) {
- entry.hvcC.write(stream);
- }
-
- return new Uint8Array(stream.buffer, 8); // Remove the box header.
- }
- }
-};
diff --git a/packages/webcodecs/src/get-samples.ts b/packages/webcodecs/src/get-samples.ts
deleted file mode 100644
index 27963c473f..0000000000
--- a/packages/webcodecs/src/get-samples.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import type {MP4File, MP4MediaTrack, Sample} from 'mp4box';
-
-export const getSamples = ({
- mp4File,
- track,
-}: {
- mp4File: MP4File;
- track: MP4MediaTrack;
-}) => {
- mp4File.setExtractionOptions(track.id, null, {
- nbSamples: Infinity,
- });
-
- return new Promise<Sample[]>((resolve, reject) => {
- mp4File.onSamples = (track_id, _ref, samples) => {
- if (track_id === track.id) {
- resolve(samples);
- mp4File.onSamples = undefined;
- mp4File.onError = undefined;
- }
- };
-
- mp4File.onError = (e) => {
- reject(e);
- mp4File.onSamples = undefined;
- mp4File.onError = undefined;
- };
-
- mp4File.start();
- });
-};
diff --git a/packages/webcodecs/src/index.ts b/packages/webcodecs/src/index.ts
index 97bf301056..cc16e88683 100644
--- a/packages/webcodecs/src/index.ts
+++ b/packages/webcodecs/src/index.ts
@@ -1,2 +1,2 @@
-export {reencodeVideo} from './reencode-video';
-export {parseVideo} from './video-parser';
+export {createDecoder} from './decoder';
+export {createEncoder} from './encoder';
diff --git a/packages/webcodecs/src/load-mp4-file.ts b/packages/webcodecs/src/load-mp4-file.ts
deleted file mode 100644
index d2fc232262..0000000000
--- a/packages/webcodecs/src/load-mp4-file.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import type {MP4ArrayBuffer, MP4File, MP4Info} from 'mp4box';
-import {createFile} from 'mp4box';
-
-type ReturnType = {
- mp4File: MP4File;
- info: MP4Info;
-};
-
-const readFile = (file: File): Promise<MP4ArrayBuffer> => {
- return new Promise<MP4ArrayBuffer>((resolve, reject) => {
- const reader = new FileReader();
- reader.onload = () => {
- (reader.result as MP4ArrayBuffer).fileStart = 0;
- resolve(reader.result as MP4ArrayBuffer);
- reader.onerror = null;
- reader.onload = null;
- };
-
- reader.onerror = (error) => {
- reject(error);
- reader.onerror = null;
- reader.onload = null;
- };
-
- reader.readAsArrayBuffer(file);
- });
-};
-
-export const loadMp4File = async (file: File) => {
- const mp4File = createFile();
-
- const arrayBuffer = await readFile(file);
-
- const prom = new Promise<ReturnType>((resolve, reject) => {
- mp4File.onError = (error) => {
- reject(error);
- };
-
- mp4File.onReady = (info) => {
- resolve({mp4File, info});
- };
- });
-
- mp4File.appendBuffer(arrayBuffer);
- mp4File.flush();
-
- return prom;
-};
diff --git a/packages/webcodecs/src/reencode-video.ts b/packages/webcodecs/src/reencode-video.ts
deleted file mode 100644
index 116a1a8e3f..0000000000
--- a/packages/webcodecs/src/reencode-video.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import {createEncoder} from './create-encoder';
-import {createVideoDecoder} from './create-video-decoder';
-import {getDescription} from './get-description';
-import {getSamples} from './get-samples';
-import {loadMp4File} from './load-mp4-file';
-
-export const reencodeVideo = async (file: File) => {
- const {info, mp4File} = await loadMp4File(file);
- const track = info.videoTracks[0];
-
- if (!track) {
- throw new Error('No video track found in the file');
- }
-
- const {encoder, outputMp4} = createEncoder({
- width: track.track_width,
- height: track.track_height,
- onProgress: (encoded) => {
- const encodingProgress = Math.round((100 * encoded) / track.nb_samples);
- console.log(`Encoding frame ${encoded} (${encodingProgress}%)`);
- },
- });
- let nextKeyFrameTimestamp = 0;
- let keyFrame = false;
-
- const keyFrameEveryHowManySeconds = 2;
-
- const {decoder} = createVideoDecoder({
- onFrame: (frame) => {
- if (frame.timestamp >= nextKeyFrameTimestamp) {
- keyFrame = true;
-
- nextKeyFrameTimestamp =
- frame.timestamp + keyFrameEveryHowManySeconds * 1e6;
- }
-
- encoder.encode(frame, {keyFrame});
- frame.close();
- },
- onProgress: (decoded) => {
- const decodingProgress = Math.round((100 * decoded) / track.nb_samples);
- console.log(`Decoding frame ${decoded} (${decodingProgress}%)`);
- },
- });
-
- decoder.configure({
- codec: track.codec,
- codedWidth: track.track_width,
- codedHeight: track.track_height,
- // TODO: Check first if hardware acceleration is supported
- hardwareAcceleration: 'prefer-hardware',
- description: getDescription({mp4File, track}),
- });
-
- const samples = await getSamples({mp4File, track});
- console.log(samples);
-
- for (const sample of samples) {
- const duration = (sample.duration * 1_000_000) / sample.timescale;
- const timestamp = (sample.cts * 1_000_000) / sample.timescale;
-
- const chunk = new EncodedVideoChunk({
- type: sample.is_sync ? 'key' : 'delta',
- timestamp,
- duration,
- data: sample.data,
- });
-
- decoder.decode(chunk);
- }
-
- await decoder.flush();
- await encoder.flush();
- encoder.close();
- decoder.close();
-
- outputMp4.save('mp4box.mp4');
-};
diff --git a/packages/webcodecs/src/types/mp4box.d.ts b/packages/webcodecs/src/types/mp4box.d.ts
deleted file mode 100644
index f378615bc1..0000000000
--- a/packages/webcodecs/src/types/mp4box.d.ts
+++ /dev/null
@@ -1,1915 +0,0 @@
-/* eslint-disable @typescript-eslint/no-use-before-define */
-// https://github.com/gpac/mp4box.js/issues/233
-
-declare module 'mp4box' {
- export interface MP4MediaTrack {
- id: number;
- created: Date;
- modified: Date;
- movie_duration: number;
- layer: number;
- alternate_group: number;
- volume: number;
- track_width: number;
- track_height: number;
- timescale: number;
- duration: number;
- bitrate: number;
- codec: string;
- language: string;
- nb_samples: number;
- }
-
- export interface MP4VideoData {
- width: number;
- height: number;
- }
-
- export interface MP4VideoTrack extends MP4MediaTrack {
- video: MP4VideoData;
- }
-
- export interface MP4AudioData {
- sample_rate: number;
- channel_count: number;
- sample_size: number;
- }
-
- export interface MP4AudioTrack extends MP4MediaTrack {
- audio: MP4AudioData;
- }
-
- export type MP4Track = MP4VideoTrack | MP4AudioTrack;
-
- export interface MP4Info {
- duration: number;
- timescale: number;
- fragment_duration: number;
- isFragmented: boolean;
- isProgressive: boolean;
- hasIOD: boolean;
- brands: string[];
- created: Date;
- modified: Date;
- tracks: MP4Track[];
- mime: string;
- audioTracks: MP4AudioTrack[];
- videoTracks: MP4VideoTrack[];
- }
-
- export type MP4ArrayBuffer = ArrayBuffer & {fileStart: number};
-
- export interface MP4File {
- onMoovStart?: () => void;
- onReady?: (info: MP4Info) => void;
- onError?: (e: string) => void;
- onSamples?: (id: number, user: any, samples: Sample[]) => void;
-
- appendBuffer(data: MP4ArrayBuffer): number;
- start(): void;
- stop(): void;
- flush(): void;
-
- addTrack(options?: TrackOptions): number;
- addSample(
- track: number,
- data: ArrayBuffer,
- options?: SampleOptions,
- ): Sample;
- save(filename: string): void;
-
- setExtractionOptions(
- id: number,
- user: any,
- options: ExtractionOptions,
- ): void;
-
- getTrackById(id: number): BoxParser.trakBox;
- }
-
- export function createFile(): MP4File;
-
- export interface Sample {
- number: number;
- track_id: number;
- timescale: number;
- description_index: number;
- description: {
- avcC?: BoxParser.avcCBox; // h.264
- hvcC?: BoxParser.hvcCBox; // hevc
- vpcC?: BoxParser.vpcCBox; // vp9
- av1C?: BoxParser.av1CBox; // av1
- };
- data: ArrayBuffer;
- size: number;
- alreadyRead?: number;
- duration: number;
- cts: number;
- dts: number;
- is_sync: boolean;
- is_leading?: number;
- depends_on?: number;
- is_depended_on?: number;
- has_redundancy?: number;
- degradation_priority?: number;
- offset?: number;
- subsamples?: any;
- }
-
- export interface ExtractionOptions {
- nbSamples: number;
- }
-
- export class DataStream {
- // WARNING, the default is little endian, which is not what MP4 uses.
- constructor(
- buffer?: ArrayBuffer,
- byteOffset?: number,
- endianness?: boolean,
- );
-
- getPosition(): number;
-
- get byteLength(): number;
- get buffer(): ArrayBuffer;
- set buffer(v: ArrayBuffer);
- get byteOffset(): number;
- set byteOffset(v: number);
- get dataView(): DataView;
- set dataView(v: DataView);
-
- seek(pos: number): void;
- isEof(): boolean;
-
- mapFloat32Array(length: number, e?: boolean): any;
- mapFloat64Array(length: number, e?: boolean): any;
- mapInt16Array(length: number, e?: boolean): any;
- mapInt32Array(length: number, e?: boolean): any;
- mapInt8Array(length: number): any;
- mapUint16Array(length: number, e?: boolean): any;
- mapUint32Array(length: number, e?: boolean): any;
- mapUint8Array(length: number): any;
-
- readInt32Array(length: number, endianness?: boolean): Int32Array;
- readInt16Array(length: number, endianness?: boolean): Int16Array;
- readInt8Array(length: number): Int8Array;
- readUint32Array(length: number, endianness?: boolean): Uint32Array;
- readUint16Array(length: number, endianness?: boolean): Uint16Array;
- readUint8Array(length: number): Uint8Array;
- readFloat64Array(length: number, endianness?: boolean): Float64Array;
- readFloat32Array(length: number, endianness?: boolean): Float32Array;
-
- readInt32(endianness?: boolean): number;
- readInt16(endianness?: boolean): number;
- readInt8(): number;
- readUint32(endianness?: boolean): number;
- // readUint32Array(length: any, e: any): any
- readUint24(): number;
- readUint16(endianness?: boolean): number;
- readUint8(): number;
- // readUint64(): any
- readFloat32(endianness?: boolean): number;
- readFloat64(endianness?: boolean): number;
- // readCString(length: number): any
- // readString(length: number, encoding: any): any
-
- static endianness: boolean;
-
- memcpy(
- dst: ArrayBufferLike,
- dstOffset: number,
- src: ArrayBufferLike,
- srcOffset: number,
- byteLength: number,
- ): void;
-
- // TODO I got bored porting all functions
-
- save(filename: string): void;
- shift(offset: number): void;
-
- writeInt32Array(arr: Int32Array, endianness?: boolean): void;
- writeInt16Array(arr: Int16Array, endianness?: boolean): void;
- writeInt8Array(arr: Int8Array): void;
- writeUint32Array(arr: Uint32Array, endianness?: boolean): void;
- writeUint16Array(arr: Uint16Array, endianness?: boolean): void;
- writeUint8Array(arr: Uint8Array): void;
- writeFloat64Array(arr: Float64Array, endianness?: boolean): void;
- writeFloat32Array(arr: Float32Array, endianness?: boolean): void;
- writeInt32(v: number, endianness?: boolean): void;
- writeInt16(v: number, endianness?: boolean): void;
- writeInt8(v: number): void;
- writeUint32(v: number, endianness?: boolean): void;
- writeUint16(v: number, endianness?: boolean): void;
- writeUint8(v: number): void;
- writeFloat32(v: number, endianness?: boolean): void;
- writeFloat64(v: number, endianness?: boolean): void;
- writeUCS2String(s: string, endianness?: boolean, length?: number): void;
- writeString(s: string, encoding?: string, length?: number): void;
- writeCString(s: string, length?: number): void;
- writeUint64(v: number): void;
- writeUint24(v: number): void;
- adjustUint32(pos: number, v: number): void;
-
- static LITTLE_ENDIAN: boolean;
- static BIG_ENDIAN: boolean;
-
- // TODO add correct types; these are exported by dts-gen
- readCString(length: any): any;
- readInt64(): any;
- readString(length: any, encoding: any): any;
- readUint64(): any;
- writeStruct(structDefinition: any, struct: any): void;
- writeType(t: any, v: any, struct: any): any;
-
- static arrayToNative(array: any, arrayIsLittleEndian: any): any;
- static flipArrayEndianness(array: any): any;
- static memcpy(
- dst: any,
- dstOffset: any,
- src: any,
- srcOffset: any,
- byteLength: any,
- ): void;
-
- static nativeToEndian(array: any, littleEndian: any): any;
- }
-
- export interface TrackOptions {
- id?: number;
- type?: string;
- width?: number;
- height?: number;
- duration?: number;
- layer?: number;
- timescale?: number;
- media_duration?: number;
- language?: string;
- hdlr?: string;
-
- // video
- avcDecoderConfigRecord?: any;
- hevcDecoderConfigRecord?: any;
-
- // audio
- balance?: number;
- channel_count?: number;
- samplesize?: number;
- samplerate?: number;
-
- // captions
- namespace?: string;
- schema_location?: string;
- auxiliary_mime_types?: string;
-
- description?: BoxParser.Box;
- description_boxes?: BoxParser.Box[];
-
- default_sample_description_index_id?: number;
- default_sample_duration?: number;
- default_sample_size?: number;
- default_sample_flags?: number;
- }
-
- export interface FileOptions {
- brands?: string[];
- timescale?: number;
- rate?: number;
- duration?: number;
- width?: number;
- }
-
- export interface SampleOptions {
- sample_description_index?: number;
- duration?: number;
- cts?: number;
- dts?: number;
- is_sync?: boolean;
- is_leading?: number;
- depends_on?: number;
- is_depended_on?: number;
- has_redundancy?: number;
- degradation_priority?: number;
- subsamples?: any;
- }
-
- // TODO add the remaining functions
- // TODO move to another module
- export class ISOFile {
- constructor(stream?: DataStream);
-
- init(options?: FileOptions): ISOFile;
- addTrack(options?: TrackOptions): number;
- addSample(
- track: number,
- data: ArrayBuffer,
- options?: SampleOptions,
- ): Sample;
-
- createSingleSampleMoof(sample: Sample): BoxParser.moofBox;
-
- // helpers
- getTrackById(id: number): BoxParser.trakBox | undefined;
- getTrexById(id: number): BoxParser.trexBox | undefined;
-
- // boxes that are added to the root
- boxes: BoxParser.Box[];
- mdats: BoxParser.mdatBox[];
- moofs: BoxParser.moofBox[];
-
- ftyp?: BoxParser.ftypBox;
- moov?: BoxParser.moovBox;
-
- static writeInitializationSegment(
- ftyp: BoxParser.ftypBox,
- moov: BoxParser.moovBox,
- total_duration: number,
- sample_duration: number,
- ): ArrayBuffer;
-
- // TODO add correct types; these are exported by dts-gen
- add(name: any): any;
- addBox(box: any): any;
- appendBuffer(ab: any, last: any): any;
- buildSampleLists(): void;
- buildTrakSampleLists(trak: any): void;
- checkBuffer(ab: any): any;
- createFragment(track_id: any, sampleNumber: any, stream_: any): any;
- equal(b: any): any;
- flattenItemInfo(): void;
- flush(): void;
- getAllocatedSampleDataSize(): any;
- getBox(type: any): any;
- getBoxes(type: any, returnEarly: any): any;
- getBuffer(): any;
- getCodecs(): any;
- getInfo(): any;
- getItem(item_id: any): any;
- getMetaHandler(): any;
- getPrimaryItem(): any;
- getSample(trak: any, sampleNum: any): any;
- getTrackSample(track_id: any, number: any): any;
- getTrackSamplesInfo(track_id: any): any;
- hasIncompleteMdat(): any;
- hasItem(name: any): any;
- initializeSegmentation(): any;
- itemToFragmentedTrackFile(_options: any): any;
- parse(): void;
- print(output: any): void;
- processIncompleteBox(ret: any): any;
- processIncompleteMdat(): any;
- processItems(callback: any): void;
- processSamples(last: any): void;
- releaseItem(item_id: any): any;
- releaseSample(trak: any, sampleNum: any): any;
- releaseUsedSamples(id: any, sampleNum: any): void;
- resetTables(): void;
- restoreParsePosition(): any;
- save(name: any): void;
- saveParsePosition(): void;
- seek(time: any, useRap: any): any;
- seekTrack(time: any, useRap: any, trak: any): any;
- setExtractionOptions(id: any, user: any, options: any): void;
- setSegmentOptions(id: any, user: any, options: any): void;
- start(): void;
- stop(): void;
- unsetExtractionOptions(id: any): void;
- unsetSegmentOptions(id: any): void;
- updateSampleLists(): void;
- updateUsedBytes(box: any, ret: any): void;
- write(outstream: any): void;
-
- static initSampleGroups(
- trak: any,
- traf: any,
- sbgps: any,
- trak_sgpds: any,
- traf_sgpds: any,
- ): void;
-
- static process_sdtp(sdtp: any, sample: any, number: any): void;
- static setSampleGroupProperties(
- trak: any,
- sample: any,
- sample_number: any,
- sample_groups_info: any,
- ): void;
- }
-
- export namespace BoxParser {
- export class Box {
- size?: number;
- data?: Uint8Array;
-
- constructor(type?: string, size?: number);
-
- add(name: string): Box;
- addBox(box: Box): Box;
- set(name: string, value: any): void;
- addEntry(value: string, prop?: string): void;
- printHeader(output: any): void;
- write(stream: DataStream): void;
- writeHeader(stream: DataStream, msg?: string): void;
- computeSize(): void;
-
- // TODO add types for these
- parse(stream: any): void;
- parseDataAndRewind(stream: any): void;
- parseLanguage(stream: any): void;
- print(output: any): void;
- }
-
- // TODO finish add types for these classes
- export class AudioSampleEntry extends SampleEntry {
- constructor(type: any, size: any);
-
- getChannelCount(): any;
- getSampleRate(): any;
- getSampleSize(): any;
- isAudio(): any;
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class CoLLBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class ContainerBox extends Box {
- constructor(type: any, size: any, uuid: any);
-
- parse(stream: any): void;
- print(output: any): void;
- write(stream: any): void;
- }
-
- export class FullBox extends Box {
- constructor(type: any, size: any, uuid: any);
-
- parse(stream: any): void;
- parseDataAndRewind(stream: any): void;
- parseFullHeader(stream: any): void;
- printHeader(output: any): void;
- writeHeader(stream: any): void;
- }
-
- export class SampleEntry extends Box {
- constructor(type: any, size: any, hdr_size: any, start: any);
-
- getChannelCount(): any;
- getCodec(): any;
- getHeight(): any;
- getSampleRate(): any;
- getSampleSize(): any;
- getWidth(): any;
- isAudio(): any;
- isHint(): any;
- isMetadata(): any;
- isSubtitle(): any;
- isVideo(): any;
- parse(stream: any): void;
- parseDataAndRewind(stream: any): void;
- parseFooter(stream: any): void;
- parseHeader(stream: any): void;
- write(stream: any): void;
- writeFooter(stream: any): void;
- writeHeader(stream: any): void;
- }
-
- export class HintSampleEntry extends SampleEntry {
- constructor(type: any, size: any);
- }
-
- export class MetadataSampleEntry extends SampleEntry {
- constructor(type: any, size: any);
-
- isMetadata(): any;
- }
-
- export class OpusSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class SampleGroupEntry {
- constructor(type: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class SingleItemTypeReferenceBox extends ContainerBox {
- constructor(type: any, size: any, hdr_size: any, start: any);
-
- parse(stream: any): void;
- }
-
- export class SingleItemTypeReferenceBoxLarge {
- constructor(type: any, size: any, hdr_size: any, start: any);
-
- parse(stream: any): void;
- }
-
- export class SmDmBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class SubtitleSampleEntry extends SampleEntry {
- constructor(type: any, size: any);
-
- isSubtitle(): any;
- }
-
- export class SystemSampleEntry extends SampleEntry {
- constructor(type: any, size: any);
- }
-
- export class TextSampleEntry extends SampleEntry {
- constructor(type: any, size: any);
- }
-
- export class TrackGroupTypeBox extends FullBox {
- constructor(type: any, size: any);
-
- parse(stream: any): void;
- }
-
- export class TrackReferenceTypeBox extends ContainerBox {
- constructor(type: any, size: any, hdr_size: any, start: any);
-
- parse(stream: any): void;
-
- write(stream: any): void;
- }
-
- export class VisualSampleEntry extends SampleEntry {
- constructor(type: any, size: any);
-
- getHeight(): any;
- getWidth(): any;
- isVideo(): any;
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class a1lxBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class a1opBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class alstSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class auxCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class av01SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class av1CBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class avc1SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class avc2SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class avc3SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class avc4SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class avcCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class avllSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class avssSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class btrtBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class bxmlBox extends FullBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class clapBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class clefBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class clliBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class co64Box extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class colrBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class cprtBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class cslgBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class cttsBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- unpack(samples: any): void;
- write(stream: any): void;
- }
-
- export class dOpsBox extends ContainerBox {
- constructor(size?: number);
-
- parse(stream: DataStream): void;
-
- Version: number;
- OutputChannelCount: number;
- PreSkip: number;
- InputSampleRate: number;
- OutputGain: number;
- ChannelMappingFamily: number;
-
- // When channelMappingFamily != 0
- StreamCount?: number;
- CoupledCount?: number;
- ChannelMapping?: number[];
- }
-
- export class dac3Box extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class dec3Box extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class dfLaBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class dimmBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class dinfBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class dmaxBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class dmedBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class drefBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class drepBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class dtrtSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class edtsBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class elngBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class elstBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class emsgBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class encaSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class encmSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class encsSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class enctSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class encuSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class encvSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class enofBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class esdsBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class fielBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class freeBox extends Box {
- constructor(size: any);
- }
-
- export class frmaBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class ftypBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class hdlrBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class hev1SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class hinfBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class hmhdBox extends FullBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class hntiBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class hvc1SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class hvcCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class idatBox extends Box {
- constructor(size: any);
- }
-
- export class iinfBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class ilocBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class imirBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class infeBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class iodsBox extends FullBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class ipcoBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class ipmaBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class iproBox extends FullBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class iprpBox extends ContainerBox {
- constructor(size: any);
- ipmas: ipmaBox[];
- }
-
- export class irefBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class irotBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class ispeBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class kindBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
-
- write(stream: any): void;
- }
-
- export class levaBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class lselBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class maxrBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class mdatBox extends Box {
- constructor(size: any);
- }
-
- export class mdcvBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class mdhdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
-
- write(stream: any): void;
- }
-
- export class mdiaBox extends ContainerBox {
- constructor(size: any);
- minf: minfBox;
- }
-
- export class mecoBox extends Box {
- constructor(size: any);
- }
-
- export class mehdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
-
- write(stream: any): void;
- }
-
- export class mereBox extends FullBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class metaBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class mettSampleEntry extends SampleEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class metxSampleEntry extends SampleEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class mfhdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
-
- write(stream: any): void;
- }
-
- export class mfraBox extends ContainerBox {
- constructor(size: any);
- tfras: tfraBox[];
- }
-
- export class mfroBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class minfBox extends ContainerBox {
- constructor(size: any);
- stbl: stblBox;
- }
-
- export class moofBox extends ContainerBox {
- constructor(size: any);
- trafs: trafBox[];
- }
-
- export class moovBox extends ContainerBox {
- constructor(size: any);
- traks: trakBox[];
- psshs: psshBox[];
- }
-
- export class mp4aSampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class msrcTrackGroupTypeBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class mvexBox extends ContainerBox {
- constructor(size: any);
-
- trexs: trexBox[];
- }
-
- export class mvhdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- print(output: any): void;
- write(stream: any): void;
- }
-
- export class mvifSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class nmhdBox extends FullBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class npckBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class numpBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class padbBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class paspBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class paylBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class paytBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class pdinBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class pitmBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class pixiBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class pmaxBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class prftBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class profBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class prolSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class psshBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class rashSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class rinfBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class rollSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class saioBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class saizBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class sbgpBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
-
- write(stream: any): void;
- }
-
- export class sbttSampleEntry extends SampleEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class schiBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class schmBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class scifSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class scnmSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class sdtpBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class seigSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class sencBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class sgpdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class sidxBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class sinfBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class skipBox extends Box {
- constructor(size: any);
- }
-
- export class smhdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class ssixBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class stblBox extends ContainerBox {
- constructor(size: any);
-
- sgpds: sgpdBox[];
- sbgps: sbgpBox[];
- stsd: stsdBox;
- }
-
- export class stcoBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- unpack(samples: any): void;
- write(stream: any): void;
- }
-
- export class stdpBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class sthdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class stppSampleEntry extends SampleEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class strdBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class striBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class strkBox extends Box {
- constructor(size: any);
- }
-
- export class stsaSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class stscBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- unpack(samples: any): void;
- write(stream: any): void;
- }
-
- export class stsdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- entries: Iterable<{
- avcC?: avcCBox;
- hvcC?: hvcCBox;
- }>;
- }
-
- export class stsgBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class stshBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class stssBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class stszBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- unpack(samples: any): void;
- write(stream: any): void;
- }
-
- export class sttsBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- unpack(samples: any): void;
- write(stream: any): void;
- }
-
- export class stviBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class stxtSampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- parse(stream: any): void;
- }
-
- export class stypBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class stz2Box extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class subsBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class syncSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class taptBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class teleSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tencBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tfdtBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class tfhdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class tfraBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tkhdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- print(output: any): void;
- write(stream: any): void;
- }
-
- export class tmaxBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tminBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class totlBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tpayBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tpylBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class trafBox extends ContainerBox {
- constructor(size: any);
- truns: trunBox[];
- sgpd: sgpdBox[];
- sbgp: sbgpBox[];
- }
-
- export class trakBox extends ContainerBox {
- constructor(size: any);
- mdia: mdiaBox;
- }
-
- export class trefBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class trepBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class trexBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class trgrBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class trpyBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class trunBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class tsasSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tsclSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tselBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class tx3gSampleEntry extends SampleEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class txtCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class udtaBox extends ContainerBox {
- constructor(size: any);
- kinds: kindBox[];
- }
-
- export class viprSampleGroupEntry extends SampleGroupEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class vmhdBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- write(stream: any): void;
- }
-
- export class vp08SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class vp09SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class vpcCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class vttCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class vttcBox extends ContainerBox {
- constructor(size: any);
- }
-
- export class vvc1SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class vvcCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class vvcNSampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class vvi1SampleEntry extends SampleEntry {
- constructor(size: any);
-
- getCodec(): any;
- }
-
- export class vvnCBox extends ContainerBox {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export class vvs1SampleEntry extends SampleEntry {
- constructor(size: any);
- }
-
- export class wvttSampleEntry extends SampleEntry {
- constructor(size: any);
-
- parse(stream: any): void;
- }
-
- export const BASIC_BOXES: string[];
- export const CONTAINER_BOXES: string[][];
- export const DIFF_BOXES_PROP_NAMES: string[];
- export const DIFF_PRIMITIVE_ARRAY_PROP_NAMES: string[];
- export const ERR_INVALID_DATA: number;
- export const ERR_NOT_ENOUGH_DATA: number;
- export const FULL_BOXES: string[];
- export const OK: number;
- export const SAMPLE_ENTRY_TYPE_AUDIO: string;
- export const SAMPLE_ENTRY_TYPE_HINT: string;
- export const SAMPLE_ENTRY_TYPE_METADATA: string;
- export const SAMPLE_ENTRY_TYPE_SUBTITLE: string;
- export const SAMPLE_ENTRY_TYPE_SYSTEM: string;
- export const SAMPLE_ENTRY_TYPE_TEXT: string;
- export const SAMPLE_ENTRY_TYPE_VISUAL: string;
- export const TFHD_FLAG_BASE_DATA_OFFSET: number;
- export const TFHD_FLAG_DEFAULT_BASE_IS_MOOF: number;
- export const TFHD_FLAG_DUR_EMPTY: number;
- export const TFHD_FLAG_SAMPLE_DESC: number;
- export const TFHD_FLAG_SAMPLE_DUR: number;
- export const TFHD_FLAG_SAMPLE_FLAGS: number;
- export const TFHD_FLAG_SAMPLE_SIZE: number;
- export const TKHD_FLAG_ENABLED: number;
- export const TKHD_FLAG_IN_MOVIE: number;
- export const TKHD_FLAG_IN_PREVIEW: number;
- export const TRUN_FLAGS_CTS_OFFSET: number;
- export const TRUN_FLAGS_DATA_OFFSET: number;
- export const TRUN_FLAGS_DURATION: number;
- export const TRUN_FLAGS_FIRST_FLAG: number;
- export const TRUN_FLAGS_FLAGS: number;
- export const TRUN_FLAGS_SIZE: number;
- export const UUIDs: string[];
- export const boxCodes: string[];
- export const containerBoxCodes: any[];
- export const fullBoxCodes: any[];
-
- export const sampleEntryCodes: {
- Audio: string[];
- Hint: any[];
- Metadata: string[];
- Subtitle: string[];
- System: string[];
- Text: string[];
- Visual: string[];
- };
-
- export const sampleGroupEntryCodes: any[];
-
- export const trackGroupTypes: any[];
-
- export function addSubBoxArrays(subBoxNames: any): void;
- export function boxEqual(box_a: any, box_b: any): any;
- export function boxEqualFields(box_a: any, box_b: any): any;
- export function createBoxCtor(type: any, parseMethod: any): void;
- export function createContainerBoxCtor(
- type: any,
- parseMethod: any,
- subBoxNames: any,
- ): void;
- export function createEncryptedSampleEntryCtor(
- mediaType: any,
- type: any,
- parseMethod: any,
- ): void;
- export function createFullBoxCtor(type: any, parseMethod: any): void;
- export function createMediaSampleEntryCtor(
- mediaType: any,
- parseMethod: any,
- subBoxNames: any,
- ): void;
- export function createSampleEntryCtor(
- mediaType: any,
- type: any,
- parseMethod: any,
- subBoxNames: any,
- ): void;
- export function createSampleGroupCtor(type: any, parseMethod: any): void;
- export function createTrackGroupCtor(type: any, parseMethod: any): void;
- export function createUUIDBox(
- uuid: any,
- isFullBox: any,
- isContainerBox: any,
- parseMethod: any,
- ): void;
- export function decimalToHex(d: any, padding: any): any;
- export function initialize(): void;
- export function parseHex16(stream: any): any;
- export function parseOneBox(
- stream: any,
- headerOnly: any,
- parentSize: any,
- ): any;
- export function parseUUID(stream: any): any;
-
- /* ???
- namespace UUIDBoxes {
- export class a2394f525a9b4f14a2446c427c648df4 {
- constructor(size: any)
- }
-
- export class a5d40b30e81411ddba2f0800200c9a66 {
- constructor(size: any)
-
- parse(stream: any): void
- }
-
- export class d08a4f1810f34a82b6c832d8aba183d3 {
- constructor(size: any)
-
- parse(stream: any): void
- }
-
- export class d4807ef2ca3946958e5426cb9e46a79f {
- constructor(size: any)
-
- parse(stream: any): void
- }
- }
- */
- }
-
- // TODO Add types for the remaining classes found via dts-gen
- export class MP4BoxStream {
- constructor(arrayBuffer: any);
-
- getEndPosition(): any;
- getLength(): any;
- getPosition(): any;
- isEos(): any;
- readAnyInt(size: any, signed: any): any;
- readCString(): any;
- readInt16(): any;
- readInt16Array(length: any): any;
- readInt32(): any;
- readInt32Array(length: any): any;
- readInt64(): any;
- readInt8(): any;
- readString(length: any): any;
- readUint16(): any;
- readUint16Array(length: any): any;
- readUint24(): any;
- readUint32(): any;
- readUint32Array(length: any): any;
- readUint64(): any;
- readUint8(): any;
- readUint8Array(length: any): any;
- seek(pos: any): any;
- }
-
- export class MultiBufferStream {
- constructor(buffer: any);
-
- addUsedBytes(nbBytes: any): void;
- cleanBuffers(): void;
- findEndContiguousBuf(inputindex: any): any;
- findPosition(fromStart: any, filePosition: any, markAsUsed: any): any;
- getEndFilePositionAfter(pos: any): any;
- getEndPosition(): any;
- getLength(): any;
- getPosition(): any;
- initialized(): any;
- insertBuffer(ab: any): void;
- logBufferLevel(info: any): void;
- mergeNextBuffer(): any;
- reduceBuffer(buffer: any, offset: any, newLength: any): any;
- seek(filePosition: any, fromStart: any, markAsUsed: any): any;
- setAllUsedBytes(): void;
- }
-
- export class Textin4Parser {
- constructor();
-
- parseConfig(data: any): any;
- parseSample(sample: any): any;
- }
-
- export class XMLSubtitlein4Parser {
- constructor();
-
- parseSample(sample: any): any;
- }
-
- export function MPEG4DescriptorParser(): any;
-
- export namespace BoxParser {}
-
- export namespace Log {
- export const LOG_LEVEL_ERROR = 4;
- export const LOG_LEVEL_WARNING = 3;
- export const LOG_LEVEL_INFO = 2;
- export const LOG_LEVEL_DEBUG = 1;
-
- export function debug(module: any, msg: any): void;
- export function error(module: any, msg: any): void;
- export function getDurationString(duration: any, _timescale: any): any;
- export function info(module: any, msg: any): void;
- export function log(module: any, msg: any): void;
- export function printRanges(ranges: any): any;
- export function setLogLevel(level: any): void;
- export function warn(module: any, msg: any): void;
- }
-}
diff --git a/packages/webcodecs/src/video-parser.ts b/packages/webcodecs/src/video-parser.ts
deleted file mode 100644
index d7509be5f4..0000000000
--- a/packages/webcodecs/src/video-parser.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import {parseMedia} from '@remotion/media-parser';
-import {webFileReader} from '@remotion/media-parser/web-file';
-
-export const parseVideo = async (file: File) => {
- const videoDecoder = new VideoDecoder({
- output(inputFrame) {
- console.log('frame', inputFrame);
- inputFrame.close();
- },
- error(error) {
- console.error(error);
- },
- });
-
- await parseMedia({
- src: file,
- reader: webFileReader,
- onVideoTrack: (track) => {
- videoDecoder.configure({
- ...track,
- hardwareAcceleration: 'no-preference',
- });
- return (chunk) => {
- videoDecoder.decode(new EncodedVideoChunk(chunk));
- };
- },
- onAudioTrack: (track) => {
- const audioDecoder = new AudioDecoder({
- output(inputFrame) {
- console.log('audio frame', inputFrame);
- inputFrame.close();
- },
- error(error) {
- console.error(error);
- },
- });
-
- audioDecoder.configure({
- codec: track.codec,
- sampleRate: track.sampleRate,
- numberOfChannels: track.numberOfChannels,
- description: track.description,
- });
- console.log('audio track', track);
- return (audioSample) => {
- audioDecoder.decode(new EncodedAudioChunk(audioSample));
- };
- },
- });
-};
diff --git a/packages/webcodecs/src/wait-for-dequeue.ts b/packages/webcodecs/src/wait-for-dequeue.ts
new file mode 100644
index 0000000000..ddda13ae86
--- /dev/null
+++ b/packages/webcodecs/src/wait-for-dequeue.ts
@@ -0,0 +1,35 @@
+export const decoderWaitForDequeue = async (videoDecoder: VideoDecoder) => {
+ if (videoDecoder.decodeQueueSize < 10) {
+ return;
+ }
+
+ let resolve = () => {};
+
+ const cb = () => {
+ resolve();
+ };
+
+ await new Promise<void>((r) => {
+ resolve = r;
+ videoDecoder.addEventListener('dequeue', cb);
+ });
+ videoDecoder.removeEventListener('dequeue', cb);
+};
+
+export const encoderWaitForDequeue = async (videoEncoder: VideoEncoder) => {
+ if (videoEncoder.encodeQueueSize < 10) {
+ return;
+ }
+
+ let resolve = () => {};
+
+ const cb = () => {
+ resolve();
+ };
+
+ await new Promise<void>((r) => {
+ resolve = r;
+ videoEncoder.addEventListener('dequeue', cb);
+ });
+ videoEncoder.removeEventListener('dequeue', cb);
+};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a749537343..fcdb8aec4e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1174,6 +1174,9 @@ importers:
'@remotion/renderer':
specifier: workspace:*
version: link:../renderer
+ '@types/wicg-file-system-access':
+ specifier: 2023.10.5
+ version: 2023.10.5
packages/media-utils:
dependencies:
@@ -1603,10 +1606,6 @@ importers:
version: 18.3.1([email protected])
packages/webcodecs:
- dependencies:
- mp4box:
- specifier: 0.5.2
- version: 0.5.2
devDependencies:
'@remotion/media-parser':
specifier: workspace:*
@@ -10012,6 +10011,10 @@ packages:
resolution: {integrity: sha512-szL74BnIcok9m7QwYtVmQ+EdIKwbjPANudfuvDrAF8Cljg9MKUlIoc1w5tjj9PMpeSH3U1Xnx//czQybJ0EfSw==}
+ resolution: {integrity: sha512-e9kZO9kCdLqT2h9Tw38oGv9UNzBBWaR1MzuAavxPcsV/7FJ3tWbU6RI3uB+yKIDPGLkGVbplS52ub0AcRLvrhA==}
+ dev: true
+
resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==}
dependencies:
@@ -18091,10 +18094,6 @@ packages:
pkg-types: 1.0.3
ufo: 1.3.2
- resolution: {integrity: sha512-zRmGlvxy+YdW3Dmt+TR4xPHynbxwXtAQDTN/Fo9N3LMxaUlB2C5KmZpzYyGKy4c7k4Jf3RCR0A2pm9SZELOLXw==}
- dev: false
-
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
engines: {node: '>=4'}