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

Conversion to RGB in VideoFrame.copyTo() #951

Closed
1 task done
Djuffin opened this issue May 1, 2024 · 1 comment
Closed
1 task done

Conversion to RGB in VideoFrame.copyTo() #951

Djuffin opened this issue May 1, 2024 · 1 comment

Comments

@Djuffin
Copy link

Djuffin commented May 1, 2024

こんにちは TAG-さん!

I'm requesting a TAG review of Conversion to RGB in VideoFrame.copyTo().

VideoFrame.copyTo() can convert pixel data to RGB pixel format

Converting YUV video frames to RGB is often required for processing them in libraries like TensorFlow.js and OpenCV.js.
Previously the only possible way to achieve this was rendering the frame on a canvas.

Specifying VideoFrameCopyToOptions.format and VideoFrameCopyToOptions.colorSpace make it possible to asynchronously convert frames to RGB pixel format by calling VideoFrame.copyTo() without having to use an extra canvas.

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: couple of weeks
  • The group where the work on this specification is currently being done: Media Working Group
  • This work is being funded by: Google LLC
@martinthomson
Copy link
Contributor

Thanks for giving this opportunity to review this work. We see this as a useful addition to the platform.

We do observe that there is a lot of uncoordinated work on color across the platform. Our understanding of the situation is that CSS is quite advanced with its work on color spaces and the media pipeline (video and so forth) is more advanced with high dynamic range content. Having a uniform platform-wide would be desirable and we'd encourage you to engage with CSS folks on the subject to have that happen. You might consider proposing a TPAC session on this topic?

We do think that the name is a little misleading here as the "copy" part of the operation isn't the most important aspect; it's the conversion or transform that is the important action. Is this something that warrants a new API? copyTo looks to be relatively new, is it possible to choose a better name?

Finally, from a process perspective, we'd strongly encourage you to take this work to the Media Working Group repo rather than sitting in someone's private GitHub account.

Either way, this work looks like a useful contribution, so we're closing this as satisfied with concerns.

@martinthomson martinthomson added Resolution: satisfied with concerns The TAG is satisfied with this work overall but requires changes Focus: Web architecture (complete) labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants