bakjos / WebCameraFeed

Web Camera plugin for Unreal Engine
63 stars 29 forks source link

The Plugin crashes on Windows on some cameras #8

Open michaelWuensch opened 4 years ago

michaelWuensch commented 4 years ago

Hi there, I used the plugin and got it to work on UE 4.24.

On one PC where I connected a external webcam via USB it worked perfectly. On a Laptop with a built in camera the project crashed.

To test it i setup a completely fresh project. It crashed as soon as I added an Actor to the map that had the WebCam Component, or I added a widget that used the webcam widget. If I went to Settings in windows -> privacy -> Camera and disallowed Programs to access the camera it no longer crashed. But of course then there is no access to the camera.

The Error Log:

[2020.05.20-09.57.37:980][ 0]LogBlueprintUserMessages: [Cam_2] DEVICENAME: [2020.05.20-09.57.37:983][ 0]LogBlueprintUserMessages: [Cam_2] Integrated Camera [2020.05.20-09.57.37:983][ 0]LogLoad: Took 0.588067 seconds to LoadMap(/Game/Player) [2020.05.20-09.57.37:995][ 0]LogSlate: Took 0.000428 seconds to synchronously load lazily loaded font '../../../Engine/Content/Slate/Fonts/Roboto-Regular.ttf' (155K) [2020.05.20-09.57.38:003][ 0]LogLoad: (Engine Initialization) Total time: 1.65 seconds [2020.05.20-09.57.38:005][ 0]LogRenderer: Reallocating scene render targets to support 1536x864 Format 10 NumSamples 1 (Frame:1). [2020.05.20-09.57.38:058][ 0]LogContentStreaming: Texture pool size now 1000 MB [2020.05.20-09.57.38:282][ 2]LogD3D11RHI: Error: Direct3DDevice->CreateTexture2D(TextureDesc,SubResourceData,OutTexture2D) failed at D:/Build/++UE4/Sync/Engine/Source/Runtime/Windows/D3D11RHI/Private/D3D11Texture.cpp:480 with error DXGI_ERROR_DEVICE_REMOVED, Size=128x128x6 PF=10 D3DFormat=DXGI_FORMAT_R16G16B16A16_FLOAT(0x0000000A), NumMips=8, Flags=D3D11_BIND_SHADER_RESOURCE , Usage:0x0, CPUFlags:0x0, MiscFlags:0x4, SampleCount:0x1, SampleQuality:0x0, SubresPtr:0x0000000000000000, SubresPitch:0, SubresSlicePitch:0 [2020.05.20-09.57.38:282][ 2]LogD3D11RHI: [Aftermath] GDynamicRHI=0000022F7F250000, GDX11NVAfterMathEnabled=0, Result=0xFFFFFFFF, bDeviceActive=0

Interestingly it was able to Read out the camera Name right before it crashed (2nd Line) But it also crashed if I removed that and just had the Component in the actor.

bakjos commented 4 years ago

@michaelWuensch have you set a non standard resolution for the camera? Can you try with something like 640x480?

michaelWuensch commented 4 years ago

@bakjos First of all, I have found a solution now with unreal internal tools only and got all webcams running. The reason why I tried this plugin in the first place was that unreals internal tools just returned black for the camera that crashed your plugin. The reason for this was that the camerastrem returns 2 video tracks and I had to select the correct one. Maybe the plugin also has problems with 2 videotracks, as the camera that only returns one worked flawlessly.