Closed Bug 978828 Opened 10 years ago Closed 10 years ago

Video to WebGL texture is slow

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 880114

People

(Reporter: pyalot, Unassigned)

Details

(Keywords: perf, Whiteboard: [bugday-20140310])

A test of video upload speeds across different video formats and platforms reveals that passing a video to texImage2D or texSubImage2D is quite slow (upwards of 4ms) in many cases starting from 480p.

The test case is hosted there: http://codeflow.org/issues/slow_video_to_texture/

Efforts should be made to reduce the cost of this usecase substantially as it would help to use video in WebGL.
Chrome ticket with history since 2011: https://code.google.com/p/chromium/issues/detail?id=91208
Component: Untriaged → Graphics
Keywords: perf
Product: Firefox → Core
Whiteboard: [bugday-20140310]
Note that a very satisfactory upload solution is to use the GPU to do the YUV420p conversion. It cuts the upload bandwidth down from 23 or 32 bits to 12 bits per pixel, and it can be operated by plain old texSubImage2D calls fairly efficiently (by using 3 transfer textures one each for Y, U and V).

For benchmark numbers and source, see the last benchmark results from the test on the chrome ticket.
In fact, on platform that supports egl_image_external, it can be easier by using samplerExternalOES to do the YUV=>RGB operation.

Since I was busy on other bugs recently, I will re-start to implement a clean way for such requirement later in bug 880114 and 814524(1 for WebGL video texture, 1 for skiaGL 2d canvas video rendering).
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.