Help with Camera Control using ATEM API from C#

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

Ian Morrish

  • Posts: 232
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Help with Camera Control using ATEM API from C#

PostFri Jun 15, 2018 10:28 pm

I'm trying to get camera control working. If I'm doing the right thing (probably not), should I expect to see changes in the Software control panel, even if no camera is connected?

public void CamerIris(uint CameraID, short IrisValue)
{
IBMDSwitcherCameraControl xcameraControl = (IBMDSwitcherCameraControl)switcher;
xcameraControl.SetInt16s(CameraID, 0, 3, 1, ref IrisValue);
}

switcher object is valid and I can read the GetPeriodicFlushInterval value fine with
cameraControl.GetPeriodicFlushInterval(out _PeriodicFlushInterval);

Guessing it is something to do with the by ref value.
C++ example shows this as an array but I have not found any option to make that work in C#

Bound to be something simple, Anyone know what I'm doing wrong?
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 93
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Help with Camera Control using ATEM API from C#

PostMon Jun 18, 2018 6:02 am

Hi Ian,

In the Camera Control manual - command 0.3 is expecting type fixed16 (with range 0.0 to 1.0), so you will need to set with IBMDSwitcherCameraControl::SetFloats method.

The setting for iris in the ATEM Software Control software follows command 0.2 - Aperture (f-stop), not command 0.3, so you will not see the setting update.

Regards
Cameron
Offline

Ian Morrish

  • Posts: 232
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: Help with Camera Control using ATEM API from C#

PostWed Jun 20, 2018 7:20 pm

Thanks Cameron,
I managed to get display settings updating on a camera like

public void CameraDisplayBrightness(uint CameraID, double BrightnessValue)
{
IBMDSwitcherCameraControl xcameraControl = (IBMDSwitcherCameraControl)switcher;
xcameraControl.SetFloats(CameraID, 4, 0, 1, BrightnessValue);
}

It helped when I figured out that CameraID starts at 0 for the first camera mapped to an ATEM input, not the actual camera ID set in the camera.

But I still can't get lens or chip settings to change. Had only ust picked up a Studio camera so need to check it has latest firmware.
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Cameron Nichols

Blackmagic Design

  • Posts: 93
  • Joined: Mon Sep 04, 2017 4:05 am

Re: Help with Camera Control using ATEM API from C#

PostThu Jun 21, 2018 5:24 am

Hi Ian,

What commands are you sending to the camera, and which model/firmware studio camera?

Regards
Cameron
Offline

Ian Morrish

  • Posts: 232
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: Help with Camera Control using ATEM API from C#

PostThu Jun 21, 2018 7:42 am

Thanks for perservering with me.
Managed to get Iris working. I think it was another computer running the software panel that kept overwriting the values I was send by code (Flush?)
So I can get single value data types working but not the ones that require index of more than 1.
E.g. I if I want to set the gain of all colors at the same time (like the wheel in the software does, thought I would do something like
public void CamerGain(uint CameraID, double gainValue)
{
double[] gainvalues = new double[3];
for (int values = 0; values <4; values++)
{
gainvalues[values] = gainValue;
}
IBMDSwitcherCameraControl xcameraControl = (IBMDSwitcherCameraControl)switcher;
xcameraControl.SetFloats(CameraID, 8, 2, 4, gainvalues);
}

but SetFloats won't take an array.
Using ATEM 7.3 API. Camera is Studio 4k 2.
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

Ian Morrish

  • Posts: 232
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: Help with Camera Control using ATEM API from C#

PostThu Jun 21, 2018 8:58 am

Still need help with color setting but here is basic control of camera from Midi device :-)
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 2 guests