@remotion/webcodecs 4.0.285 → 4.0.286
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.js +1 -0
- 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 +8 -3
- 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.js
CHANGED
|
@@ -173,6 +173,7 @@ 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,
|
|
177
178
|
})
|
|
178
179
|
.then(() => {
|
|
@@ -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
|
@@ -432,13 +432,14 @@ var setRemotionImported = () => {
|
|
|
432
432
|
// src/get-wave-audio-decoder.ts
|
|
433
433
|
var getWaveAudioDecoder = ({
|
|
434
434
|
onFrame,
|
|
435
|
-
track
|
|
435
|
+
track,
|
|
436
|
+
sampleFormat
|
|
436
437
|
}) => {
|
|
437
438
|
let queue = Promise.resolve();
|
|
438
439
|
const processSample = async (audioSample) => {
|
|
439
440
|
await onFrame(new AudioData({
|
|
440
441
|
data: audioSample.data,
|
|
441
|
-
format:
|
|
442
|
+
format: sampleFormat,
|
|
442
443
|
numberOfChannels: track.numberOfChannels,
|
|
443
444
|
numberOfFrames: audioSample.data.byteLength / 2,
|
|
444
445
|
sampleRate: track.sampleRate,
|
|
@@ -692,7 +693,7 @@ var createAudioDecoder = ({
|
|
|
692
693
|
throw new Error("Not creating audio decoder, already aborted");
|
|
693
694
|
}
|
|
694
695
|
if (config.codec === "pcm-s16") {
|
|
695
|
-
return getWaveAudioDecoder({ onFrame, track });
|
|
696
|
+
return getWaveAudioDecoder({ onFrame, track, sampleFormat: "s16" });
|
|
696
697
|
}
|
|
697
698
|
const ioSynchronizer = makeIoSynchronizer({
|
|
698
699
|
logLevel,
|
|
@@ -963,6 +964,9 @@ var getAudioDecoderConfig = async (config) => {
|
|
|
963
964
|
if (config.codec === "pcm-s16") {
|
|
964
965
|
return config;
|
|
965
966
|
}
|
|
967
|
+
if (config.codec === "pcm-s24") {
|
|
968
|
+
return config;
|
|
969
|
+
}
|
|
966
970
|
if (typeof AudioDecoder === "undefined") {
|
|
967
971
|
return null;
|
|
968
972
|
}
|
|
@@ -5048,6 +5052,7 @@ var convertMedia = async function({
|
|
|
5048
5052
|
onM3uStreams: onM3uStreams ?? null,
|
|
5049
5053
|
selectM3uStream: selectM3uStream ?? defaultSelectM3uStreamFn,
|
|
5050
5054
|
selectM3uAssociatedPlaylists: selectM3uAssociatedPlaylists ?? defaultSelectM3uAssociatedPlaylists,
|
|
5055
|
+
makeSamplesStartAtZero: false,
|
|
5051
5056
|
mp4HeaderSegment: null
|
|
5052
5057
|
}).then(() => {
|
|
5053
5058
|
return state.waitForFinish();
|
|
@@ -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.286",
|
|
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.286",
|
|
21
|
+
"@remotion/licensing": "4.0.286"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/dom-webcodecs": "0.1.11",
|
|
26
26
|
"eslint": "9.19.0",
|
|
27
|
-
"@remotion/example-videos": "4.0.
|
|
28
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
27
|
+
"@remotion/example-videos": "4.0.286",
|
|
28
|
+
"@remotion/eslint-config-internal": "4.0.286"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [],
|
|
31
31
|
"publishConfig": {
|