@mediabunny/server 1.45.0 → 1.45.2
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/bundles/mediabunny-server.cjs +2 -3
- package/dist/bundles/mediabunny-server.min.cjs +2 -2
- package/dist/bundles/mediabunny-server.min.mjs +2 -2
- package/dist/bundles/mediabunny-server.mjs +2 -3
- package/dist/modules/src/misc.d.ts +0 -1
- package/dist/modules/src/misc.d.ts.map +1 -1
- package/dist/modules/src/misc.js +1 -3
- package/dist/modules/src/video-decoder.js +1 -1
- package/dist/modules/src/video-encoder.d.ts.map +1 -1
- package/dist/modules/src/video-encoder.js +1 -1
- package/dist/modules/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/misc.ts +0 -3
- package/src/video-decoder.ts +2 -2
- package/src/video-encoder.ts +1 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mediabunny/server",
|
|
3
3
|
"author": "Vanilagy",
|
|
4
|
-
"version": "1.45.
|
|
4
|
+
"version": "1.45.2",
|
|
5
5
|
"description": "Adds full video and audio decoder and encoder support to Mediabunny for use in server-side environments (Node, Bun, Deno). Based on NodeAV.",
|
|
6
6
|
"main": "./dist/bundles/mediabunny-server.cjs",
|
|
7
7
|
"module": "./dist/bundles/mediabunny-server.mjs",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"url": "https://github.com/sponsors/Vanilagy"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"node-av": "^5.2.
|
|
37
|
+
"node-av": "^5.2.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"mediabunny": "^1.
|
|
40
|
+
"mediabunny": "^1.45.0"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"server",
|
package/src/misc.ts
CHANGED
|
@@ -237,6 +237,3 @@ export const getChannelLayout = (numChannels: number): NodeAv.ChannelLayout => {
|
|
|
237
237
|
default: return { nbChannels: numChannels, order: NodeAv.AV_CHANNEL_ORDER_UNSPEC, mask: 0n };
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
|
-
|
|
241
|
-
// The value is incorrect in the node-av source code, so we do:
|
|
242
|
-
export const LIBVPX_VP9 = 'libvpx-vp9' as (NodeAv.FFEncoderCodec & NodeAv.FFDecoderCodec);
|
package/src/video-decoder.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { CustomVideoDecoder, VideoCodec, EncodedPacket, VideoSample, type MaybePromise, Rational } from 'mediabunny';
|
|
10
10
|
import * as NodeAv from 'node-av';
|
|
11
|
-
import { CODEC_TO_CODEC_ID, getHardwareDecoderCodec
|
|
11
|
+
import { CODEC_TO_CODEC_ID, getHardwareDecoderCodec } from './misc';
|
|
12
12
|
import { assert, binarySearchLessOrEqual, simplifyRational, toUint8Array } from '../../../src/misc';
|
|
13
13
|
import { AvFrameVideoSampleResource } from './video-sample';
|
|
14
14
|
|
|
@@ -47,7 +47,7 @@ export class NodeAvVideoDecoder extends CustomVideoDecoder {
|
|
|
47
47
|
|
|
48
48
|
let codec: NodeAv.Codec | null;
|
|
49
49
|
if (this.codec === 'vp9' && packet.sideData.alpha) {
|
|
50
|
-
codec = NodeAv.Codec.findDecoderByName(
|
|
50
|
+
codec = NodeAv.Codec.findDecoderByName(NodeAv.FF_DECODER_LIBVPX_VP9) ?? NodeAv.Codec.findDecoder(codecId);
|
|
51
51
|
} else if (
|
|
52
52
|
// This check used to be "is not prefer-hardware", meaning it would default to using software decode. I
|
|
53
53
|
// didn't leave a comment for that back then so I actually don't know what it was for. I'm sure it was to
|
package/src/video-encoder.ts
CHANGED
|
@@ -19,7 +19,6 @@ import * as NodeAv from 'node-av';
|
|
|
19
19
|
import {
|
|
20
20
|
CODEC_TO_CODEC_ID,
|
|
21
21
|
getHardwareEncoderCodec,
|
|
22
|
-
LIBVPX_VP9,
|
|
23
22
|
unmapColorPrimaries,
|
|
24
23
|
unmapMatrixCoefficients,
|
|
25
24
|
unmapTransferCharacteristics,
|
|
@@ -81,7 +80,7 @@ export class NodeAvVideoEncoder extends CustomVideoEncoder {
|
|
|
81
80
|
|
|
82
81
|
let codec: NodeAv.Codec | null = null;
|
|
83
82
|
if (this.codec === 'vp9' && this.config.alpha === 'keep') {
|
|
84
|
-
codec = NodeAv.Codec.findEncoderByName(
|
|
83
|
+
codec = NodeAv.Codec.findEncoderByName(NodeAv.FF_ENCODER_LIBVPX_VP9) ?? NodeAv.Codec.findEncoder(codecId);
|
|
85
84
|
} else if (this.config.hardwareAcceleration === 'prefer-software') {
|
|
86
85
|
codec = NodeAv.Codec.findEncoder(codecId);
|
|
87
86
|
} else {
|