Unity-Technologies / Unity-Technologies/com.unity.webrtc
[BUG]: The encoder sometimes chooses the wrong minimum level and causes a parameter exception
@karasusan is already working on this.
Since Apr 13, 2023.
- Dominant language
- Assembly
- Stars
- 852
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Description
Package version
3.0.0-pre.4
Environment
* OS: Windows 2022
* Unity version: 2021 LTS
Steps To Reproduce
- Request a 1688x614 frame, frame rate 60, max bit rate 24000000, target bps 4925000
- Observe the level computing code incorrectly computes Level 4 for this request.
- Observe it should be at least 4.2.
- Observe an exception.
m_level = std::max(m_level, NV_ENC_LEVEL_H264_42);resolves the issue.
Windows 2022 LTSC + DirectX 11 + NVEnc streaming to Windows Chrome: Works
Windows 2022 LTSC + DirectX 11 + NVEnc streaming to Mobile Safari, Portrait: Works
Windows 2022 LTSC + DirectX 11 + libvpx streaming to Mobile Safari, Portrait: Works
Windows 2022 LTSC + DirectX 11 + libvpx streaming to Mobile Safari, Landscape: Works
Windows 2022 LTSC + DirectX 11 + NVEnc streaming to Mobile Safari, Landscape: Does not work (see parameters to repro)
Current Behavior
An invalid parameter exception thrown by m_encoder->CreateEncoder(&m_initializeParams);
Expected Behavior
Select Profile 4.2 instead of 4.
Anything else?
The workaround is to always set the level to at least 4.2.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.