Blank video when recording from Windows Service
Windows Vista and later are running Windows Service apps under a session 0 (different from the main desktop user) that does not have access to the screen. This is done for security purposes to prevent unwanted desktop screen recording/ capturing. More details are available at https://techcommunity.microsoft.com/t5/ask-the-performance-team/application-compatibility-session-0-isolation/ba-p/372361
To fix the issue with black screen on the capture video please run your app as Windows forms or script that runs under the main Windows user (not as Windows Service app which uses a different user).