Skip to content

h264: PPS num_ref_idx_l0_default_active_minus1 exceeds actual DPB occupancy after IDR, causing "Missing reference picture" decode errors #7

@skirsten

Description

@skirsten

From Claude:

When max_reference_frames > 1 and b_frame_count = 0, the PPS sets num_ref_idx_l0_default_active_minus1 = active_reference_count - 1 (e.g. 3 for 4 references). The slice header sets num_ref_idx_active_override_flag = 0, so the decoder uses the PPS default.

Immediately after an IDR, the DPB contains only 1 picture. The decoder tries to build a reference list with active_reference_count entries but can't — producing "Missing reference picture" warnings and decode failures on P-frames until the DPB fills up.

I was getting "Decoding error" from WebCodec SDK and warnings from ffmpeg and ffplay.
Setting

.with_max_reference_frames(1)

as a workaround fixed the issue for now.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions