1

I'm trying to capture screen video to emulate similar functionality as TeamViewer and mstsc (while supporting multiple logins), which is currently being done wonderfully using ffmpeg with "-f gdbgrab" option.

However, whenever I switch user, including trying to elevate to administrator, not only I cannot capture the UAC or logon screens, but the process terminates completely:

[gdigrab @ 07e34780] Failed to capture image (error 5)
desktop: I/O error

(the same happens when running as Administrator and even SYSTEM)

From what I understand, this is due to Windows having different sessions for the logon screen, UAC screen, etc. and from what I've read here: Session 0 capture screen - it seems you cannot capture video from other sessions, nor connect to multiple sessions, hence mstsc is not being used either.

TeamViewer is able to capture UAC and even logon screen. How so?

(optimally, I would used mstsc however it logs-off already logged users)

This is what I currently use to stream:

ffmpeg -f gdigrab -framerate 10 -i desktop -rtmp_live live -c:v mpeg4 -f rtsp -rtsp_transport udp rtsp://localhost:8888/live.sdp?udp

(I already have a more-or-less functional solution for HID input but may also not work properly with UAC, etc.)

Jack
  • 53
  • 1
  • 4
  • Error code 5 translates to *"Access denied"*. The UAC prompt is displayed in the Secure Desktop. I don't know what it takes to gain access to that, but I believe access is restricted to trusted applications running as SYSTEM. – IInspectable Feb 05 '18 at 12:23
  • The same error occurs running as either Adminstrator and even SYSTEM. – Jack Feb 05 '18 at 12:38
  • Running as SYSTEM doesn't automatically turn an application into a trusted application. – IInspectable Feb 05 '18 at 12:54
  • What does? how does TeamViewer solve this issue?I solved this locally by disabling the Secure Desktop feature in the test environment, but I do want to support switching desktops/sessions. – Jack Feb 06 '18 at 12:32

0 Answers0