Bump node-av to ^5.2.4

This commit is contained in:
Vanilagy
2026-05-14 11:39:55 +02:00
parent f2bd003728
commit f869358f93
5 changed files with 45 additions and 81 deletions
+1 -1
View File
@@ -34,7 +34,7 @@
"url": "https://github.com/sponsors/Vanilagy"
},
"dependencies": {
"node-av": "^5.2.3"
"node-av": "^5.2.4"
},
"peerDependencies": {
"mediabunny": "^1.45.0"
-3
View File
@@ -237,6 +237,3 @@ export const getChannelLayout = (numChannels: number): NodeAv.ChannelLayout => {
default: return { nbChannels: numChannels, order: NodeAv.AV_CHANNEL_ORDER_UNSPEC, mask: 0n };
}
};
// The value is incorrect in the node-av source code, so we do:
export const LIBVPX_VP9 = 'libvpx-vp9' as (NodeAv.FFEncoderCodec & NodeAv.FFDecoderCodec);
+2 -2
View File
@@ -8,7 +8,7 @@
import { CustomVideoDecoder, VideoCodec, EncodedPacket, VideoSample, type MaybePromise, Rational } from 'mediabunny';
import * as NodeAv from 'node-av';
import { CODEC_TO_CODEC_ID, getHardwareDecoderCodec, LIBVPX_VP9 } from './misc';
import { CODEC_TO_CODEC_ID, getHardwareDecoderCodec } from './misc';
import { assert, binarySearchLessOrEqual, simplifyRational, toUint8Array } from '../../../src/misc';
import { AvFrameVideoSampleResource } from './video-sample';
@@ -47,7 +47,7 @@ export class NodeAvVideoDecoder extends CustomVideoDecoder {
let codec: NodeAv.Codec | null;
if (this.codec === 'vp9' && packet.sideData.alpha) {
codec = NodeAv.Codec.findDecoderByName(LIBVPX_VP9) ?? NodeAv.Codec.findDecoder(codecId);
codec = NodeAv.Codec.findDecoderByName(NodeAv.FF_DECODER_LIBVPX_VP9) ?? NodeAv.Codec.findDecoder(codecId);
} else if (
// This check used to be "is not prefer-hardware", meaning it would default to using software decode. I
// 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
+1 -2
View File
@@ -19,7 +19,6 @@ import * as NodeAv from 'node-av';
import {
CODEC_TO_CODEC_ID,
getHardwareEncoderCodec,
LIBVPX_VP9,
unmapColorPrimaries,
unmapMatrixCoefficients,
unmapTransferCharacteristics,
@@ -81,7 +80,7 @@ export class NodeAvVideoEncoder extends CustomVideoEncoder {
let codec: NodeAv.Codec | null = null;
if (this.codec === 'vp9' && this.config.alpha === 'keep') {
codec = NodeAv.Codec.findEncoderByName(LIBVPX_VP9) ?? NodeAv.Codec.findEncoder(codecId);
codec = NodeAv.Codec.findEncoderByName(NodeAv.FF_ENCODER_LIBVPX_VP9) ?? NodeAv.Codec.findEncoder(codecId);
} else if (this.config.hardwareAcceleration === 'prefer-software') {
codec = NodeAv.Codec.findEncoder(codecId);
} else {