UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG] Odd-numbered encoding sizes cannot be decoded on iOS device

Open doctorpangloss opened this issue 4 years ago • 6 comments

Describe the bug Setting the streaming size to e.g. 750x750 produces artifacts when decoded, whereas 1024x1024 or 512x512 do not. The reason 750 is a significant number is that it is the actual display pixel width of an iPhone 6-8 device.

Take a look at this list for all the iOS devices whose browsers or displays report odd numbered sizes: https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html

I was using software rendering because hardware rendering has motion artifacts.

To Reproduce Steps to reproduce the behavior:

  1. Set rendering size to 750x750.
  2. Disable hardware encoding.
  3. Visit the page on an iOS device.
  4. Observe an incorrectly decoded image of sideways stripes.

Expected behavior The video stream should decode fine at any size.

Environment (please complete the following information):

  • OS: iOS 14, Windows 10
  • Browser: Mobile Safari
  • Unity Version: 2020.1
  • Package version: afda2fe376e32ad3c379186b6791f55e5e0d7978 (before WebRTC 2.2.1)

WebRTC 2.2.1 is showing other issues so I reverted to an earlier build. I believe all versions of WebRTC have this issue, but I haven't yet tested.

doctorpangloss avatar Nov 23 '20 16:11 doctorpangloss

This reproduces in com.unity.webrtc 2.3.1.

doctorpangloss avatar Jan 11 '21 08:01 doctorpangloss

Sure. We will check it. Thanks

karasusan avatar Jan 12 '21 01:01 karasusan

The software codec appears to fail in NPOT sizes.

doctorpangloss avatar Jul 15 '21 00:07 doctorpangloss

memo: WRS-162

karasusan avatar Nov 22 '21 05:11 karasusan

To clarify, it appears to be that iOS only decodes software (VP8) with horizontal multiples of 64.

doctorpangloss avatar Nov 22 '21 05:11 doctorpangloss

@doctorpangloss Thank you for clarifying the problem We will confirm it in the next development.

kannan-xiao4 avatar Dec 14 '21 02:12 kannan-xiao4

This issue would be fixed for the PR in WebRTC package. https://github.com/Unity-Technologies/com.unity.webrtc/pull/843

karasusan avatar Dec 08 '22 03:12 karasusan