Page 1 of 1

Help with Camera Control using ATEM API from C#

PostPosted: Fri Jun 15, 2018 10:28 pm
by Ian Morrish
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?

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

PostPosted: Mon Jun 18, 2018 6:02 am
by Cameron Nichols
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

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

PostPosted: Wed Jun 20, 2018 7:20 pm
by Ian Morrish
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.

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

PostPosted: Thu Jun 21, 2018 5:24 am
by Cameron Nichols
Hi Ian,

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

Regards
Cameron

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

PostPosted: Thu Jun 21, 2018 7:42 am
by Ian Morrish
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.

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

PostPosted: Thu Jun 21, 2018 8:58 am
by Ian Morrish
Still need help with color setting but here is basic control of camera from Midi device :-)