How to use Atem SDK in C#?

3 posts / 0 new
Last post
Offline

Location

Milan,
Italy
Joined: 12/03/2016
Posts: 2
How to use Atem SDK in C#?

Hello everyone!

I begin immediately apologizing for my English, I'm Italian.

For some years now I own the ATEM production studio 4K, and I must say it's very good at his job, but with the passing of the time in my work I need new functions that Atem alone shouldn't do, or doesn't do in an optimal manner. So very often to do what I needed I leaning on vMix, as for example sending video and lower third in the Atem using an HDMI. The problem with this is that we need another person running from another PC with vMix or still the same person of the director must manage two PCs together. Now we have to do a job where next week require immediacy in these operations, so initially I was thinking of a web console to manage only vMix, and all in all it works but I want something more stable and simplified.

For this a few days ago I began to study C#, just because I want to automate these operations, and so far what I have managed to do is manage vMix, as it is quite simple since you just open a link to control it. Now I got to the point of having to connect the ATM to manage the preview and program, but unfortunately it seems much more difficult than what I expected. As you know the Atem in its SDK has an .idl file, and from what I have read on the internet must be converted into tlb and finally in dll to be used in C#. I tried using MIDL with different commands, but with no results, I tried to do much research on the internet but no one explains precisely how to use these APIs, so I finally decided to ask for help here, in the hope that someone can help me.

So my question is: how to use this .idl file in C#? And then how to send commands to the Atem via ethernet?

And possibly I don't want just to know only the code, I would also like to know how everything works, also because I would learn everything well, not just make it work :P

In any case, thank you in advance for any help!

imorrish's picture
Offline

Location

Wellington
New Zealand
Joined: 05/01/2015
Posts: 68
Hi, There is a sample C# win

Hi,

There is a sample C# win forms application in the SDK samples folder.

I have started adding some ATEM automation to a library based on http://github.com/murray-mint/atemlib as it was a class library that didn't rely on a form.

By far the easiest solution is to use JustMacros, but like you I wanted to understand how they ATEM works and at the same time learn C#.

This was not the easiest for me but I'm slowly making progress and finding lots of other GitHub projects that are also helping.

http://github.com/imorrish/atemlib is what I'm working on, primarily to use from PowerShell but I have added a few console apps apps also.

Regards,

Ian

Offline

Location

Milan,
Italy
Joined: 12/03/2016
Posts: 2
First of all thank you for

First of all thank you for the answer!

In any case, in part I managed to make it work, before I had seen the SDK examples given, but I did not understand why he gave me a lot of mistakes and could not compile. Now installing the ATEM Switcher in the pc where I'm programming it seems that the problem is resolved, so I could take the generated dll file (or, at least I think it is generated) from the examples and use it in my project. By the time I figured out how it can see if the Atem is connected or not, but now I have some problems in sending commands, such as changing the program or preview, I'm trying to learn from the examples, although now as now I can't quite understand.

In any case thank you again for the help!

EDIT: Ok, I managed to communicate with the Atem, I had downloaded an older version of the SDK, as the atem has an old firmware. The project I had started the .NET Framework 4.5.2, putting 3.5 everything worked!