← Back to release summary

WebGPU WebCodecs integration

Category
Graphics
Type
New or changed feature
Status
Origin trial (Chrome Origin trial)
Intent stage
Prepare to ship

Summary

WebGPU exposes an API to create opaque "external texture" objects from HTMLVideoElement. These object can be used to sample the video frames efficiently, potentially in a zero-copy way directly from the source YUV data. However the WebGPU specification for the first version of WebGPU does not allow creating GPUExternalTextures from WebCodecs VideoFrame objects. This capability is important for advanced video processing applications that are already using WebCodecs and would like to integrate WebGPU in the video processing pipeline. This feature adds support for using a VideoFrame as the source for a GPUExternalTexture and a copyExternalImageToTexture call.

Motivation

WebGPU exposes an API to create opaque "external texture" objects from HTMLVideoElement. These objects can be used to sample the video frames efficiently, potentially in a zero-copy way directly from the source YUV data. However the WebGPU specification for the first version of WebGPU does not allow creating GPUExternalTextures from WebCodecs VideoFrame objects. This capability is important for advanced video processing applications that are already using WebCodecs and would like to integrate WebGPU in the video processing pipeline.

Standards & signals

Docs: https://github.com/gpuweb/gpuweb/issues/1380

Samples: https://webgpu.github.io/webgpu-samples/samples/videoUploadingWebCodecs

Explainers: https://developer.chrome.com/blog/new-in-webgpu-113/#use-webcodecs-videoframe-source-in-importexternaltexture https://gpuweb.github.io/gpuweb/explainer/#image-input https://github.com/gpuweb/gpuweb/issues/1380 https://github.com/gpuweb/gpuweb/issues/4165

View on chromestatus.com