Opened 4 years ago

Closed 4 years ago

#4505 closed defect (duplicate)

gdigrab is not dpi-aware

Reported by: cracki Owned by:
Priority: normal Component: avdevice
Version: unspecified Keywords: gdigrab, windows
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

gdigrab on win8.1 and a dpi-scaled screen will capture a cropped desktop, exactly as much as implied by the dpi scaling factor. on win7, the whole screen is captured.

How to reproduce:

  • use windows 8.1+ (something that does transparent dpi scaling to unaware programs and fakes system parameters)
  • ffmpeg -f gdigrab -framerate 15 -i desktop -c:v qtrle out.mov

I'm using an ffmpeg zeranoe build from december 2014.

someone on the internet suggested calling SetProcessDPIAware() (before any win32 graphics code). https://msdn.microsoft.com/en-us/library/windows/desktop/ms633543%28v=vs.85%29.aspx

a manifest file might be better (see 'race condition' in the previous link). https://msdn.microsoft.com/en-us/library/windows/desktop/ff684173(v=vs.85).aspx

there's also SetProcessDpiAwareness?() https://msdn.microsoft.com/en-us/library/windows/desktop/dn302122(v=vs.85).aspx as found on https://msdn.microsoft.com/en-us/library/windows/desktop/dd464659(v=vs.85).aspx

GetDeviceCaps(source_hdc, HORZRES) (or other indices) might alternatively report correct values, or they might not.

Change History (1)

comment:1 Changed 4 years ago by rogerdpack

  • Resolution set to duplicate
  • Status changed from new to closed

Seems to be a dupe of #4232

Note: See TracTickets for help on using tickets.