Add Annex B in MP4 test

This commit is contained in:
Vanilagy
2026-08-21 20:12:50 +02:00
parent 656c7e70a8
commit 6b5ae29252
2 changed files with 20 additions and 0 deletions
+20
View File
@@ -140,3 +140,23 @@ test('QuickTime nclc color information', async () => {
});
expect(await track.hasHighDynamicRange()).toBe(true);
});
// Annex B isn't supposed to exist in MP4, but some files have it anyway, with an empty avcC box
test('Annex B', async () => {
const filePath = path.join(__dirname, '..', 'public/annex-b.mp4');
using input = new Input({
source: new FilePathSource(filePath),
formats: ALL_FORMATS,
});
const track = await input.getPrimaryVideoTrack();
if (!track) throw new Error('No video track found');
const decoderConfig = (await track.getDecoderConfig())!;
expect(decoderConfig.codec).toBe('avc1.424028');
expect(decoderConfig.description).toBeUndefined();
const sink = new EncodedPacketSink(track);
const firstPacket = (await sink.getFirstPacket())!;
expect([...firstPacket.data.slice(0, 4)]).toEqual([0, 0, 0, 1]);
});
Binary file not shown.