Skip to content

media-source: Test H.264 SEI recovery points as MSE random access points#59019

Open
LTe wants to merge 1 commit intoweb-platform-tests:masterfrom
LTe:mse-sei-recovery-point
Open

media-source: Test H.264 SEI recovery points as MSE random access points#59019
LTe wants to merge 1 commit intoweb-platform-tests:masterfrom
LTe:mse-sei-recovery-point

Conversation

@LTe
Copy link
Copy Markdown

@LTe LTe commented Apr 7, 2026

Add a test that verifies MSE accepts non-IDR H.264 frames with SEI
recovery points (recovery_frame_cnt=0) as valid random access points.

The test appends only the SEI recovery point segment (without an IDR
segment first), forcing MSE to treat it as a new coded frame group.
If the browser doesn't recognize the recovery point as a keyframe,
all frames are silently dropped and the buffered range is empty.

This is the MSE equivalent of the WebCodecs SEI recovery point test
added in #55741.

Browser support

  • Firefox: Supported since 2017 (Bug 1347518)
  • Safari: Supported (WebKit trusts container sync sample metadata without NAL-level analysis)
  • Chrome: Tracked in crbug.com/40625346. SEI parsing is enabled but MSE keyframe promotion is not yet re-landed after a regression (crbug.com/464062740)

Test data

Open-GOP H.264 fMP4 generated with x264 (open-gop=1), split into
init segment (ftyp+moov) and a media segment starting with SEI
recovery point + non-IDR frames. See mp4/h264-sei-recovery-README.md
for generation instructions.

Related

Add a test that verifies MSE accepts non-IDR H.264 frames with SEI
recovery points (recovery_frame_cnt=0) as valid random access points.

The test appends only the SEI recovery point segment (without an IDR
segment first), forcing MSE to treat it as a new coded frame group.
If the browser doesn't recognize the recovery point as a keyframe,
all frames are silently dropped and the buffered range is empty.

Test data generated with:
  ffmpeg -y -f lavfi -i "testsrc2=size=320x240:rate=24:duration=2" \
      -c:v libx264 -preset fast -profile:v high -level 41 \
      -x264-params "keyint=24:min-keyint=24:bframes=3:open-gop=1" \
      -pix_fmt yuv420p -an \
      -movflags +frag_keyframe+empty_moov+default_base_moof \
      output.mp4

Then split into init segment (ftyp+moov) and second media segment
(moof+mdat starting with SEI recovery point).

Firefox has supported this since 2017 (Bug 1347518). Safari supports
it natively (WebKit trusts container sync sample metadata). Chromium
support is tracked in https://crbug.com/40625346.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants