Implement @mediabunny/prores extension, add onError callbacks to custom coders, fix visibleRect bug in VideoSample

This commit is contained in:
Vanilagy
2026-06-29 17:15:10 +02:00
parent af618f014a
commit 8ae0f9d09e
42 changed files with 1074 additions and 451 deletions
+8 -4
View File
@@ -19,6 +19,7 @@ import {
PCM_AUDIO_CODECS,
PcmAudioCodec,
PRORES_FOURCCS,
ProresFourCc,
VideoCodec,
} from '../codec';
import {
@@ -148,7 +149,7 @@ type InternalTrack = {
hevcCodecInfo: HevcDecoderConfigurationRecord | null;
vp9CodecInfo: Vp9CodecInfo | null;
av1CodecInfo: Av1CodecInfo | null;
proresFormat: string | null;
proresFormat: ProresFourCc | null;
};
} | {
info: {
@@ -1096,9 +1097,9 @@ export class IsobmffDemuxer extends Demuxer {
track.info.codec = 'vp9';
} else if (codecName === 'av01') {
track.info.codec = 'av1';
} else if (PRORES_FOURCCS.includes(lowercaseBoxName)) {
} else if ((PRORES_FOURCCS as readonly string[]).includes(lowercaseBoxName)) {
track.info.codec = 'prores';
track.info.proresFormat = lowercaseBoxName;
track.info.proresFormat = lowercaseBoxName as ProresFourCc;
} else if (codecName === null) {
Logging._warn(`Unknown encrypted video codec due to missing frma box.`);
} else {
@@ -3347,7 +3348,10 @@ class IsobmffVideoTrackBacking extends IsobmffTrackBacking implements InputVideo
}
async canBeTransparent() {
return false;
return this.internalTrack.info.codec === 'prores' && (
this.internalTrack.info.proresFormat === 'ap4h'
|| this.internalTrack.info.proresFormat === 'ap4x'
);
}
async getDecoderConfig(): Promise<VideoDecoderConfig | null> {