MathewSachin / Captura

Capture Screen, Audio, Cursor, Mouse Clicks and Keystrokes
https://mathewsachin.github.io/Captura/
MIT License
9.55k stars 1.79k forks source link

dose not work on my terminalserver #454

Open warichnict opened 4 years ago

warichnict commented 4 years ago

Describe the bug on my personal ts it dose not work, on the one of my company it dose

To Reproduce Steps to reproduce the behavior:

  1. windows server 2012r2 latest updates on kvm with drivers installed (from virtio-win-0.1.1 iso)
  2. install captura, start it click record
  3. See error SharpDX.SharpDXException: HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.

    at SharpDX.Result.CheckError() at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut) at DesktopDuplication.MfWriter..ctor(VideoWriterArgs Args, Device Device) at Captura.Models.MfItem.GetVideoFileWriter(VideoWriterArgs Args) at Captura.ViewModels.RecordingModel.GetVideoFileWriter(IImageProvider ImgProvider, IAudioProvider AudioProvider, RecordingModelParams RecordingParams, String FileName) at Captura.ViewModels.RecordingModel.GetVideoFileWriterWithPreview(IImageProvider ImgProvider, IAudioProvider AudioProvider, RecordingModelParams RecordingParams) at Captura.ViewModels.RecordingModel.SetupVideoRecorder(IAudioProvider AudioProvider, RecordingModelParams RecordingParams)SharpDX.SharpDXException: HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.

    at SharpDX.Result.CheckError() at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut) at DesktopDuplication.MfWriter..ctor(VideoWriterArgs Args, Device Device) at Captura.Models.MfItem.GetVideoFileWriter(VideoWriterArgs Args) at Captura.ViewModels.RecordingModel.GetVideoFileWriter(IImageProvider ImgProvider, IAudioProvider AudioProvider, RecordingModelParams RecordingParams, String FileName) at Captura.ViewModels.RecordingModel.GetVideoFileWriterWithPreview(IImageProvider ImgProvider, IAudioProvider AudioProvider, RecordingModelParams RecordingParams) at Captura.ViewModels.RecordingModel.SetupVideoRecorder(IAudioProvider AudioProvider, RecordingModelParams RecordingParams)

SharpDX.SharpDXException: HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.

at SharpDX.Result.CheckError() at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut) at DesktopDuplication.MfWriter..ctor(VideoWriterArgs Args, Device Device) at Captura.Models.MfItem.GetVideoFileWriter(VideoWriterArgs Args) at Captura.ViewModels.RecordingModel.GetVideoFileWriter(IImageProvider ImgProvider, IAudioProvider AudioProvider, RecordingModelParams RecordingParams, String FileName) at Captura.ViewModels.RecordingModel.GetVideoFileWriterWithPreview(IImageProvider ImgProvider, IAudioProvider AudioProvider, RecordingModelParams RecordingParams) at Captura.ViewModels.RecordingModel.SetupVideoRecorder(IAudioProvider AudioProvider, RecordingModelParams RecordingParams)

Expected behavior some mp4 file is crated

Screenshots not appliable

server:

Additional context Add any other context about the problem here like FFmpeg Log or error messages.

warichnict commented 4 years ago

ffmpeg log is emty

warichnict commented 4 years ago

latest captura version ju just downloaded frok

warichnict commented 4 years ago

https://github-production-release-asset-2e65be.s3.amazonaws.com/41589439/f76c6680-6f64-11e9-8436-b00503cbe61f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20191107%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20191107T004159Z&X-Amz-Expires=300&X-Amz-Signature=9dd0b0cc544575e1c1fe68433d319856c41cf1f99043c26ee4f2948bea7069dd&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3DCaptura-Setup.exe&response-content-type=application%2Foctet-stream

warichnict commented 4 years ago

v9.0.0

warichnict commented 4 years ago

sorry my rdp client connection is instable

warichnict commented 4 years ago

thanks for help in advance

warichnict commented 4 years ago

SharpDX.SharpDXException: HRESULT: [0x8899000C], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_RECREATE_TARGET/RecreateTarget], Message: There has been a presentation error that may be recoverable. The caller needs to recreate, rerender the entire frame, and reattempt present.

at SharpDX.Result.CheckError() at DesktopDuplication.Direct2DEditorSession.EndDraw() at DesktopDuplication.Direct2DEditor.GenerateFrame() at Screna.Recorder.<>c__DisplayClass14_0.b2() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Screna.Recorder.d14.MoveNext()

MathewSachin commented 4 years ago

Did you try using Captura v8?

ericjang commented 4 years ago

I built the latest version of Captura from source (Windows 10, Visual Studio Sln) and was able to reproduce the same error message posted by @warichnict

This happens reliably when I use two monitors, but when I switch Captura to record just one monitor, it's fine. I suspect it's an issue with multi-monitor setups.

MathewSachin commented 4 years ago

Some people got this error on single monitor setups too. I've not been able to determine the cause of this error. Enabling the debug modes of Direct2D/Direct3D might help. Windows SDK needs to be installed for this. Right now I'm having a very bad internet connection and my country is in lockdown. It would be really helpful if someone would run Captura in Direct2D/Direct3D debug modes and report the results to me. @ericjang Do you have Windows SDK installed?

ericjang commented 4 years ago

Thanks for the speedy reply. I can give it a shot, but I'm a Windows / C# noob so this might take some time. Should I look into https://docs.microsoft.com/en-us/windows/win32/direct2d/direct2ddebuglayer-overview to get started?

MathewSachin commented 4 years ago

Glad that you are willing to help. Yep, that link contains the required info.

Some things you need to do:

  1. Install Windows SDK. This can be installed using Visual Studio installer.

  2. Direct2D debug layer Direct2D Factory is created here: https://github.com/MathewSachin/Captura/blob/16372b1651f8e5a35ab42d6d49be171eec8f024c/src/Captura.Windows/Imaging/Direct2D/Direct2DEditorSession.cs#L90

    Debug options need to be passed here like shown in the link. It would be a bit different regarding parameter names, but visual studio should help with that.

  3. Run the app and start recording, if you get an error that a library is missing with Layers in its name, you need to enable an optional service in Windows 10. But, this should already be enabled.

Let me know if you need more help.