Skip to content

Conversation

@wintbiit
Copy link

@wintbiit wintbiit commented Dec 6, 2025

Summary

This PR demonstrates H.265 support implementation for the WebRTC package. Key changes include:

Changes

  1. Upgraded libwebrtc to Chromium M136 (commit 7103) and resolved API incompatibilities
  2. Added H.265 encoder/decoder support in the NvEnc module

Validation

  • Platform: Windows11 x86_64
  • Editor: 2022.3.62f3
  • Hardware: NVIDIA RTX 4070 (CUDA capability major version = 8)
  • Verification:
    • RTCRtpSender.GetCapabilities(TrackKind.Video).codecs now returns H265
    • Successful H.265 cideo streaming confirmed with WebApp

Screenshots

RTCRtpSender.GetCapabilities(TrackKind.Video).codecs
RTCRtpSender.GetCapabilities(TrackKind.Video).codecs

Mobile client receiving H265

Successful H.265 cideo streaming confirmed with WebApp
H265 video quality sample

Scope Note

This is a proof-of-concept implementation with current limitations:

  • Only validated on my own Windows x64 with NVIDIA 4070
  • other platforms such as Linux/Android are not tested nor libwebrtc built

Seeking for:

  1. Feedbacks on how do you maintainers think about H.265 support on unity webrtc package, is this widely needed? (yes at least for me)
  2. Support on resolving api incompatibilities and bugs introduced, and build for all platforms.

@cla-assistant-unity
Copy link

cla-assistant-unity bot commented Dec 6, 2025

CLA assistant check
All committers have signed the CLA.

@elhigu
Copy link

elhigu commented Dec 17, 2025

With this when I try to open WebRTC Stats window, application always crashes. With latest official pakckage stats are collected just fine.


=================================================================
	Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
	Managed Stacktrace:
=================================================================
	  at <unknown> <0xffffffff>
	  at Unity.WebRTC.NativeMethods:StatsMemberGetName <0x000c0>
	  at Unity.WebRTC.RTCStatsMember:GetName <0x0008a>
	  at Unity.WebRTC.RTCStats:.ctor <0x0024a>
	  at Unity.WebRTC.RTCCertificateStats:.ctor <0x0007a>
	  at <>c:<.cctor>b__1_13 <0x0009a>
	  at Unity.WebRTC.StatsFactory:Create <0x00119>
	  at Unity.WebRTC.RTCStatsReport:.ctor <0x004b2>
	  at <>c:<OnCollectStatsCallback>b__38_1 <0x0009a>
	  at Unity.WebRTC.WebRTC:FindOrCreate <0x005b0>
	  at <>c__DisplayClass38_0:<OnCollectStatsCallback>b__0 <0x00202>
	  at Unity.WebRTC.WebRTC:SendOrPostCallback <0x001f6>
	  at WorkRequest:Invoke <0x000aa>
	  at Unity.WebRTC.ExecutableUnitySynchronizationContext:Execute <0x00432>
	  at Unity.WebRTC.ExecutableUnitySynchronizationContext:ExecuteAndAppendNextExecute <0x00102>
	  at Unity.WebRTC.ExecutableUnitySynchronizationContext:SendOrPostCallback <0x000e3>
	  at WorkRequest:Invoke <0x000aa>
	  at UnityEngine.UnitySynchronizationContext:Exec <0x0047a>
	  at UnityEngine.UnitySynchronizationContext:ExecuteTasks <0x0014a>
	  at System.Object:runtime_invoke_void <0x00184>
=================================================================
Crash!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants