mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-02 21:33:52 +02:00
Add Annex B in MP4 test
This commit is contained in:
@@ -140,3 +140,23 @@ test('QuickTime nclc color information', async () => {
|
|||||||
});
|
});
|
||||||
expect(await track.hasHighDynamicRange()).toBe(true);
|
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.
Reference in New Issue
Block a user