Using Blackmagic drivers from a windows service.

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

keulersruud

  • Posts: 2
  • Joined: Fri Oct 18, 2019 11:07 am
  • Real Name: Ruud Keulers

Using Blackmagic drivers from a windows service.

PostFri Oct 18, 2019 11:16 am

Dear readers of this message,

We are using a Blackmagic intensity Pro card (Device display name: Blackmagic DeckLink Mini Recorder 4K, driver date July 2nd 2018, driver version 10.9.11.0) for video input. We are using our self-built C++/Qt/Opencv software for capturing 4K frames.
This piece of software (called ImageCapture) is being used for some years without any problems.
If we start the ImageCapture with a logged in user, it works without any problems.
However, as soon as we start a windows service which on his turn starts the ImageCapture as a child process, then the ImageCapture reports :
Please install the Blackmagic Desktop Video drivers to use the features of this application.

Some background information :
• The windows service is running using a real admin account (domainAdminUser).
• The windows service is built using .net with a manifest that required admin elevated rights
• If the windows service is not started as a service, but started as a normal process, the ImageCapture is able to capture images.
• A windows service can’t write a log file in its “program files” folder.

What can I change, so the ImageCapture can capture images using the Blackmagic video drivers and the windows service will be started as real windows service.

Could it be that de “Blackmagic desktop video drivers” are installed in the ‘program files’ folder and therefore unreachable for our ImageCapture program? (I already tried to give the domainAdminUser full control to the Blackmagic folder)

Thank you.

Ruud
Offline

Brendan Dower

Blackmagic Design

  • Posts: 11
  • Joined: Thu Oct 10, 2019 5:56 am
  • Real Name: Brendan Dower

Re: Using Blackmagic drivers from a windows service.

PostMon Oct 21, 2019 4:50 am

Hi Ruud,

It appears that the Blackmagic API files are in fact installed in the Program Files folder. If you're trying to access these using a Windows Service they will be unreachable due to security permissions of the directory.

However, running your Windows Service as an administrator should allow you to read and execute from the Program Files directory. It sounds like you might be running the service not as an administrator, despite being logged in as an administrator.
Can you confirm that you running the Windows Service with elevated admin rights? (Right-click -> Run as Administrator)

If still isn't working then this may be because you aren't the owner of the folder (ie. its owned by the user, or by the SYSTEM). Heres a link from Microsoft which shows how to change ownership of the directory, but it is not advised to write anything to the Program Files directory:
https://docs.microsoft.com/en-us/previo ... (v=msdn.10)

Alternatively, you could save your logs to an alternate location, such as the desktop or My Documents and then move is using a script to the Program Files directory.
I'm not sure if that will help this specific case, but it is an alternative for if you need to save something to Program Files.

I hope this helps.
Last edited by Brendan Dower on Tue Oct 29, 2019 5:11 am, edited 5 times in total.
Brendan Dower
Blackmagic Design Developer Support
Offline

keulersruud

  • Posts: 2
  • Joined: Fri Oct 18, 2019 11:07 am
  • Real Name: Ruud Keulers

Re: Using Blackmagic drivers from a windows service.

PostTue Oct 22, 2019 10:48 am

Hello Brendan,

Thank you for your reply, I recognize all your comments.

I compiled the windows service (project type : Debuggable service) with a manifest to require admin rights. I can see the result when the icon of the application shows the admin logo inside the icon (that little shield).

I found that our logging was written in C:\Windows\SysWOW64 and we handled this by writing our log files to C:\logging\myService\xxxxx.log. This is of course a very easy to handle issue.

I agree that is really looks like that the service is not having admin rights. But I am surprised that when I login with our domainUser account (according to our network administrator, this account is admin level) and I run the service via commandline, it works as expected. I selected this account at the 'logon' tab of the service properties. I tried to use another 'real admin' account, but this has the same effect. I also tried some other combinations like 'Local system account'.

If I capture the output of the child process it says :
'Please install the Blackmagic Desktop Video drivers to use the features of this application'

------------------------------------------
OurWindowsService with WCF service
(starts child processes and executes requests on demand)
------------------------------------------
|
V
start or executeOnDemand
|
V
---------------- ------------ ------------
ImageCapture SavePhoto WriteVideo
---------------- ------------ ------------
| _____________^ ______^
v |
------------------
Shared memory
with 4K frames
------------------


The ImageCapture process is the C++ program which shows the message.

I assume that the message is being produced by the decklink sdk part in our c++ application 'ImageCapture'.

Could it help if I copy some files of the blackmagic desktop video driver to my C:\program files\xxx\OurWindowsService folder?

Grtz Ruud.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 6 guests