Open Bug 1909373 Opened 1 year ago Updated 1 year ago

Improve VideoFrame.copyTo performance

Categories

(Core :: Audio/Video: Web Codecs, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: chunmin, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Chrome's VideoFrame copyTo is way faster than Firefox. Here: https://chunminchang.github.io/playground/webcodecs/videoFrame-copyTo-performance.html is a test page showing the time that VideoFrames' copyTo take to convert from RGBX/A and I420(A) to RGBA/X with different color space settings. Currently, on MacOS, Chrome only takes 0.1 ms to convert I420 to RGBA, while my Nightly takes 3 ms to do the same job. For plain copy (unchecked the "set options" in the test page), Chrome takes 0.3 ms to copy RGBA, while my Nightly takes 1 ms.

There are two main tasks:

  1. Find a better solution to convert the YUV to RGBA (Bug 1906717),
  2. Speed up the plain RGBA copy (shuffle the channels if needed)

Maybe we could do the YUV-to-RGBA conversion by GPU and copy the data in paralle threads like what Chrome does.

See Also: → 1780656
You need to log in before you can comment on or make changes to this bug.