Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship to WebGPU #34

Open
aboba opened this issue May 10, 2021 · 5 comments
Open

Relationship to WebGPU #34

aboba opened this issue May 10, 2021 · 5 comments
Labels
question Further information is requested

Comments

@aboba
Copy link
Contributor

aboba commented May 10, 2021

Mediacapture-Transform's MSTProcessor interface uses VideoFrame . My understanding is that this represents a GPU buffer, but the relationship to WebGPU's GPUBuffer is unclear to me.

WebGPU, is going into Origin Trial, so it would be useful to be able to try out using Mediacapture-Transform and WebGPU together (e.g. for "Funny Hats" scenarios).

@aboba aboba added the question Further information is requested label May 10, 2021
@dogben
Copy link

dogben commented May 11, 2021

There is quite a bit of discussion in gpuweb/gpuweb#1380 about import.

@Kangz can confirm, but since VideoFrame can now be created from a CanvasImageSource, that covers WebGPU also.

@Kangz
Copy link

Kangz commented May 12, 2021

Yes that's correct. WebGPU can render to canvases so the CanvasImageSource path should work. Maybe additional paths are added in the future but that one should work (at least in terms of spec) today.

Note that GPUBuffer represents unstructured GPU memory (think gpu_malloc) while GPUTexture represents 2D (or 1D / 3D) memory with a specific format in an opaque layout. What we call "buffer" in the media world is closer in concept to a GPUTexture.

@jan-ivar jan-ivar mentioned this issue May 18, 2021
@alvestrand
Copy link
Contributor

There's a demo of breakout box / WebGPU interaction at https://webrtc.github.io/samples/src/content/insertable-streams/webgpu/

@dontcallmedom
Copy link
Member

related WebGPU integration discussions in webmachinelearning/webnn#226 (comment)

The sample above notes in particular:

  // Using GPUExternalTexture(when it's implemented for Breakout Box frames) will
  // avoid making extra copies through ImageBitmap.

@aboba
Copy link
Contributor Author

aboba commented Jan 18, 2022

WebCodecs PR 412 proposes conversion of VideoFrame to GPUExternalTexture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants