Broadway icon indicating copy to clipboard operation
Broadway copied to clipboard

Does this use hardware acceleration in WebGL?

Open taimooralam opened this issue 8 years ago • 9 comments

I need to confirm whether the WebGL optimizations in Broadway use hardware acceleration features to further decrease the latency while decoding H.264 data?

taimooralam avatar Dec 16 '15 14:12 taimooralam

technically yes but its not hardware accelerated decoding

soliton4 avatar Dec 16 '15 15:12 soliton4

Only a small portion of the decoding path uses hardware acceleration, namely YCbCr to RGB conversion. The main benefit of this is two fold:

  1. The colorspace conversion math is non-trivial and it's slow when executed on the CPU.
  2. Texture uploads are slow. Uploading YCbCr instead of RGB image data is faster, since you're dealing with half as much data.

mbebenita avatar Dec 16 '15 18:12 mbebenita

  1. If I have H264 data in my browser and I want to decode and render it with a combined latency of 10-15 ms. Is that possible in your opinion?
  2. How can I get data from an RTSP stream in the Webpage, if you have any idea about that?

taimooralam avatar Dec 17 '15 11:12 taimooralam

i am working on low latency applications as well. it is possible, but you need to know what you are doing on the encoder side base profile and only p-frames http://www.streaminglearningcenter.com/articles/producing-h264-video-for-flash-an-overview.html?page=4

soliton4 avatar Dec 17 '15 12:12 soliton4

Thanks. Can you please tell me which part that converts YUV to RGB?

taimooralam avatar Feb 01 '16 06:02 taimooralam

the color conversion on a webgl system happens here: https://github.com/mbebenita/Broadway/blob/master/Player/YUVCanvas.js#L279

soliton4 avatar Feb 02 '16 00:02 soliton4

Is it theoretically possible to enable hardware acceleration in WebGL or javascript?

amilajack avatar Jul 19 '16 23:07 amilajack

most webgl implementations run on processors outside the cpu. which could also be called hardware accelerated.

soliton4 avatar Jul 19 '16 23:07 soliton4

So currently the decoding of mp4 is not hardware accelerated?

amilajack avatar Jul 20 '16 02:07 amilajack