Skip to content

fix(image): unfreeze H.264 playback on long-GOP and multi-stream recordings - #51

Merged
joaner merged 1 commit into
ioai-tech:mainfrom
joaner:fix/h264-frozen-first-frame
Aug 26, 2026
Merged

fix(image): unfreeze H.264 playback on long-GOP and multi-stream recordings#51
joaner merged 1 commit into
ioai-tech:mainfrom
joaner:fix/h264-frozen-first-frame

Conversation

@joaner

@joaner joaner commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix H.264 image panels freezing on the first frame with no error when playing foxglove_msgs/msg/CompressedVideo streams (especially multi-camera 720p MCAP recordings with long GOPs or a single IDR).
  • Replace the absolute 120ms output-deadline drop with a newest-wins render policy so decoded frames always reach the canvas under normal pipeline latency.
  • Recover pressure mode under steady transport latency, protect in-flight bootstrap GOPs from queue trimming, widen seek/repair bounds for 256-frame GOPs, and actively re-bootstrap when passive IDR wait would never complete.

Root cause

The worker silently closed every decoded VideoFrame once receiveTime lagged the playhead by more than 120ms. On six concurrent 720p streams the end-to-end latency is ~180–270ms, so rendered=0 while dropped climbed with no UI error.

Test plan

  • npm run lint
  • npm test (692 passed)
  • Manual playback verified on E45CF00A_1782467198053__1_3.mcap and _1_6.mcap
  • CI green on PR

…rdings

Decoded frames were silently discarded once pipeline latency exceeded a
120ms output deadline, leaving the canvas stuck on the bootstrap frame with
no error. Switch to newest-wins rendering, recover from degraded pressure
under steady transport latency, and actively re-bootstrap when IDR recovery
would otherwise wait forever on single-keyframe or 256-frame GOP streams.
@joaner
joaner merged commit 851bc8b into ioai-tech:main Aug 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant