[GH-ISSUE #696] DirectX capture mode only works on primary display #567

Closed
opened 2026-02-26 09:31:55 +03:00 by kerem · 5 comments
Owner

Originally created by @macklinb on GitHub (Jul 23, 2020).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/696

Originally assigned to: @NickeManarin on GitHub.

When I start a DX recording containing any part of my second monitor, the recording fails to start and I get the following exception:

Object reference not set to an instance of an object.
   at SharpDX.DXGI.OutputDuplication.TryAcquireNextFrame(Int32 timeoutInMilliseconds, OutputDuplicateFrameInformation& 
frameInfoRef, Resource& desktopResourceOut)
   at ScreenToGif.Util.Capture.DirectImageCapture.Capture(FrameInfo frame)

However if I move the recording window over so that it only captures my primary monitor, the recording works fine. If I make the second monitor my "main display" in the Windows Settings app, the behavior is reversed. This might be an issue with SharpDX and not ScreenToGif, not sure.

Fantastic tool by the way, I use it all the time 👍

Originally created by @macklinb on GitHub (Jul 23, 2020). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/696 Originally assigned to: @NickeManarin on GitHub. When I start a DX recording containing any part of my second monitor, the recording fails to start and I get the following exception: Object reference not set to an instance of an object. at SharpDX.DXGI.OutputDuplication.TryAcquireNextFrame(Int32 timeoutInMilliseconds, OutputDuplicateFrameInformation& frameInfoRef, Resource& desktopResourceOut) at ScreenToGif.Util.Capture.DirectImageCapture.Capture(FrameInfo frame) However if I move the recording window over so that it only captures my primary monitor, the recording works fine. If I make the second monitor my "main display" in the Windows Settings app, the behavior is reversed. This might be an issue with SharpDX and not ScreenToGif, not sure. Fantastic tool by the way, I use it all the time :thumbsup:
kerem 2026-02-26 09:31:55 +03:00
Author
Owner

@NickeManarin commented on GitHub (Sep 8, 2020):

Hi, can you try out version 2.27?

<!-- gh-comment-id:689183360 --> @NickeManarin commented on GitHub (Sep 8, 2020): Hi, can you try out version 2.27?
Author
Owner

@macklinb commented on GitHub (Sep 9, 2020):

Works like a charm, thanks! I assume recording across multiple displays isn't supported in DirectX mode?

<!-- gh-comment-id:689292664 --> @macklinb commented on GitHub (Sep 9, 2020): Works like a charm, thanks! I assume recording across multiple displays isn't supported in DirectX mode?
Author
Owner

@NickeManarin commented on GitHub (Sep 9, 2020):

I meant for you to try recording on a secondary monitor using v2.27. Does it work?

I forgot to ask: Are you using a laptop or 2-in-1 computer?
I'm asking this because it's the DesktopDuplication API (DirectX) does not support the recording from a secondary monitor on machines with mobile processors.

<!-- gh-comment-id:689551231 --> @NickeManarin commented on GitHub (Sep 9, 2020): I meant for you to try recording on a secondary monitor using v2.27. Does it work? I forgot to ask: Are you using a laptop or 2-in-1 computer? I'm asking this because it's the DesktopDuplication API (DirectX) does not support the recording from a secondary monitor on machines with mobile processors.
Author
Owner

@macklinb commented on GitHub (Sep 9, 2020):

Oh I see, I didn't actually check that - sorry!

A recording that is entirely on my second monitor does not work (produces a blank/transparent image).

If the majority of the recording window is on the secondary monitor, but a portion is overlapping the primary monitor (say, the right side of my left hand monitor), the part of the recording window that is on the secondary screen is blank/transparent, and the part of the recording window that is on the primary screen wraps around to the left side of the secondary monitor, showing whatever content is there. Not sure how relevant this is, but I took some screenshots to further clarify:

secondary_overlap_primary_window
secondary_overlap_primary_result

A recording on the primary monitor works of course, but if a portion of the recording window is overlapping the secondary monitor, it is blank/transparent.

primary_overlap_secondary_window
primary_overlap_secondary_result

I'm not using a laptop or a 2-in-1, just a desktop machine with a desktop processor. Both monitors are connected to the same dedicated GPU - no mix of iGPU and dGPU or anything like that.

<!-- gh-comment-id:689638187 --> @macklinb commented on GitHub (Sep 9, 2020): Oh I see, I didn't actually check that - sorry! A recording that is entirely on my second monitor does not work (produces a blank/transparent image). If the majority of the recording window is on the secondary monitor, but a portion is overlapping the primary monitor (say, the right side of my left hand monitor), the part of the recording window that is on the secondary screen is blank/transparent, and the part of the recording window that is on the primary screen wraps around to the left side of the secondary monitor, showing whatever content is there. Not sure how relevant this is, but I took some screenshots to further clarify: ![secondary_overlap_primary_window](https://i.imgur.com/b0awRMv.png) ![secondary_overlap_primary_result](https://i.imgur.com/nyaWgVV.png) A recording on the primary monitor works of course, but if a portion of the recording window is overlapping the secondary monitor, it is blank/transparent. ![primary_overlap_secondary_window](https://i.imgur.com/thNEl0x.png) ![primary_overlap_secondary_result](https://i.imgur.com/zwGZQIA.png) I'm not using a laptop or a 2-in-1, just a desktop machine with a desktop processor. Both monitors are connected to the same dedicated GPU - no mix of iGPU and dGPU or anything like that.
Author
Owner

@NickeManarin commented on GitHub (Apr 21, 2021):

It's now possible to capture in a non-primary screen (if it's not a laptop).

<!-- gh-comment-id:823770893 --> @NickeManarin commented on GitHub (Apr 21, 2021): It's now possible to capture in a non-primary screen (if it's not a laptop).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#567
No description provided.