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

[BUG]: Unity is crashing when receiving a video

Open
#626 5 comments 0 reactions 1 assignee View on GitHub

@karasusan is already working on this.

Since Feb 10, 2022.

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

Description

Package version

2.4.0-exp.5

Environment
* OS: Windows 11
* Unity version: Unity 2020.3
Steps To Reproduce

The following code displays the video on the screen but sometimes crashes for no reason

peer.OnTrack = e => {
    if (e.Track.Kind == TrackKind.Video)
    {
        (e.Track as VideoStreamTrack).OnVideoReceived += tex => 
        {
            rawImage.texture = tex;
        };
    }
};
Current Behavior
The thread tried to read from or write to a virtual address for which it does not have the appropriate access.

========== OUTPUTTING STACK TRACE ==================

0x00007FF8F8D4FC90 (nvwgf2umx) OpenAdapter12
0x00007FF8F7F39221 (nvwgf2umx) NVENCODEAPI_Thunk
0x00007FF8F876EDE1 (nvwgf2umx) cask::SafeEnum<cask::md::Algorithm_ENUMCLASS_SCOPEWRAPPER>::operator=
0x00007FF8F875DE97 (nvwgf2umx) cask::SafeEnum<cask::md::Algorithm_ENUMCLASS_SCOPEWRAPPER>::operator=
0x00007FF96DF8FEC0 (d3d11) CreateDirect3D11SurfaceFromDXGISurface
0x00007FF753485CE9 (Unity) GfxDeviceD3D11Base::InsertPluginTextureUpdateCallback
0x00007FF75547C3BE (Unity) GfxDeviceWorker::RunCommand
0x00007FF755482BED (Unity) GfxDeviceWorker::RunExt
0x00007FF755482D08 (Unity) GfxDeviceWorker::RunGfxDeviceWorker
0x00007FF753B1F335 (Unity) Thread::RunThreadWrapper
0x00007FF976C254E0 (KERNEL32) BaseThreadInitThunk
0x00007FF97810485B (ntdll) RtlUserThreadStart
Expected Behavior

No response

Anything else?

No response

EDIT: The bug isn't there in 2.4.0-exp.4 when using VideoStreamTrack.InitializeReceiver(w, h)
EDIT x2: The bug isn't there when Hardware decoder is enabled

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.