BlackMagic Designs Video Switcher SDK - Anyone use it?

Hey all,

Has anyone ever worked with and adopted into Xojo the BlackMagic Designs ATEM video switcher SDK? I have a specific requirement for it and looking at the SDK documentation it looks like something that might be able to be implemented using declares, but it’s a bit beyond what I know I can do.

I thought I’d ask here on the off chance someone has worked with this.

Thanks,

Jon

1 Like

I know one person that knows about cameras very well maybe he has experience with this who knows @Edwin_van_den_Akker

2 Likes

I don’t really work with the BMD switchers. I more a ATEM kind of guy. And I never played around with their APIs.

Some cameras and camera related equipment can communicate via HTTP and REST. I did write something a long time ago, that could trigger 14 RED cameras at once, just over the camera’s fiber connection, that included a regular network connection, via glass. It was used for “Sensation White”, a very well known Techno concert in The Netherlands. But that is not in the scope of the OP’s question.

My first thought is to check how to deal with declares to connect with the BMD SDK library the same way as you would do by calling DLLs in other SDKs.

I like this topic though. So, I will follow this with interest.

1 Like

It is an ATEM I am trying to control. Their new ATEM Mini. I only need a couple of functions. I wish they had an HTTP or REST interface. That would be easy.

My challenge is I’m really not much of an expert (in fact I know very little) on declares and using them.

Maybe post a couple of the API calls from the SDK and the file name of the library (ie: black-magic-lib.so or black-magic-lib.dyld) and maybe someone can chime in with some declares to help.

Hi Don,

Here’s the main call I am interested in. Not sure if I am giving you anything useful…

IBMDSwitcherStreamRTMP::StartStreaming method

The StartStreaming method starts video and audio streaming to the configured streaming server. Syntax

HRESULT StartStreaming()

Return Values

Value Description
S_OK Success.
S_FALSE Already streaming.
E_FAIL Failure.

IBMDSwitcherStreamRTMP::StopStreaming method

The StopStreaming method stops video and audio streaming to the configured streaming server. Syntax

HRESULT StopStreaming()

Return Values

Value Description
S_OK Success.
S_FALSE Not currently streaming.
E_FAIL Failure.

To use the API, the documentation says the project needs to use the include file:

Windows Switchers X.Y\Win\Include\BMDSwitcherAPI.idl
macOS Switchers X.Y/macOS/Include/BMDSwitcherAPI.h

This is from the API.h file from the example project they give:
/* Interface IBMDSwitcherStreamRTMP - Switcher Stream RTMP Object */

class BMD_PUBLIC IBMDSwitcherStreamRTMP : public IUnknown
{
public:
    virtual HRESULT StartStreaming (void) = 0;
    virtual HRESULT StopStreaming (void) = 0;
    virtual HRESULT IsStreaming (/* out */ bool* streaming) = 0;
    virtual HRESULT GetStatus (/* out */ BMDSwitcherStreamRTMPState* state, /* out */ BMDSwitcherStreamRTMPError* error) = 0;
    virtual HRESULT SetServiceName (/* in */ CFStringRef serviceName) = 0;
    virtual HRESULT GetServiceName (/* out */ CFStringRef* serviceName) = 0;
    virtual HRESULT SetUrl (/* in */ CFStringRef url) = 0;
    virtual HRESULT GetUrl (/* out */ CFStringRef* url) = 0;
    virtual HRESULT SetKey (/* in */ CFStringRef url) = 0;
    virtual HRESULT GetKey (/* out */ CFStringRef* key) = 0;
    virtual HRESULT SetVideoBitrates (/* in */ uint32_t lowBitrate, /* in */ uint32_t highBitrate) = 0;
    virtual HRESULT GetVideoBitrates (/* out */ uint32_t* lowBitRate, /* out */ uint32_t* highBitRate) = 0;
    virtual HRESULT SetAudioBitrates (/* in */ uint32_t lowBitrate, /* in */ uint32_t highBitrate) = 0;
    virtual HRESULT GetAudioBitrates (/* out */ uint32_t* lowBitRate, /* out */ uint32_t* highBitRate) = 0;
    virtual HRESULT RequestDuration (void) = 0;
    virtual HRESULT GetDuration (/* out */ uint8_t* hours, /* out */ uint8_t* minutes, /* out */ uint8_t* seconds, /* out */ uint8_t* frames, /* out */ bool* dropFrame) = 0;
    virtual HRESULT GetEncodingBitrate (/* out */ uint32_t* encodingBitrate) = 0;
    virtual HRESULT GetCacheUsed (/* out */ double* cacheUsed) = 0;
    virtual HRESULT SetAuthentication (/* in */ CFStringRef username, /* in */ CFStringRef password) = 0;
    virtual HRESULT GetAuthentication (/* out */ CFStringRef* username, /* out */ CFStringRef* password) = 0;
    virtual HRESULT SetLowLatency (/* in */ bool lowLatency) = 0;
    virtual HRESULT GetLowLatency (/* out */ bool* lowLatency) = 0;
    virtual HRESULT AddCallback (/* in */ IBMDSwitcherStreamRTMPCallback* callback) = 0;
    virtual HRESULT RemoveCallback (/* in */ IBMDSwitcherStreamRTMPCallback* callback) = 0;

protected:
    virtual ~IBMDSwitcherStreamRTMP () {} // call Release method to drop reference count
};