@remotion/webcodecs 4.0.285 → 4.0.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio-decoder-config.js +3 -0
- package/dist/audio-decoder.js +1 -1
- package/dist/convert-media.d.ts +2 -1
- package/dist/convert-media.js +3 -1
- package/dist/create/iso-base-media/codec-specific/avc1.d.ts +1 -1
- package/dist/create/iso-base-media/codec-specific/create-codec-specific-data.d.ts +1 -1
- package/dist/create/iso-base-media/codec-specific/hvc1.d.ts +1 -1
- package/dist/create/iso-base-media/codec-specific/mp4a.d.ts +1 -1
- package/dist/create/iso-base-media/create-colr.d.ts +1 -1
- package/dist/create/iso-base-media/create-ftyp.d.ts +2 -2
- package/dist/create/iso-base-media/create-ilst.d.ts +1 -1
- package/dist/create/iso-base-media/create-mdia.d.ts +1 -1
- package/dist/create/iso-base-media/create-moov.d.ts +1 -1
- package/dist/create/iso-base-media/create-mvhd.d.ts +1 -1
- package/dist/create/iso-base-media/create-trak.d.ts +1 -1
- package/dist/create/iso-base-media/create-udta.d.ts +1 -1
- package/dist/create/iso-base-media/create-url.d.ts +1 -1
- package/dist/create/iso-base-media/ilst/create-cmt.d.ts +1 -1
- package/dist/create/iso-base-media/ilst/create-too.d.ts +1 -1
- package/dist/create/iso-base-media/mdia/create-mdhd.d.ts +1 -1
- package/dist/create/iso-base-media/mp4-header.d.ts +1 -1
- package/dist/create/iso-base-media/primitives.d.ts +14 -14
- package/dist/create/iso-base-media/serialize-track.d.ts +1 -1
- package/dist/create/iso-base-media/trak/create-tkhd.d.ts +2 -2
- package/dist/create/iso-base-media/trak/mdia/create-minf.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/create-dinf.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/create-smhd.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/create-stbl.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/create-vmhd.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-ctts.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stco.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stsc.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stss.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stsz.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/create-stts.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avc1.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-avcc.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-hvcc.d.ts +1 -1
- package/dist/create/iso-base-media/trak/mdia/minf/stbl/stsd/create-pasp.d.ts +1 -1
- package/dist/create/iso-base-media/udta/create-meta.d.ts +1 -1
- package/dist/create/iso-base-media/udta/meta/create-hdlr.d.ts +1 -1
- package/dist/create/matroska/cluster-segment.d.ts +1 -1
- package/dist/create/matroska/matroska-utils.d.ts +3 -3
- package/dist/esm/index.mjs +15 -12
- package/dist/esm/web-fs.mjs +2 -4
- package/dist/get-wave-audio-decoder.d.ts +3 -1
- package/dist/get-wave-audio-decoder.js +2 -2
- package/dist/log.d.ts +5 -5
- package/dist/test/stbl.test.js +17 -7
- package/package.json +5 -5
package/dist/audio-decoder.js
CHANGED
|
@@ -8,7 +8,7 @@ const createAudioDecoder = ({ onFrame, onError, controller, config, logLevel, tr
|
|
|
8
8
|
throw new Error('Not creating audio decoder, already aborted');
|
|
9
9
|
}
|
|
10
10
|
if (config.codec === 'pcm-s16') {
|
|
11
|
-
return (0, get_wave_audio_decoder_1.getWaveAudioDecoder)({ onFrame, track });
|
|
11
|
+
return (0, get_wave_audio_decoder_1.getWaveAudioDecoder)({ onFrame, track, sampleFormat: 's16' });
|
|
12
12
|
}
|
|
13
13
|
const ioSynchronizer = (0, io_synchronizer_1.makeIoSynchronizer)({
|
|
14
14
|
logLevel,
|
package/dist/convert-media.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export type ConvertMediaOnAudioData = (options: {
|
|
|
35
35
|
audioData: AudioData;
|
|
36
36
|
track: AudioTrack;
|
|
37
37
|
}) => Promise<AudioData> | AudioData;
|
|
38
|
-
export declare const convertMedia: <F extends Options<ParseMediaFields>>({ src, onVideoFrame, onAudioData, onProgress: onProgressDoNotCallDirectly, audioCodec, container, videoCodec, controller, onAudioTrack: userAudioResolver, onVideoTrack: userVideoResolver, reader, fields, logLevel, writer, progressIntervalInMs, rotate, apiKey, resize, onAudioCodec, onContainer, onDimensions, onDurationInSeconds, onFps, onImages, onInternalStats, onIsHdr, onKeyframes, onLocation, onMetadata, onMimeType, onName, onNumberOfAudioChannels, onRotation, onSampleRate, onSize, onSlowAudioBitrate, onSlowDurationInSeconds, onSlowFps, onSlowKeyframes, onSlowNumberOfFrames, onSlowVideoBitrate, onStructure, onTracks, onUnrotatedDimensions, onVideoCodec, onM3uStreams, selectM3uStream, selectM3uAssociatedPlaylists, expectedDurationInSeconds, ...more }: {
|
|
38
|
+
export declare const convertMedia: <F extends Options<ParseMediaFields>>({ src, onVideoFrame, onAudioData, onProgress: onProgressDoNotCallDirectly, audioCodec, container, videoCodec, controller, onAudioTrack: userAudioResolver, onVideoTrack: userVideoResolver, reader, fields, logLevel, writer, progressIntervalInMs, rotate, apiKey, resize, onAudioCodec, onContainer, onDimensions, onDurationInSeconds, onFps, onImages, onInternalStats, onIsHdr, onKeyframes, onLocation, onMetadata, onMimeType, onName, onNumberOfAudioChannels, onRotation, onSampleRate, onSize, onSlowAudioBitrate, onSlowDurationInSeconds, onSlowFps, onSlowKeyframes, onSlowNumberOfFrames, onSlowVideoBitrate, onStructure, onTracks, onUnrotatedDimensions, onVideoCodec, onM3uStreams, selectM3uStream, selectM3uAssociatedPlaylists, expectedDurationInSeconds, seekingHints, ...more }: {
|
|
39
39
|
src: ParseMediaOptions<F>["src"];
|
|
40
40
|
container: ConvertMediaContainer;
|
|
41
41
|
onVideoFrame?: ConvertMediaOnVideoFrame;
|
|
@@ -57,4 +57,5 @@ export declare const convertMedia: <F extends Options<ParseMediaFields>>({ src,
|
|
|
57
57
|
resize?: ResizeOperation;
|
|
58
58
|
apiKey?: string | null;
|
|
59
59
|
fields?: F;
|
|
60
|
+
seekingHints?: ParseMediaOptions<F>["seekingHints"];
|
|
60
61
|
} & ParseMediaCallbacks) => Promise<ConvertMediaResult>;
|
package/dist/convert-media.js
CHANGED
|
@@ -21,7 +21,7 @@ const select_container_creator_1 = require("./select-container-creator");
|
|
|
21
21
|
const send_telemetry_event_1 = require("./send-telemetry-event");
|
|
22
22
|
const throttled_state_update_1 = require("./throttled-state-update");
|
|
23
23
|
const webcodecs_controller_1 = require("./webcodecs-controller");
|
|
24
|
-
const convertMedia = async function ({ src, onVideoFrame, onAudioData, onProgress: onProgressDoNotCallDirectly, audioCodec, container, videoCodec, controller = (0, webcodecs_controller_1.webcodecsController)(), onAudioTrack: userAudioResolver, onVideoTrack: userVideoResolver, reader, fields, logLevel = 'info', writer, progressIntervalInMs, rotate, apiKey, resize, onAudioCodec, onContainer, onDimensions, onDurationInSeconds, onFps, onImages, onInternalStats, onIsHdr, onKeyframes, onLocation, onMetadata, onMimeType, onName, onNumberOfAudioChannels, onRotation, onSampleRate, onSize, onSlowAudioBitrate, onSlowDurationInSeconds, onSlowFps, onSlowKeyframes, onSlowNumberOfFrames, onSlowVideoBitrate, onStructure, onTracks, onUnrotatedDimensions, onVideoCodec, onM3uStreams, selectM3uStream, selectM3uAssociatedPlaylists, expectedDurationInSeconds, ...more }) {
|
|
24
|
+
const convertMedia = async function ({ src, onVideoFrame, onAudioData, onProgress: onProgressDoNotCallDirectly, audioCodec, container, videoCodec, controller = (0, webcodecs_controller_1.webcodecsController)(), onAudioTrack: userAudioResolver, onVideoTrack: userVideoResolver, reader, fields, logLevel = 'info', writer, progressIntervalInMs, rotate, apiKey, resize, onAudioCodec, onContainer, onDimensions, onDurationInSeconds, onFps, onImages, onInternalStats, onIsHdr, onKeyframes, onLocation, onMetadata, onMimeType, onName, onNumberOfAudioChannels, onRotation, onSampleRate, onSize, onSlowAudioBitrate, onSlowDurationInSeconds, onSlowFps, onSlowKeyframes, onSlowNumberOfFrames, onSlowVideoBitrate, onStructure, onTracks, onUnrotatedDimensions, onVideoCodec, onM3uStreams, selectM3uStream, selectM3uAssociatedPlaylists, expectedDurationInSeconds, seekingHints, ...more }) {
|
|
25
25
|
if (controller._internals.signal.aborted) {
|
|
26
26
|
return Promise.reject(new media_parser_1.MediaParserAbortError('Aborted'));
|
|
27
27
|
}
|
|
@@ -173,7 +173,9 @@ const convertMedia = async function ({ src, onVideoFrame, onAudioData, onProgres
|
|
|
173
173
|
onM3uStreams: onM3uStreams ?? null,
|
|
174
174
|
selectM3uStream: selectM3uStream ?? media_parser_1.defaultSelectM3uStreamFn,
|
|
175
175
|
selectM3uAssociatedPlaylists: selectM3uAssociatedPlaylists ?? media_parser_1.defaultSelectM3uAssociatedPlaylists,
|
|
176
|
+
makeSamplesStartAtZero: false,
|
|
176
177
|
mp4HeaderSegment: null,
|
|
178
|
+
seekingHints: seekingHints ?? null,
|
|
177
179
|
})
|
|
178
180
|
.then(() => {
|
|
179
181
|
return state.waitForFinish();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Avc1Data } from './create-codec-specific-data';
|
|
2
|
-
export declare const createAvc1Data: ({ avccBox, pasp, width, height, horizontalResolution, verticalResolution, compressorName, depth, }: Avc1Data) => Uint8Array
|
|
2
|
+
export declare const createAvc1Data: ({ avccBox, pasp, width, height, horizontalResolution, verticalResolution, compressorName, depth, }: Avc1Data) => Uint8Array<ArrayBufferLike>;
|
|
@@ -30,4 +30,4 @@ export type Mp4aData = {
|
|
|
30
30
|
codecPrivate: Uint8Array | null;
|
|
31
31
|
};
|
|
32
32
|
export type CodecSpecificData = Avc1Data | Mp4aData;
|
|
33
|
-
export declare const createCodecSpecificData: (track: MakeTrackAudio | MakeTrackVideo) => Uint8Array
|
|
33
|
+
export declare const createCodecSpecificData: (track: MakeTrackAudio | MakeTrackVideo) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Hvc1Data } from './create-codec-specific-data';
|
|
2
|
-
export declare const createHvc1Data: ({ compressorName, depth, height, horizontalResolution, hvccBox, pasp, verticalResolution, width, }: Hvc1Data) => Uint8Array
|
|
2
|
+
export declare const createHvc1Data: ({ compressorName, depth, height, horizontalResolution, hvccBox, pasp, verticalResolution, width, }: Hvc1Data) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Mp4aData } from './create-codec-specific-data';
|
|
2
|
-
export declare const createMp4a: ({ sampleRate, channelCount, avgBitrate, maxBitrate, codecPrivate, }: Mp4aData) => Uint8Array
|
|
2
|
+
export declare const createMp4a: ({ sampleRate, channelCount, avgBitrate, maxBitrate, codecPrivate, }: Mp4aData) => Uint8Array<ArrayBufferLike>;
|
|
@@ -2,9 +2,9 @@ export declare const createFtyp: ({ majorBrand, minorBrand, compatibleBrands, }:
|
|
|
2
2
|
majorBrand: string;
|
|
3
3
|
minorBrand: number;
|
|
4
4
|
compatibleBrands: string[];
|
|
5
|
-
}) => Uint8Array
|
|
5
|
+
}) => Uint8Array<ArrayBufferLike>;
|
|
6
6
|
export declare const createIsoBaseMediaFtyp: ({ majorBrand, minorBrand, compatibleBrands, }: {
|
|
7
7
|
majorBrand: string;
|
|
8
8
|
minorBrand: number;
|
|
9
9
|
compatibleBrands: string[];
|
|
10
|
-
}) => Uint8Array
|
|
10
|
+
}) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createIlst: (items: Uint8Array[]) => Uint8Array
|
|
1
|
+
export declare const createIlst: (items: Uint8Array[]) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createUdta: (children: Uint8Array) => Uint8Array
|
|
1
|
+
export declare const createUdta: (children: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createUrlAtom: () => Uint8Array
|
|
1
|
+
export declare const createUrlAtom: () => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createCmt: (comment: string) => Uint8Array
|
|
1
|
+
export declare const createCmt: (comment: string) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createToo: (value: string) => Uint8Array
|
|
1
|
+
export declare const createToo: (value: string) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export declare const stringsToUint8Array: (str: string) => Uint8Array
|
|
2
|
-
export declare const numberTo32BitUIntOrInt: (num: number) => Uint8Array
|
|
3
|
-
export declare const numberTo64BitUIntOrInt: (num: number | bigint) => Uint8Array
|
|
4
|
-
export declare const numberTo32BitUIntOrIntLeading128: (num: number) => Uint8Array
|
|
5
|
-
export declare const numberTo16BitUIntOrInt: (num: number) => Uint8Array
|
|
6
|
-
export declare const setFixedPointSignedOrUnsigned1616Number: (num: number) => Uint8Array
|
|
7
|
-
export declare const setFixedPointSigned230Number: (num: number) => Uint8Array
|
|
8
|
-
export declare const addSize: (arr: Uint8Array) => Uint8Array
|
|
9
|
-
export declare const addLeading128Size: (arr: Uint8Array) => Uint8Array
|
|
10
|
-
export declare const floatTo16Point1632Bit: (number: number) => Uint8Array
|
|
11
|
-
export declare const floatTo16Point16_16Bit: (number: number) => Uint8Array
|
|
12
|
-
export declare const serializeMatrix: (matrix: number[]) => Uint8Array
|
|
13
|
-
export declare const stringToPascalString: (str: string) => Uint8Array
|
|
14
|
-
export declare const padIsoBaseMediaBytes: (data: Uint8Array, totalLength: number) => Uint8Array
|
|
1
|
+
export declare const stringsToUint8Array: (str: string) => Uint8Array<ArrayBufferLike>;
|
|
2
|
+
export declare const numberTo32BitUIntOrInt: (num: number) => Uint8Array<ArrayBuffer>;
|
|
3
|
+
export declare const numberTo64BitUIntOrInt: (num: number | bigint) => Uint8Array<ArrayBuffer>;
|
|
4
|
+
export declare const numberTo32BitUIntOrIntLeading128: (num: number) => Uint8Array<ArrayBuffer>;
|
|
5
|
+
export declare const numberTo16BitUIntOrInt: (num: number) => Uint8Array<ArrayBuffer>;
|
|
6
|
+
export declare const setFixedPointSignedOrUnsigned1616Number: (num: number) => Uint8Array<ArrayBuffer>;
|
|
7
|
+
export declare const setFixedPointSigned230Number: (num: number) => Uint8Array<ArrayBuffer>;
|
|
8
|
+
export declare const addSize: (arr: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
9
|
+
export declare const addLeading128Size: (arr: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
10
|
+
export declare const floatTo16Point1632Bit: (number: number) => Uint8Array<ArrayBuffer>;
|
|
11
|
+
export declare const floatTo16Point16_16Bit: (number: number) => Uint8Array<ArrayBuffer>;
|
|
12
|
+
export declare const serializeMatrix: (matrix: number[]) => Uint8Array<ArrayBufferLike>;
|
|
13
|
+
export declare const stringToPascalString: (str: string) => Uint8Array<ArrayBuffer>;
|
|
14
|
+
export declare const padIsoBaseMediaBytes: (data: Uint8Array, totalLength: number) => Uint8Array<ArrayBufferLike>;
|
|
15
15
|
type ThreeDMatrix = [
|
|
16
16
|
number,
|
|
17
17
|
number,
|
|
@@ -6,4 +6,4 @@ export type IsoBaseMediaTrackData = {
|
|
|
6
6
|
samplePositions: SamplePosition[];
|
|
7
7
|
timescale: number;
|
|
8
8
|
};
|
|
9
|
-
export declare const serializeTrack: ({ track, durationInUnits, samplePositions, timescale, }: IsoBaseMediaTrackData) => Uint8Array
|
|
9
|
+
export declare const serializeTrack: ({ track, durationInUnits, samplePositions, timescale, }: IsoBaseMediaTrackData) => Uint8Array<ArrayBufferLike>;
|
|
@@ -12,7 +12,7 @@ export declare const createTkhdForAudio: ({ creationTime, modificationTime, flag
|
|
|
12
12
|
duration: number;
|
|
13
13
|
volume: number;
|
|
14
14
|
timescale: number;
|
|
15
|
-
}) => Uint8Array
|
|
15
|
+
}) => Uint8Array<ArrayBufferLike>;
|
|
16
16
|
export declare const createTkhdForVideo: ({ creationTime, modificationTime, duration, trackId, volume, matrix, width, height, flags, timescale, }: {
|
|
17
17
|
creationTime: number | null;
|
|
18
18
|
modificationTime: number | null;
|
|
@@ -24,4 +24,4 @@ export declare const createTkhdForVideo: ({ creationTime, modificationTime, dura
|
|
|
24
24
|
height: number;
|
|
25
25
|
flags: number;
|
|
26
26
|
timescale: number;
|
|
27
|
-
}) => Uint8Array
|
|
27
|
+
}) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createDinf: () => Uint8Array
|
|
1
|
+
export declare const createDinf: () => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createSmhd: () => Uint8Array
|
|
1
|
+
export declare const createSmhd: () => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createVmhd: () => Uint8Array
|
|
1
|
+
export declare const createVmhd: () => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SamplePosition } from '@remotion/media-parser';
|
|
2
|
-
export declare const createCttsBox: (samplePositions: SamplePosition[]) => Uint8Array | null;
|
|
2
|
+
export declare const createCttsBox: (samplePositions: SamplePosition[]) => Uint8Array<ArrayBufferLike> | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SamplePosition } from '@remotion/media-parser';
|
|
2
|
-
export declare const createStcoAtom: (samplePositions: SamplePosition[]) => Uint8Array
|
|
2
|
+
export declare const createStcoAtom: (samplePositions: SamplePosition[]) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SamplePosition } from '@remotion/media-parser';
|
|
2
|
-
export declare const createStsc: (samplePositions: SamplePosition[]) => Uint8Array
|
|
2
|
+
export declare const createStsc: (samplePositions: SamplePosition[]) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SamplePosition } from '@remotion/media-parser';
|
|
2
|
-
export declare const createStss: (samplePositions: SamplePosition[]) => Uint8Array
|
|
2
|
+
export declare const createStss: (samplePositions: SamplePosition[]) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SamplePosition } from '@remotion/media-parser';
|
|
2
|
-
export declare const createStsz: (samplePositions: SamplePosition[]) => Uint8Array
|
|
2
|
+
export declare const createStsz: (samplePositions: SamplePosition[]) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SamplePosition } from '@remotion/media-parser';
|
|
2
|
-
export declare const createSttsAtom: (samplePositions: SamplePosition[]) => Uint8Array
|
|
2
|
+
export declare const createSttsAtom: (samplePositions: SamplePosition[]) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createStsdData: (codecSpecificData: Uint8Array) => Uint8Array
|
|
1
|
+
export declare const createStsdData: (codecSpecificData: Uint8Array) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createAvccBox: (privateData: Uint8Array | null) => Uint8Array
|
|
1
|
+
export declare const createAvccBox: (privateData: Uint8Array | null) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createHvccBox: (privateData: Uint8Array | null) => Uint8Array
|
|
1
|
+
export declare const createHvccBox: (privateData: Uint8Array | null) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPasp: (x: number, y: number) => Uint8Array
|
|
1
|
+
export declare const createPasp: (x: number, y: number) => Uint8Array<ArrayBufferLike>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createHdlr: (type: "video" | "audio" | "mdir") => Uint8Array
|
|
1
|
+
export declare const createHdlr: (type: "video" | "audio" | "mdir") => Uint8Array<ArrayBufferLike>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Ebml, EbmlValue, Prettify } from '@remotion/media-parser';
|
|
2
2
|
import { MediaParserInternals } from '@remotion/media-parser';
|
|
3
3
|
export declare const getIdForName: (name: string) => EbmlMapKey;
|
|
4
|
-
export declare const combineUint8Arrays: (arrays: Uint8Array[]) => Uint8Array
|
|
4
|
+
export declare const combineUint8Arrays: (arrays: Uint8Array[]) => Uint8Array<ArrayBufferLike>;
|
|
5
5
|
export type OffsetAndChildren = {
|
|
6
6
|
offset: number;
|
|
7
7
|
children: OffsetAndChildren[];
|
|
8
8
|
field: keyof typeof MediaParserInternals.matroskaElements;
|
|
9
9
|
};
|
|
10
10
|
export declare const incrementOffsetAndChildren: (offset: OffsetAndChildren, increment: number) => OffsetAndChildren;
|
|
11
|
-
export declare const matroskaToHex: (matrId: (typeof MediaParserInternals.matroskaElements)[keyof typeof MediaParserInternals.matroskaElements]) => Uint8Array
|
|
11
|
+
export declare const matroskaToHex: (matrId: (typeof MediaParserInternals.matroskaElements)[keyof typeof MediaParserInternals.matroskaElements]) => Uint8Array<ArrayBufferLike>;
|
|
12
12
|
export type BytesAndOffset = {
|
|
13
13
|
bytes: Uint8Array;
|
|
14
14
|
offsets: OffsetAndChildren;
|
|
@@ -20,7 +20,7 @@ export type EbmlParsedOrUint8Array<T extends Ebml> = {
|
|
|
20
20
|
minVintWidth: number | null;
|
|
21
21
|
};
|
|
22
22
|
export declare const measureEBMLVarInt: (value: number) => 2 | 1 | 5 | 4 | 3 | 6;
|
|
23
|
-
export declare const getVariableInt: (value: number, minWidth: number | null) => Uint8Array
|
|
23
|
+
export declare const getVariableInt: (value: number, minWidth: number | null) => Uint8Array<ArrayBuffer>;
|
|
24
24
|
export declare const makeMatroskaBytes: (fields: PossibleEbmlOrUint8Array) => BytesAndOffset;
|
|
25
25
|
export type PossibleEbmlOrUint8Array = Prettify<{
|
|
26
26
|
[key in keyof typeof MediaParserInternals.ebmlMap]: EbmlParsedOrUint8Array<(typeof MediaParserInternals.ebmlMap)[key]>;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -101,8 +101,7 @@ var createContent = async ({ filename }) => {
|
|
|
101
101
|
await directoryHandle.removeEntry(actualFilename, {
|
|
102
102
|
recursive: true
|
|
103
103
|
});
|
|
104
|
-
} catch {
|
|
105
|
-
}
|
|
104
|
+
} catch {}
|
|
106
105
|
};
|
|
107
106
|
await remove();
|
|
108
107
|
const fileHandle = await directoryHandle.getFileHandle(actualFilename, {
|
|
@@ -129,8 +128,7 @@ var createContent = async ({ filename }) => {
|
|
|
129
128
|
await writPromise;
|
|
130
129
|
try {
|
|
131
130
|
await writable.close();
|
|
132
|
-
} catch {
|
|
133
|
-
}
|
|
131
|
+
} catch {}
|
|
134
132
|
},
|
|
135
133
|
async getBlob() {
|
|
136
134
|
const newHandle = await directoryHandle.getFileHandle(actualFilename, {
|
|
@@ -432,13 +430,14 @@ var setRemotionImported = () => {
|
|
|
432
430
|
// src/get-wave-audio-decoder.ts
|
|
433
431
|
var getWaveAudioDecoder = ({
|
|
434
432
|
onFrame,
|
|
435
|
-
track
|
|
433
|
+
track,
|
|
434
|
+
sampleFormat
|
|
436
435
|
}) => {
|
|
437
436
|
let queue = Promise.resolve();
|
|
438
437
|
const processSample = async (audioSample) => {
|
|
439
438
|
await onFrame(new AudioData({
|
|
440
439
|
data: audioSample.data,
|
|
441
|
-
format:
|
|
440
|
+
format: sampleFormat,
|
|
442
441
|
numberOfChannels: track.numberOfChannels,
|
|
443
442
|
numberOfFrames: audioSample.data.byteLength / 2,
|
|
444
443
|
sampleRate: track.sampleRate,
|
|
@@ -692,7 +691,7 @@ var createAudioDecoder = ({
|
|
|
692
691
|
throw new Error("Not creating audio decoder, already aborted");
|
|
693
692
|
}
|
|
694
693
|
if (config.codec === "pcm-s16") {
|
|
695
|
-
return getWaveAudioDecoder({ onFrame, track });
|
|
694
|
+
return getWaveAudioDecoder({ onFrame, track, sampleFormat: "s16" });
|
|
696
695
|
}
|
|
697
696
|
const ioSynchronizer = makeIoSynchronizer({
|
|
698
697
|
logLevel,
|
|
@@ -765,8 +764,7 @@ var createAudioDecoder = ({
|
|
|
765
764
|
waitForFinish: async () => {
|
|
766
765
|
try {
|
|
767
766
|
await audioDecoder.flush();
|
|
768
|
-
} catch {
|
|
769
|
-
}
|
|
767
|
+
} catch {}
|
|
770
768
|
await queue;
|
|
771
769
|
await ioSynchronizer.waitForFinish(controller);
|
|
772
770
|
await outputQueue;
|
|
@@ -963,6 +961,9 @@ var getAudioDecoderConfig = async (config) => {
|
|
|
963
961
|
if (config.codec === "pcm-s16") {
|
|
964
962
|
return config;
|
|
965
963
|
}
|
|
964
|
+
if (config.codec === "pcm-s24") {
|
|
965
|
+
return config;
|
|
966
|
+
}
|
|
966
967
|
if (typeof AudioDecoder === "undefined") {
|
|
967
968
|
return null;
|
|
968
969
|
}
|
|
@@ -4797,8 +4798,7 @@ var throttledStateUpdate = ({
|
|
|
4797
4798
|
return {
|
|
4798
4799
|
get: () => currentState,
|
|
4799
4800
|
update: null,
|
|
4800
|
-
stopAndGetLastProgress: () => {
|
|
4801
|
-
}
|
|
4801
|
+
stopAndGetLastProgress: () => {}
|
|
4802
4802
|
};
|
|
4803
4803
|
}
|
|
4804
4804
|
let lastUpdated = null;
|
|
@@ -4895,6 +4895,7 @@ var convertMedia = async function({
|
|
|
4895
4895
|
selectM3uStream,
|
|
4896
4896
|
selectM3uAssociatedPlaylists,
|
|
4897
4897
|
expectedDurationInSeconds,
|
|
4898
|
+
seekingHints,
|
|
4898
4899
|
...more
|
|
4899
4900
|
}) {
|
|
4900
4901
|
if (controller._internals.signal.aborted) {
|
|
@@ -5048,7 +5049,9 @@ var convertMedia = async function({
|
|
|
5048
5049
|
onM3uStreams: onM3uStreams ?? null,
|
|
5049
5050
|
selectM3uStream: selectM3uStream ?? defaultSelectM3uStreamFn,
|
|
5050
5051
|
selectM3uAssociatedPlaylists: selectM3uAssociatedPlaylists ?? defaultSelectM3uAssociatedPlaylists,
|
|
5051
|
-
|
|
5052
|
+
makeSamplesStartAtZero: false,
|
|
5053
|
+
mp4HeaderSegment: null,
|
|
5054
|
+
seekingHints: seekingHints ?? null
|
|
5052
5055
|
}).then(() => {
|
|
5053
5056
|
return state.waitForFinish();
|
|
5054
5057
|
}).then(() => {
|
package/dist/esm/web-fs.mjs
CHANGED
|
@@ -7,8 +7,7 @@ var createContent = async ({ filename }) => {
|
|
|
7
7
|
await directoryHandle.removeEntry(actualFilename, {
|
|
8
8
|
recursive: true
|
|
9
9
|
});
|
|
10
|
-
} catch {
|
|
11
|
-
}
|
|
10
|
+
} catch {}
|
|
12
11
|
};
|
|
13
12
|
await remove();
|
|
14
13
|
const fileHandle = await directoryHandle.getFileHandle(actualFilename, {
|
|
@@ -35,8 +34,7 @@ var createContent = async ({ filename }) => {
|
|
|
35
34
|
await writPromise;
|
|
36
35
|
try {
|
|
37
36
|
await writable.close();
|
|
38
|
-
} catch {
|
|
39
|
-
}
|
|
37
|
+
} catch {}
|
|
40
38
|
},
|
|
41
39
|
async getBlob() {
|
|
42
40
|
const newHandle = await directoryHandle.getFileHandle(actualFilename, {
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { CreateAudioDecoderInit, WebCodecsAudioDecoder } from './audio-decoder';
|
|
2
|
-
export declare const getWaveAudioDecoder: ({ onFrame, track, }: Pick<CreateAudioDecoderInit, "onFrame" | "track">
|
|
2
|
+
export declare const getWaveAudioDecoder: ({ onFrame, track, sampleFormat, }: Pick<CreateAudioDecoderInit, "onFrame" | "track"> & {
|
|
3
|
+
sampleFormat: AudioSampleFormat;
|
|
4
|
+
}) => WebCodecsAudioDecoder;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getWaveAudioDecoder = void 0;
|
|
4
4
|
// TODO: Should also be subject to throttling
|
|
5
|
-
const getWaveAudioDecoder = ({ onFrame, track, }) => {
|
|
5
|
+
const getWaveAudioDecoder = ({ onFrame, track, sampleFormat, }) => {
|
|
6
6
|
let queue = Promise.resolve();
|
|
7
7
|
const processSample = async (audioSample) => {
|
|
8
8
|
await onFrame(new AudioData({
|
|
9
9
|
data: audioSample.data,
|
|
10
|
-
format:
|
|
10
|
+
format: sampleFormat,
|
|
11
11
|
numberOfChannels: track.numberOfChannels,
|
|
12
12
|
numberOfFrames: audioSample.data.byteLength / 2,
|
|
13
13
|
sampleRate: track.sampleRate,
|
package/dist/log.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { LogLevel } from '@remotion/media-parser';
|
|
2
2
|
declare const Log: {
|
|
3
|
-
trace: (logLevel: LogLevel, ...
|
|
4
|
-
verbose: (logLevel: LogLevel, ...
|
|
5
|
-
info: (logLevel: LogLevel, ...
|
|
6
|
-
warn: (logLevel: LogLevel, ...
|
|
7
|
-
error: (...
|
|
3
|
+
trace: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
4
|
+
verbose: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
5
|
+
info: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
6
|
+
warn: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
7
|
+
error: (message?: any, ...optionalParams: any[]) => void;
|
|
8
8
|
};
|
|
9
9
|
export { Log };
|
|
10
10
|
export type { LogLevel };
|
package/dist/test/stbl.test.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
if (process.platform !== 'win32') {
|
|
26
36
|
// @ts-expect-error
|
|
27
37
|
const { expect, test } = await Promise.resolve().then(() => __importStar(require('bun:test')));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/webcodecs",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.287",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
18
18
|
"license": "Remotion License (See https://remotion.dev/docs/webcodecs#license)",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@remotion/media-parser": "4.0.
|
|
21
|
-
"@remotion/licensing": "4.0.
|
|
20
|
+
"@remotion/media-parser": "4.0.287",
|
|
21
|
+
"@remotion/licensing": "4.0.287"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/dom-webcodecs": "0.1.11",
|
|
26
26
|
"eslint": "9.19.0",
|
|
27
|
-
"@remotion/
|
|
28
|
-
"@remotion/
|
|
27
|
+
"@remotion/eslint-config-internal": "4.0.287",
|
|
28
|
+
"@remotion/example-videos": "4.0.287"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [],
|
|
31
31
|
"publishConfig": {
|