Unity-Technologies / Unity-Technologies/com.unity.webrtc

[REQUEST]: Ability to commit YUV frame image data as a frame image.

Open
#625 4 comments 0 reactions 1 assignee View on GitHub

@karasusan is already working on this.

Since Feb 8, 2022.

enhancement issued
Dominant language
Assembly
Stars
852
Forks
238
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem?

Nreal is equipped with a camera, and you can acquire the image of the camera in frame units, but at that time you can select whether to acquire it in RGB or YUV (420).
(YUV data is acquired as a serialized one-dimensional byte array)
If you select YUV, the memory usage will be reduced accordingly.

Also, in ARKit XR Plugin, if you get the frame image of the camera on iOS, it will be taken as a YUV image.

As you can see, depending on the SDK and assets, there are some scenes where images are acquired with YUV.

Inside Unity WebRTC, when passing a frame image to the (software) encoder, it seems that it is converted from RGB to YUV (420) before passing, so if YUV data can be committed as a frame image as it is, memory usage will be suppressed and RGB will be changed to YUV. I thought it would be possible to eliminate the conversion overhead of.

(翻訳が不安なので日本語のテキストも追加します)
先ほどのリクエストとほぼ同じですが、今回はYUV画像データをフレーム画像としてコミットする機能をリクエストします。

Nrealではカメラが搭載されており、カメラの映像をフレーム単位で取得することができるのですが、その際にRGBで取得するかYUV(420)で取得するかの選択ができます。
(YUVのデータは直列化した一次元byte配列で取得されます)
YUVを選択すると、その分メモリ使用量が抑えられます。

また、ARKit XR Plugin においてもiOSでカメラのフレーム画像を取得するとYUV画像として取得されます。(AndroidではRGBです)

このようにSDKやアセットによっては、YUVで画像を取得する場面がいくつか見受けられます。

Unity WebRTC 内部では(ソフトウェア)エンコーダーにフレーム画像を渡すときにRGBからYUV(420)に変換してから渡してるみたいですので、YUVデータをそのままフレーム画像としてコミットできればメモリ使用量を抑えRGBからYUVへの変換するオーバーヘッドをなくすことができるのではと思った次第です。

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.