Add advanced access unit delimination logic to MPEG-TS demuxer (fixes #414), ignore irrelevant PIDs in MPEG-TS metadata reading

This commit is contained in:
Vanilagy
2026-06-17 17:16:39 +02:00
parent 53833f6e94
commit bfd4059c22
4 changed files with 130 additions and 30 deletions
+23
View File
@@ -875,3 +875,26 @@ test('MPEG-TS with "extension" PES packets without PTS', async () => {
4693, 223, 144, 174, 118, 9155, 1188, 379, 169, 213,
]);
});
test('MPEG-TS with AUD-less video packets', async () => {
using input = new Input({
source: new FilePathSource(path.join(__dirname, '../public/no-aud.ts')),
formats: ALL_FORMATS,
});
const videoTrack = await input.getPrimaryVideoTrack();
assert(videoTrack);
const sink = new EncodedPacketSink(videoTrack);
const firstPacket = await sink.getFirstPacket();
assert(firstPacket);
const secondPacket = await sink.getNextPacket(firstPacket);
assert(secondPacket);
const thirdPacket = await sink.getNextPacket(secondPacket);
assert(thirdPacket);
expect(firstPacket.data.byteLength).toBe(331774);
expect(secondPacket.data.byteLength).toBe(1749);
expect(thirdPacket.data.byteLength).toBe(4273);
});
Binary file not shown.