Unity-Technologies / Unity-Technologies/com.unity.webrtc
[BUG]: Unity does not negotiate hardware supported codec
@karasusan is already working on this.
Since Oct 4, 2023.
- Dominant language
- Assembly
- Stars
- 852
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Description
Package version
3.0.0-pre.6
Environment
* OS:Windows
* Unity version:2020-2023
Steps To Reproduce
Setup and run your webrtc enabled game with your package and with your client webserver.exe receiver.
Current Behavior
The game consistently utilizes the VP8 codec, which lacks hardware acceleration. As a result, the streaming quality suffers, displaying significant pixelization
This is from the webrtc-internals:
inbound-rtp (kind=video, mid=1, ssrc=4196375540, rtxSsrc=3366492407, decoderImplementation=libvpx, powerEfficientDecoder=false, [codec]=VP8 (127), id=IT01V4196375540)
Expected Behavior
The webrtc connection should negotiate with the hardware supported codec, preferably H264. I have tried the following to force the game to use H264 codec and it did not work:
Order the payloads on the client offer and the unity answer so the H264 codec should take precedence
Remove all other codes but H264 from the client offer
The only way I was able to 'fix' the issue was to override VP8 and VP9 payloads with H264 and the game connected with the client using H264 codec.
Anything else?
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.