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.)