@remotion/webcodecs 4.0.228 → 4.0.229
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/calculate-progress.d.ts +2 -2
- package/dist/calculate-progress.js +3 -3
- package/dist/can-copy-audio-track.d.ts +8 -0
- package/dist/can-copy-audio-track.js +10 -0
- package/dist/can-copy-video-track.d.ts +8 -0
- package/dist/can-copy-video-track.js +13 -0
- package/dist/can-reencode-audio-track.d.ts +7 -0
- package/dist/can-reencode-audio-track.js +21 -0
- package/dist/can-reencode-audio.d.ts +7 -0
- package/dist/can-reencode-audio.js +21 -0
- package/dist/can-reencode-video-track.d.ts +6 -0
- package/dist/can-reencode-video-track.js +15 -0
- package/dist/can-reencode-video.d.ts +6 -0
- package/dist/can-reencode-video.js +15 -0
- package/dist/codec-id.d.ts +7 -2
- package/dist/codec-id.js +7 -0
- package/dist/convert-encoded-chunk.d.ts +2 -0
- package/dist/convert-encoded-chunk.js +15 -0
- package/dist/convert-media.d.ts +16 -7
- package/dist/convert-media.js +15 -12
- package/dist/esm/index.mjs +294 -178
- package/dist/index.d.ts +8 -1
- package/dist/index.js +12 -1
- package/dist/on-audio-track.d.ts +4 -4
- package/dist/on-audio-track.js +21 -21
- package/dist/on-frame.d.ts +11 -0
- package/dist/on-frame.js +32 -0
- package/dist/on-video-track.d.ts +7 -6
- package/dist/on-video-track.js +24 -20
- package/dist/polyfill-encoded-audio-chunk.d.ts +3 -0
- package/dist/polyfill-encoded-audio-chunk.js +5 -0
- package/dist/resolve-audio-action.d.ts +15 -11
- package/dist/resolve-audio-action.js +23 -21
- package/dist/resolve-video-action.d.ts +14 -11
- package/dist/resolve-video-action.js +17 -24
- package/dist/video-encoder-config.d.ts +6 -1
- package/dist/video-encoder-config.js +6 -1
- package/dist/video-encoder.d.ts +1 -1
- package/package.json +4 -4
|
@@ -5,6 +5,9 @@ const getAudioDecoderConfig = async (config) => {
|
|
|
5
5
|
if (typeof AudioDecoder === 'undefined') {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
+
if (typeof EncodedAudioChunk === 'undefined') {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
8
11
|
if ((await AudioDecoder.isConfigSupported(config)).supported) {
|
|
9
12
|
return config;
|
|
10
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const calculateProgress: ({ millisecondsWritten,
|
|
1
|
+
export declare const calculateProgress: ({ millisecondsWritten, expectedOutputDurationInMs, }: {
|
|
2
2
|
millisecondsWritten: number;
|
|
3
|
-
|
|
3
|
+
expectedOutputDurationInMs: number | null;
|
|
4
4
|
}) => number | null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateProgress = void 0;
|
|
4
|
-
const calculateProgress = ({ millisecondsWritten,
|
|
5
|
-
if (
|
|
4
|
+
const calculateProgress = ({ millisecondsWritten, expectedOutputDurationInMs, }) => {
|
|
5
|
+
if (expectedOutputDurationInMs === null) {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
return millisecondsWritten /
|
|
8
|
+
return millisecondsWritten / expectedOutputDurationInMs;
|
|
9
9
|
};
|
|
10
10
|
exports.calculateProgress = calculateProgress;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MediaParserAudioCodec } from '@remotion/media-parser';
|
|
2
|
+
import type { ConvertMediaAudioCodec } from './codec-id';
|
|
3
|
+
import type { ConvertMediaContainer } from './convert-media';
|
|
4
|
+
export declare const canCopyAudioTrack: ({ inputCodec, outputCodec, container, }: {
|
|
5
|
+
inputCodec: MediaParserAudioCodec;
|
|
6
|
+
outputCodec: ConvertMediaAudioCodec;
|
|
7
|
+
container: ConvertMediaContainer;
|
|
8
|
+
}) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canCopyAudioTrack = void 0;
|
|
4
|
+
const canCopyAudioTrack = ({ inputCodec, outputCodec, container, }) => {
|
|
5
|
+
if (outputCodec === 'opus') {
|
|
6
|
+
return inputCodec === 'opus' && container === 'webm';
|
|
7
|
+
}
|
|
8
|
+
throw new Error(`Unhandled codec: ${outputCodec}`);
|
|
9
|
+
};
|
|
10
|
+
exports.canCopyAudioTrack = canCopyAudioTrack;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MediaParserVideoCodec } from '@remotion/media-parser';
|
|
2
|
+
import type { ConvertMediaVideoCodec } from './codec-id';
|
|
3
|
+
import type { ConvertMediaContainer } from './convert-media';
|
|
4
|
+
export declare const canCopyVideoTrack: ({ inputCodec, outputCodec, container, }: {
|
|
5
|
+
inputCodec: MediaParserVideoCodec;
|
|
6
|
+
outputCodec: ConvertMediaVideoCodec;
|
|
7
|
+
container: ConvertMediaContainer;
|
|
8
|
+
}) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canCopyVideoTrack = void 0;
|
|
4
|
+
const canCopyVideoTrack = ({ inputCodec, outputCodec, container, }) => {
|
|
5
|
+
if (outputCodec === 'vp8') {
|
|
6
|
+
return inputCodec === 'vp8' && container === 'webm';
|
|
7
|
+
}
|
|
8
|
+
if (outputCodec === 'vp9') {
|
|
9
|
+
return inputCodec === 'vp9' && container === 'webm';
|
|
10
|
+
}
|
|
11
|
+
throw new Error(`Unhandled codec: ${outputCodec}`);
|
|
12
|
+
};
|
|
13
|
+
exports.canCopyVideoTrack = canCopyVideoTrack;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AudioTrack } from '@remotion/media-parser';
|
|
2
|
+
import type { ConvertMediaAudioCodec } from './codec-id';
|
|
3
|
+
export declare const canReencodeAudioTrack: ({ track, audioCodec, bitrate, }: {
|
|
4
|
+
track: AudioTrack;
|
|
5
|
+
audioCodec: ConvertMediaAudioCodec;
|
|
6
|
+
bitrate: number;
|
|
7
|
+
}) => Promise<boolean>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canReencodeAudioTrack = void 0;
|
|
4
|
+
const audio_decoder_config_1 = require("./audio-decoder-config");
|
|
5
|
+
const audio_encoder_config_1 = require("./audio-encoder-config");
|
|
6
|
+
const canReencodeAudioTrack = async ({ track, audioCodec, bitrate, }) => {
|
|
7
|
+
const audioDecoderConfig = await (0, audio_decoder_config_1.getAudioDecoderConfig)({
|
|
8
|
+
codec: track.codec,
|
|
9
|
+
numberOfChannels: track.numberOfChannels,
|
|
10
|
+
sampleRate: track.sampleRate,
|
|
11
|
+
description: track.description,
|
|
12
|
+
});
|
|
13
|
+
const audioEncoderConfig = await (0, audio_encoder_config_1.getAudioEncoderConfig)({
|
|
14
|
+
codec: audioCodec,
|
|
15
|
+
numberOfChannels: track.numberOfChannels,
|
|
16
|
+
sampleRate: track.sampleRate,
|
|
17
|
+
bitrate,
|
|
18
|
+
});
|
|
19
|
+
return Boolean(audioDecoderConfig && audioEncoderConfig);
|
|
20
|
+
};
|
|
21
|
+
exports.canReencodeAudioTrack = canReencodeAudioTrack;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AudioTrack } from '@remotion/media-parser';
|
|
2
|
+
import type { ConvertMediaAudioCodec } from './codec-id';
|
|
3
|
+
export declare const canReencodeAudioTrack: ({ track, audioCodec, bitrate, }: {
|
|
4
|
+
track: AudioTrack;
|
|
5
|
+
audioCodec: ConvertMediaAudioCodec;
|
|
6
|
+
bitrate: number;
|
|
7
|
+
}) => Promise<boolean>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canReencodeAudioTrack = void 0;
|
|
4
|
+
const audio_decoder_config_1 = require("./audio-decoder-config");
|
|
5
|
+
const audio_encoder_config_1 = require("./audio-encoder-config");
|
|
6
|
+
const canReencodeAudioTrack = async ({ track, audioCodec, bitrate, }) => {
|
|
7
|
+
const audioDecoderConfig = await (0, audio_decoder_config_1.getAudioDecoderConfig)({
|
|
8
|
+
codec: track.codec,
|
|
9
|
+
numberOfChannels: track.numberOfChannels,
|
|
10
|
+
sampleRate: track.sampleRate,
|
|
11
|
+
description: track.description,
|
|
12
|
+
});
|
|
13
|
+
const audioEncoderConfig = await (0, audio_encoder_config_1.getAudioEncoderConfig)({
|
|
14
|
+
codec: audioCodec,
|
|
15
|
+
numberOfChannels: track.numberOfChannels,
|
|
16
|
+
sampleRate: track.sampleRate,
|
|
17
|
+
bitrate,
|
|
18
|
+
});
|
|
19
|
+
return Boolean(audioDecoderConfig && audioEncoderConfig);
|
|
20
|
+
};
|
|
21
|
+
exports.canReencodeAudioTrack = canReencodeAudioTrack;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VideoTrack } from '@remotion/media-parser';
|
|
2
|
+
import type { ConvertMediaVideoCodec } from './codec-id';
|
|
3
|
+
export declare const canReencodeVideoTrack: ({ videoCodec, track, }: {
|
|
4
|
+
videoCodec: ConvertMediaVideoCodec;
|
|
5
|
+
track: VideoTrack;
|
|
6
|
+
}) => Promise<boolean>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canReencodeVideoTrack = void 0;
|
|
4
|
+
const video_decoder_config_1 = require("./video-decoder-config");
|
|
5
|
+
const video_encoder_config_1 = require("./video-encoder-config");
|
|
6
|
+
const canReencodeVideoTrack = async ({ videoCodec, track, }) => {
|
|
7
|
+
const videoEncoderConfig = await (0, video_encoder_config_1.getVideoEncoderConfig)({
|
|
8
|
+
codec: videoCodec,
|
|
9
|
+
height: track.displayAspectHeight,
|
|
10
|
+
width: track.displayAspectWidth,
|
|
11
|
+
});
|
|
12
|
+
const videoDecoderConfig = await (0, video_decoder_config_1.getVideoDecoderConfigWithHardwareAcceleration)(track);
|
|
13
|
+
return Boolean(videoDecoderConfig && videoEncoderConfig);
|
|
14
|
+
};
|
|
15
|
+
exports.canReencodeVideoTrack = canReencodeVideoTrack;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VideoTrack } from '@remotion/media-parser';
|
|
2
|
+
import type { ConvertMediaVideoCodec } from './codec-id';
|
|
3
|
+
export declare const canReencodeVideoTrack: ({ videoCodec, track, }: {
|
|
4
|
+
videoCodec: ConvertMediaVideoCodec;
|
|
5
|
+
track: VideoTrack;
|
|
6
|
+
}) => Promise<boolean>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.canReencodeVideoTrack = void 0;
|
|
4
|
+
const video_decoder_config_1 = require("./video-decoder-config");
|
|
5
|
+
const video_encoder_config_1 = require("./video-encoder-config");
|
|
6
|
+
const canReencodeVideoTrack = async ({ videoCodec, track, }) => {
|
|
7
|
+
const videoEncoderConfig = await (0, video_encoder_config_1.getVideoEncoderConfig)({
|
|
8
|
+
codec: videoCodec,
|
|
9
|
+
height: track.displayAspectHeight,
|
|
10
|
+
width: track.displayAspectWidth,
|
|
11
|
+
});
|
|
12
|
+
const videoDecoderConfig = await (0, video_decoder_config_1.getVideoDecoderConfigWithHardwareAcceleration)(track);
|
|
13
|
+
return Boolean(videoDecoderConfig && videoEncoderConfig);
|
|
14
|
+
};
|
|
15
|
+
exports.canReencodeVideoTrack = canReencodeVideoTrack;
|
package/dist/codec-id.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
declare const availableVideoCodecs: readonly ["vp8", "vp9"];
|
|
2
|
+
export declare const getAvailableVideoCodecs: () => readonly ["vp8", "vp9"];
|
|
3
|
+
export type ConvertMediaVideoCodec = (typeof availableVideoCodecs)[number];
|
|
4
|
+
declare const availableAudioCodecs: readonly ["opus"];
|
|
5
|
+
export declare const getAvailableAudioCodecs: () => readonly ["opus"];
|
|
6
|
+
export type ConvertMediaAudioCodec = (typeof availableAudioCodecs)[number];
|
|
7
|
+
export {};
|
package/dist/codec-id.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAvailableAudioCodecs = exports.getAvailableVideoCodecs = void 0;
|
|
4
|
+
const availableVideoCodecs = ['vp8', 'vp9'];
|
|
5
|
+
const getAvailableVideoCodecs = () => availableVideoCodecs;
|
|
6
|
+
exports.getAvailableVideoCodecs = getAvailableVideoCodecs;
|
|
7
|
+
const availableAudioCodecs = ['opus'];
|
|
8
|
+
const getAvailableAudioCodecs = () => availableAudioCodecs;
|
|
9
|
+
exports.getAvailableAudioCodecs = getAvailableAudioCodecs;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertEncodedChunk = void 0;
|
|
4
|
+
const convertEncodedChunk = (chunk) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const arr = new Uint8Array(chunk.byteLength);
|
|
7
|
+
chunk.copyTo(arr);
|
|
8
|
+
return {
|
|
9
|
+
data: arr,
|
|
10
|
+
duration: (_a = chunk.duration) !== null && _a !== void 0 ? _a : undefined,
|
|
11
|
+
timestamp: chunk.timestamp,
|
|
12
|
+
type: chunk.type,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.convertEncodedChunk = convertEncodedChunk;
|
package/dist/convert-media.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024 Remotion AG
|
|
3
|
+
* For licensing, see: https://remotion.dev/docs/webcodecs#license
|
|
4
|
+
*/
|
|
1
5
|
import type { LogLevel, Options, ParseMediaDynamicOptions, ParseMediaFields, ParseMediaOptions, VideoTrack, WriterInterface } from '@remotion/media-parser';
|
|
2
6
|
import type { ConvertMediaAudioCodec, ConvertMediaVideoCodec } from './codec-id';
|
|
3
7
|
import { type ResolveAudioActionFn } from './resolve-audio-action';
|
|
@@ -9,19 +13,24 @@ export type ConvertMediaState = {
|
|
|
9
13
|
encodedAudioFrames: number;
|
|
10
14
|
bytesWritten: number;
|
|
11
15
|
millisecondsWritten: number;
|
|
12
|
-
|
|
16
|
+
expectedOutputDurationInMs: number | null;
|
|
13
17
|
overallProgress: number | null;
|
|
14
18
|
};
|
|
15
|
-
export type
|
|
19
|
+
export type ConvertMediaContainer = 'webm';
|
|
16
20
|
export type ConvertMediaResult = {
|
|
17
|
-
save: () => Promise<
|
|
21
|
+
save: () => Promise<Blob>;
|
|
18
22
|
remove: () => Promise<void>;
|
|
19
23
|
};
|
|
20
|
-
export
|
|
24
|
+
export type ConvertMediaOnMediaStateUpdate = (state: ConvertMediaState) => void;
|
|
25
|
+
export type ConvertMediaOnVideoFrame = (options: {
|
|
26
|
+
frame: VideoFrame;
|
|
27
|
+
track: VideoTrack;
|
|
28
|
+
}) => Promise<VideoFrame> | VideoFrame;
|
|
29
|
+
export declare const convertMedia: <F extends Options<ParseMediaFields>>({ src, onVideoFrame, onMediaStateUpdate: onMediaStateDoNoCallDirectly, audioCodec, container, videoCodec, signal: userPassedAbortSignal, onAudioTrack: userAudioResolver, onVideoTrack: userVideoResolver, reader, fields, logLevel, writer, ...more }: {
|
|
21
30
|
src: ParseMediaOptions<F>["src"];
|
|
22
|
-
|
|
23
|
-
onVideoFrame?:
|
|
24
|
-
onMediaStateUpdate?:
|
|
31
|
+
container: ConvertMediaContainer;
|
|
32
|
+
onVideoFrame?: ConvertMediaOnVideoFrame;
|
|
33
|
+
onMediaStateUpdate?: ConvertMediaOnMediaStateUpdate;
|
|
25
34
|
videoCodec: ConvertMediaVideoCodec;
|
|
26
35
|
audioCodec: ConvertMediaAudioCodec;
|
|
27
36
|
signal?: AbortSignal;
|
package/dist/convert-media.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2024 Remotion AG
|
|
4
|
+
* For licensing, see: https://remotion.dev/docs/webcodecs#license
|
|
5
|
+
*/
|
|
2
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
8
|
};
|
|
@@ -10,14 +14,12 @@ const calculate_progress_1 = require("./calculate-progress");
|
|
|
10
14
|
const error_cause_1 = __importDefault(require("./error-cause"));
|
|
11
15
|
const on_audio_track_1 = require("./on-audio-track");
|
|
12
16
|
const on_video_track_1 = require("./on-video-track");
|
|
13
|
-
const resolve_audio_action_1 = require("./resolve-audio-action");
|
|
14
|
-
const resolve_video_action_1 = require("./resolve-video-action");
|
|
15
17
|
const with_resolvers_1 = require("./with-resolvers");
|
|
16
|
-
const convertMedia = async function ({ src, onVideoFrame, onMediaStateUpdate: onMediaStateDoNoCallDirectly, audioCodec,
|
|
18
|
+
const convertMedia = async function ({ src, onVideoFrame, onMediaStateUpdate: onMediaStateDoNoCallDirectly, audioCodec, container, videoCodec, signal: userPassedAbortSignal, onAudioTrack: userAudioResolver, onVideoTrack: userVideoResolver, reader, fields, logLevel = 'info', writer, ...more }) {
|
|
17
19
|
if (userPassedAbortSignal === null || userPassedAbortSignal === void 0 ? void 0 : userPassedAbortSignal.aborted) {
|
|
18
20
|
return Promise.reject(new error_cause_1.default('Aborted'));
|
|
19
21
|
}
|
|
20
|
-
if (
|
|
22
|
+
if (container !== 'webm') {
|
|
21
23
|
return Promise.reject(new TypeError('Only `to: "webm"` is supported currently'));
|
|
22
24
|
}
|
|
23
25
|
if (audioCodec !== 'opus') {
|
|
@@ -45,7 +47,7 @@ const convertMedia = async function ({ src, onVideoFrame, onMediaStateUpdate: on
|
|
|
45
47
|
encodedAudioFrames: 0,
|
|
46
48
|
bytesWritten: 0,
|
|
47
49
|
millisecondsWritten: 0,
|
|
48
|
-
|
|
50
|
+
expectedOutputDurationInMs: null,
|
|
49
51
|
overallProgress: 0,
|
|
50
52
|
};
|
|
51
53
|
const onMediaStateUpdate = (newState) => {
|
|
@@ -65,7 +67,7 @@ const convertMedia = async function ({ src, onVideoFrame, onMediaStateUpdate: on
|
|
|
65
67
|
convertMediaState.millisecondsWritten = millisecondsWritten;
|
|
66
68
|
convertMediaState.overallProgress = (0, calculate_progress_1.calculateProgress)({
|
|
67
69
|
millisecondsWritten: convertMediaState.millisecondsWritten,
|
|
68
|
-
|
|
70
|
+
expectedOutputDurationInMs: convertMediaState.expectedOutputDurationInMs,
|
|
69
71
|
});
|
|
70
72
|
onMediaStateUpdate === null || onMediaStateUpdate === void 0 ? void 0 : onMediaStateUpdate(convertMediaState);
|
|
71
73
|
}
|
|
@@ -79,8 +81,9 @@ const convertMedia = async function ({ src, onVideoFrame, onMediaStateUpdate: on
|
|
|
79
81
|
convertMediaState,
|
|
80
82
|
controller,
|
|
81
83
|
videoCodec,
|
|
82
|
-
onVideoTrack: userVideoResolver !== null && userVideoResolver !== void 0 ? userVideoResolver :
|
|
84
|
+
onVideoTrack: userVideoResolver !== null && userVideoResolver !== void 0 ? userVideoResolver : null,
|
|
83
85
|
logLevel,
|
|
86
|
+
container,
|
|
84
87
|
});
|
|
85
88
|
const onAudioTrack = (0, on_audio_track_1.makeAudioTrackHandler)({
|
|
86
89
|
abortConversion,
|
|
@@ -89,9 +92,9 @@ const convertMedia = async function ({ src, onVideoFrame, onMediaStateUpdate: on
|
|
|
89
92
|
convertMediaState,
|
|
90
93
|
onMediaStateUpdate: onMediaStateUpdate !== null && onMediaStateUpdate !== void 0 ? onMediaStateUpdate : null,
|
|
91
94
|
state,
|
|
92
|
-
onAudioTrack: userAudioResolver !== null && userAudioResolver !== void 0 ? userAudioResolver :
|
|
93
|
-
bitrate: 128000,
|
|
95
|
+
onAudioTrack: userAudioResolver !== null && userAudioResolver !== void 0 ? userAudioResolver : null,
|
|
94
96
|
logLevel,
|
|
97
|
+
container,
|
|
95
98
|
});
|
|
96
99
|
(0, media_parser_1.parseMedia)({
|
|
97
100
|
src,
|
|
@@ -112,11 +115,11 @@ const convertMedia = async function ({ src, onVideoFrame, onMediaStateUpdate: on
|
|
|
112
115
|
if (casted.onDurationInSeconds) {
|
|
113
116
|
casted.onDurationInSeconds(durationInSeconds);
|
|
114
117
|
}
|
|
115
|
-
const
|
|
116
|
-
convertMediaState.
|
|
118
|
+
const expectedOutputDurationInMs = durationInSeconds * 1000;
|
|
119
|
+
convertMediaState.expectedOutputDurationInMs = expectedOutputDurationInMs;
|
|
117
120
|
convertMediaState.overallProgress = (0, calculate_progress_1.calculateProgress)({
|
|
118
121
|
millisecondsWritten: convertMediaState.millisecondsWritten,
|
|
119
|
-
|
|
122
|
+
expectedOutputDurationInMs,
|
|
120
123
|
});
|
|
121
124
|
onMediaStateUpdate(convertMediaState);
|
|
122
125
|
},
|