Fix AVC software decoder sometimes dropping B-frames (fixes #488)

This commit is contained in:
Vanilagy
2026-09-09 16:55:06 +02:00
parent 4b140fe46c
commit f767b6f601
9 changed files with 276 additions and 19 deletions
+22
View File
@@ -1223,6 +1223,28 @@ describe('Video', async () => {
await decoder.close();
});
test('No B-frames are skipped when decoding AVC', async () => {
using input = new Input({
source: new FilePathSource('./test/public/missing-reorder-metadata-v1.mp4'),
formats: ALL_FORMATS,
});
const track = await input.getPrimaryVideoTrack();
assert(track);
const sink = new VideoSampleSink(track, {
hardwareAcceleration: 'prefer-software',
});
let count = 0;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
for await (using sample of sink.samples()) {
count++;
}
expect(count).toBe(48);
});
describe('VideoSample transformation', () => {
// 400x400 image: red everywhere, with a 200x200 blue square filling the bottom-left quadrant.
const TEST_IMAGE = (() => {