@remotion/webcodecs 4.0.229 → 4.0.230
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/arraybuffer-to-uint8-array.d.ts +1 -0
- package/dist/arraybuffer-to-uint8-array.js +7 -0
- package/dist/audio-decoder.d.ts +2 -2
- package/dist/audio-encoder-config.js +15 -2
- package/dist/audio-encoder.d.ts +2 -1
- package/dist/audio-encoder.js +16 -4
- package/dist/can-copy-audio-track.d.ts +2 -4
- package/dist/can-copy-audio-track.js +7 -4
- package/dist/can-copy-video-track.d.ts +2 -4
- package/dist/can-copy-video-track.js +6 -6
- package/dist/can-reencode-audio-track.js +1 -6
- package/dist/can-reencode-video-track.js +1 -0
- package/dist/choose-correct-avc1-profile.d.ts +5 -0
- package/dist/choose-correct-avc1-profile.js +54 -0
- package/dist/codec-id.d.ts +7 -4
- package/dist/codec-id.js +28 -5
- package/dist/convert-encoded-chunk.d.ts +2 -1
- package/dist/convert-encoded-chunk.js +25 -2
- package/dist/convert-media.d.ts +7 -8
- package/dist/convert-media.js +11 -9
- package/dist/default-on-audio-track-handler.d.ts +2 -0
- package/dist/default-on-audio-track-handler.js +36 -0
- package/dist/default-on-video-track-handler.d.ts +2 -0
- package/dist/default-on-video-track-handler.js +29 -0
- package/dist/esm/index.mjs +277 -106
- package/dist/get-default-audio-codec.d.ts +4 -0
- package/dist/get-default-audio-codec.js +13 -0
- package/dist/get-default-video-codec.d.ts +4 -0
- package/dist/get-default-video-codec.js +10 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +10 -1
- package/dist/io-manager/io-synchronizer.js +2 -2
- package/dist/{resolve-audio-action.d.ts → on-audio-track-handler.d.ts} +5 -5
- package/dist/on-audio-track-handler.js +2 -0
- package/dist/on-audio-track.d.ts +6 -6
- package/dist/on-audio-track.js +37 -10
- package/dist/{resolve-video-action.d.ts → on-video-track-handler.d.ts} +5 -5
- package/dist/on-video-track-handler.js +2 -0
- package/dist/on-video-track.d.ts +6 -6
- package/dist/on-video-track.js +35 -9
- package/dist/video-decoder.d.ts +2 -2
- package/dist/video-decoder.js +5 -0
- package/dist/video-encoder-config.d.ts +2 -1
- package/dist/video-encoder-config.js +7 -2
- package/dist/video-encoder.d.ts +1 -1
- package/dist/video-encoder.js +4 -6
- package/package.json +3 -3
- package/dist/can-reencode-audio.d.ts +0 -7
- package/dist/can-reencode-audio.js +0 -21
- package/dist/can-reencode-video.d.ts +0 -6
- package/dist/can-reencode-video.js +0 -15
- package/dist/event-emitter.d.ts +0 -25
- package/dist/event-emitter.js +0 -23
- package/dist/polyfill-encoded-audio-chunk.d.ts +0 -3
- package/dist/polyfill-encoded-audio-chunk.js +0 -5
- package/dist/resolve-audio-action.js +0 -32
- package/dist/resolve-video-action.js +0 -26
- package/dist/wait-until-return.d.ts +0 -4
- package/dist/wait-until-return.js +0 -14
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultResolveAudioAction = void 0;
|
|
4
|
-
const can_copy_audio_track_1 = require("./can-copy-audio-track");
|
|
5
|
-
const can_reencode_audio_track_1 = require("./can-reencode-audio-track");
|
|
6
|
-
const log_1 = require("./log");
|
|
7
|
-
const DEFAULT_BITRATE = 128000;
|
|
8
|
-
const defaultResolveAudioAction = async ({ track, audioCodec, logLevel, container, }) => {
|
|
9
|
-
const bitrate = DEFAULT_BITRATE;
|
|
10
|
-
const canCopy = (0, can_copy_audio_track_1.canCopyAudioTrack)({
|
|
11
|
-
inputCodec: track.codecWithoutConfig,
|
|
12
|
-
outputCodec: audioCodec,
|
|
13
|
-
container,
|
|
14
|
-
});
|
|
15
|
-
if (canCopy) {
|
|
16
|
-
log_1.Log.verbose(logLevel, `Track ${track.trackId} (audio): Can copy = ${canCopy}, action = copy`);
|
|
17
|
-
return Promise.resolve({ type: 'copy' });
|
|
18
|
-
}
|
|
19
|
-
const canReencode = await (0, can_reencode_audio_track_1.canReencodeAudioTrack)({
|
|
20
|
-
audioCodec,
|
|
21
|
-
track,
|
|
22
|
-
bitrate,
|
|
23
|
-
});
|
|
24
|
-
if (canReencode) {
|
|
25
|
-
log_1.Log.verbose(logLevel, `Track ${track.trackId} (audio): Can re-encode = ${canReencode}, can copy = ${canCopy}, action = reencode`);
|
|
26
|
-
return Promise.resolve({ type: 'reencode', bitrate, audioCodec });
|
|
27
|
-
}
|
|
28
|
-
log_1.Log.verbose(logLevel, `Track ${track.trackId} (audio): Can re-encode = ${canReencode}, can copy = ${canCopy}, action = drop`);
|
|
29
|
-
// TODO: Make a fail option?
|
|
30
|
-
return Promise.resolve({ type: 'drop' });
|
|
31
|
-
};
|
|
32
|
-
exports.defaultResolveAudioAction = defaultResolveAudioAction;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultResolveVideoAction = void 0;
|
|
4
|
-
const can_copy_video_track_1 = require("./can-copy-video-track");
|
|
5
|
-
const can_reencode_video_track_1 = require("./can-reencode-video-track");
|
|
6
|
-
const log_1 = require("./log");
|
|
7
|
-
const defaultResolveVideoAction = async ({ track, videoCodec, logLevel, container, }) => {
|
|
8
|
-
const canCopy = (0, can_copy_video_track_1.canCopyVideoTrack)({
|
|
9
|
-
inputCodec: track.codecWithoutConfig,
|
|
10
|
-
outputCodec: videoCodec,
|
|
11
|
-
container,
|
|
12
|
-
});
|
|
13
|
-
if (canCopy) {
|
|
14
|
-
log_1.Log.verbose(logLevel, `Track ${track.trackId} (video): Can copy, therefore copying`);
|
|
15
|
-
return Promise.resolve({ type: 'copy' });
|
|
16
|
-
}
|
|
17
|
-
const canReencode = await (0, can_reencode_video_track_1.canReencodeVideoTrack)({ videoCodec, track });
|
|
18
|
-
if (canReencode) {
|
|
19
|
-
log_1.Log.verbose(logLevel, `Track ${track.trackId} (video): Cannot copy, but re-enconde, therefore re-encoding`);
|
|
20
|
-
return Promise.resolve({ type: 'reencode', videoCodec });
|
|
21
|
-
}
|
|
22
|
-
log_1.Log.verbose(logLevel, `Track ${track.trackId} (video): Can neither copy nor re-encode, therefore dropping`);
|
|
23
|
-
// TODO: Make a fail option?
|
|
24
|
-
return Promise.resolve({ type: 'drop' });
|
|
25
|
-
};
|
|
26
|
-
exports.defaultResolveVideoAction = defaultResolveVideoAction;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitUntilReturn = void 0;
|
|
4
|
-
const with_resolvers_1 = require("./with-resolvers");
|
|
5
|
-
const waitUntilReturn = () => {
|
|
6
|
-
const { promise, resolve } = (0, with_resolvers_1.withResolvers)();
|
|
7
|
-
return {
|
|
8
|
-
waitForReturn: () => promise,
|
|
9
|
-
isReturning: () => {
|
|
10
|
-
resolve(undefined);
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
exports.waitUntilReturn = waitUntilReturn;
|