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.
From Claude:
When
max_reference_frames > 1andb_frame_count = 0, the PPS setsnum_ref_idx_l0_default_active_minus1 = active_reference_count - 1(e.g. 3 for 4 references). The slice header setsnum_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_countentries 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
as a workaround fixed the issue for now.