Closed redonat closed 2 years ago
Also filed in https://bugs.chromium.org/p/chromium/issues/detail?id=1352442, was unsure where to submit this.
WebCodecs doesn't provide latency guarantees. Chrome however does intend to provide reasonable performance, will continue discussion there.
h264 hardware decoder buffers the frame output until the next keyframe is fed(with decode), i.e.:
For a fixed GOP-size of 4, the timeline of events is as follows:
This behavior is consistent with other fixed and variable-rate GOP-sizes we've tested both on NVIDIA and Qualcomm(Android). The decoder should be able to decode the keyframe independently and we've confirmed that the stream is free of B-frames (i.e. no individual frame depends on the next keyframe).
This behavior doesn't exist on the software decoder, it outputs the decoded frames ASAP without waiting for the next keyframe.
optimizeForLatency is set to true - yet the hardware decoder is prioritizing throughput over latency which seems like a bug.
We have ultra-tight latency constraints so this is a big deal for us, any ideas why this might be happening on hardware decode but not on software?