How to force upstream keyer on or off

Questions about ATEM Switchers, Camera Converter and everything live!
  • Author
  • Message
Offline

barrybrown

  • Posts: 10
  • Joined: Tue Feb 04, 2020 5:26 pm
  • Real Name: Barry Brown

How to force upstream keyer on or off

PostFri Sep 24, 2021 9:29 pm

I want to create macros to set up "scenes" on my ATEM Mini. For example, I want to set up Camera 2 to have a title overlaid. This title only appears for Camera 2 and it's the only time the keyer is used in my setup.

However, the KEY button is a toggle. The macro has no way of knowing what the current state of the button is, which is essential for setting up and taking down the scene correctly. For example, if I accidentally trigger the macro twice in a row, it will leave Camera 2 up, but turn off the key.

Is there a way to change the behavior of the KEY button so it is absolute rather than a toggle? In other words, the KEY button controls whether the keyer (and therefore the ON AIR) button will be on or off at the next transition instead of toggling it to the other state.

* If I want the key to be on in the next transition, I turn on the KEY button and execute the transition (AUTO or CUT).
* If I want the key to be off in the next transition, I turn off the KEY button and execute the transition.
* If the key is currently on and I want to switch background sources without changing the key, I leave the KEY button on and execute the transition.

Barring a change in behavior, could the XML macro language be extended to include some new actions for the KEY button? There could be four: On, Off, On-If-OnAir, and Off-If-OffAir.
Offline

adamtow

  • Posts: 69
  • Joined: Tue Jun 23, 2020 3:20 am
  • Real Name: Adam Tow

Re: How to force upstream keyer on or off

PostSat Sep 25, 2021 12:50 am

ATEM macros don’t have any scripting ability, meaning you can’t do conditional logic. If you have an iPad, you could look at my app MixEffect. It exposes the state of the connected ATEM switcher to Shortcuts, allowing you to query the state of the USK Key value, On Air status, program source, etc. and perform an action based on those values.

Mind you, it’s not as fast as running a macro, but it works. Learn more at https://MixEffect.app

If you are on PC, there’s a PowerShell solution from Ian Morrish that might accomplish this as well: https://ianmorrish.wordpress.com/v-ise/atem/
MixEffect, control your ATEM Switchers from your iPhone or iPad
https://mixeffect.app
Offline

Raphaël Jacquot

  • Posts: 682
  • Joined: Wed Aug 29, 2012 4:15 pm

Re: How to force upstream keyer on or off

PostSat Sep 25, 2021 8:12 am

this is the command you want to force one of the key to onair or not. replace with 'True' or 'False'

Code: Select all
<Op id="KeyOnAir" mixEffectBlockIndex="0" keyIndex="0" onAir="False"/>
Offline

Jeff P

  • Posts: 7
  • Joined: Wed Sep 01, 2021 2:50 pm
  • Real Name: Jeff Pierce

Re: How to force upstream keyer on or off

PostSat Sep 25, 2021 1:00 pm

Have you tried the ATEM control software? It really unlocks the functionality of the switcher. There are a lot of features/functionality that are only available via the software interface.

It's a free download from BMD and runs on Mac or PC.

The only thing I use the console for is turning audio sources on/off. Everything else is done via the software.
Offline

Gary Adams

Blackmagic Design

  • Posts: 1182
  • Joined: Sat Aug 25, 2012 6:14 am

Re: How to force upstream keyer on or off

PostSat Sep 25, 2021 2:12 pm

Hello Barry. This can easily be done with or without writing XML files. When making a macro for a button that toggles the last action is recorded. For example if the Key is currently off air when making a macro simply place it on air. The macro will always assert on air. If the key is already on air when making a macro first turn it off then back on. The macro will record the last action ignoring the previous. Macros will not toggle these actions. I hope this helps.

Regards. Gary
Gary Adams
Blackmagic Design
Offline

barrybrown

  • Posts: 10
  • Joined: Tue Feb 04, 2020 5:26 pm
  • Real Name: Barry Brown

Re: How to force upstream keyer on or off

PostSun Sep 26, 2021 2:58 am

Thanks for your replies!

The problem is not with the KEY button toggling; it's with what the KEY button does: it toggles the ON AIR button.

Here's what I want to set up in macros. The Key should be ON for Camera 2 and OFF for all other cameras. I have no use case for the keyer being on for any of the other cameras, and it will never be off for camera 2.

Macro 1:
Camera 1 on
Key off

Macro 2:
Camera 2 on
Key on

Macro 3:
Camera 3 on
Key off

All of these macros will be followed by pressing the AUTO button to execute the transition. I don't want to cut the keyer off; I want it to fade off with the camera. So I can't just use the ON AIR button, which will execute a hard cut.

How will I program Macro 3? There is no way that I know of to turn off the key on the next transition regardless of whether the key is currently on or off. For example, if I am currently on Camera 2 (with key ON), I need Macro 3 to turn it off by setting the KEY button to ON. But if I am currently on Camera 1 with the key off, I need it to keep it off by setting the KEY button to OFF. Therefore, macro 3 will need to know whether the ON AIR button is on or off in order to set the KEY button to the correct state.

This is all caused by the KEY button being used to toggle the state of the ON AIR button. What I'm asking for is a way to change the behavior of the KEY button so it *sets* the state of the ON AIR button instead of toggling it.

It seems simple:
If the KEY button is OFF, then ON AIR will be OFF at the next transition.
If the KEY button is ON, then ON AIR will be ON at the next transition.

Is this something that can be made into a preference setting?
Offline

barrybrown

  • Posts: 10
  • Joined: Tue Feb 04, 2020 5:26 pm
  • Real Name: Barry Brown

Re: How to force upstream keyer on or off

PostSun Sep 26, 2021 3:30 am

I have another idea. An alternative to changing the behavior of the KEY button would be add a couple of conditional attributes to the existing XML schema. Let's call them "advanced" since the only way to access them would be to edit the XML macros by hand. This would allow existing macros to work as-is, but would permit someone with some XML know-how to use the new feature.

Here's what the macro for Camera 2 looks like, as recorded by the ATEM Software Control:

Code: Select all
<Macro index="0" name="Scene 2" description="">
    <Op id="PreviewInput" mixEffectBlockIndex="0" input="Camera2"/>
    <Op id="TransitionSource" mixEffectBlockIndex="0" source="Background, Key1"/>
</Macro>


Here's what it could look like after editing to insert some conditions.

Code: Select all
<Macro index="0" name="Scene 2" description="">
    <Op id="PreviewInput" mixEffectBlockIndex="0" input="Camera2"/>
    <Op ifTrue="Key1OnAir" id="TransitionSource" mixEffectBlockIndex="0" source="Background"/>
    <Op ifFalse="Key1OnAir" id="TransitionSource" mixEffectBlockIndex="0" source="Background, Key1"/>
</Macro>


In the new macro, the transition source will be set to "Background" if the ON AIR button is lit. But if the button is not lit, the source will be "Background, Key1". This will allow the macro to set the ON AIR button appropriately.
Offline

Jeff P

  • Posts: 7
  • Joined: Wed Sep 01, 2021 2:50 pm
  • Real Name: Jeff Pierce

Re: How to force upstream keyer on or off

PostTue Sep 28, 2021 6:22 pm

barrybrown wrote:I have another idea. An alternative to changing the behavior of the KEY button would be add a couple of conditional attributes to the existing XML schema. Let's call them "advanced" since the only way to access them would be to edit the XML macros by hand. This would allow existing macros to work as-is, but would permit someone with some XML know-how to use the new feature.

Here's what the macro for Camera 2 looks like, as recorded by the ATEM Software Control:

Code: Select all
<Macro index="0" name="Scene 2" description="">
    <Op id="PreviewInput" mixEffectBlockIndex="0" input="Camera2"/>
    <Op id="TransitionSource" mixEffectBlockIndex="0" source="Background, Key1"/>
</Macro>


Here's what it could look like after editing to insert some conditions.

Code: Select all
<Macro index="0" name="Scene 2" description="">

    <Op id="PreviewInput" mixEffectBlockIndex="0" input="Camera2"/>
    <Op ifTrue="Key1OnAir" id="TransitionSource" mixEffectBlockIndex="0" source="Background"/>
    <Op ifFalse="Key1OnAir" id="TransitionSource" mixEffectBlockIndex="0" source="Background, Key1"/>
</Macro>


In the new macro, the transition source will be set to "Background" if the ON AIR button is lit. But if the button is not lit, the source will be "Background, Key1". This will allow the macro to set the ON AIR button appropriately.


You're making this a lot harder on yourself by insisting on doing it through the hardware interface. In the control software, you simply select the BGD and Key-1 buttons, then click the transition you desire (cut, dissolve, wipe, DVE) and both sources are brought in and out simultaneously via that transition.
This is how professional broadcast switchers have always worked, and BMD had given us a professional broadcast switcher via the control software.
Offline

achugh

  • Posts: 3
  • Joined: Wed Mar 24, 2021 1:35 am
  • Real Name: Amit Chugh

Re: How to force upstream keyer on or off

PostThu Sep 30, 2021 12:42 pm

Barry,

Instead of thinking about finding out the current state, think about the desired end state. I am also very new but after trolling the net I found that the following approach works as long as you can accept the limitations or assumptions listed below:

ASSUMPTIONS
  • You have to remember what each of the MACRO button on your switcher is going to do i.e. it is fixed to get you to a desired state without relying upon knowing the current state.
  • If you do not learn the order in which you have to execute your MACROS your desired end state will not be achieved
  • Trying to perform any effects which require knowing the current state cannot be achieved without additional software and hardware

I use Canon 5D Mk III as my main video camera which is connected to Input 1 on the ATEM Mini Extreme switcher. It has a known issue due to international regulations to turn itself off after 29 mins and 59 seconds. When it turns itself off, I have a macro that will show a static picture from my media pool. This macro is assigned to Macro 1 button on the switcher. Then I have to turn my camera Off and then ON again physically. Once the camera feed is on, I press my Macro 2 button to bring my video UP followed by automatically adding in the lower third overlay which is another static image from the media pool. When this overlay is shown, a fade transition is also set so that it comes in nicely. For this simply setup I DO NOT set things to preview and then press the AUTO button because once I have learned my Macro sequence order, the AUTO is also written in my Macro. Here is my Macro that may help you do what you are trying to achieve and not even rely upon the pressing of AUTO button as well.

Also note that I have some green screen setup for my main camera 1 on input 1. I am also making sure my green screen is setup correctly and I pick the correct background static image from a different media pool. In other words I am using both my media pools. One pool has the background image and the second pool has my lower third overlay.

Code: Select all
        <Macro index="0" name="5D-OFF" description="When 5D goes off, switch to Still # 2 in MediaPlayer 2">
            <Op id="ProgramInput" mixEffectBlockIndex="0" input="Black"/>
            <Op id="DownstreamKeyAuto" keyIndex="0"/>
            <Op id="MediaPlayerSourceStillIndex" mediaPlayer="1" index="1"/>
            <Op id="MediaPlayerSourceStill" mediaPlayer="1"/>
            <Op id="KeyOnAir" mixEffectBlockIndex="0" keyIndex="0" onAir="False"/>
            <Op id="TransitionSource" mixEffectBlockIndex="0" source="Background"/>
            <Op id="PreviewInput" mixEffectBlockIndex="0" input="MediaPlayer2"/>
            <Op id="AutoTransition" mixEffectBlockIndex="0"/>
        </Macro>
        <Macro index="1" name="5D-ON" description="Switch to 5D after it has been turned on again">
            <Op id="TransitionSource" mixEffectBlockIndex="0" source="Background, Key1"/>
            <Op id="MediaPlayerSourceStillIndex" mediaPlayer="0" index="2"/>
            <Op id="MediaPlayerSourceStill" mediaPlayer="0"/>
            <Op id="PreviewInput" mixEffectBlockIndex="0" input="MediaPlayer1"/>
            <Op id="KeyType" mixEffectBlockIndex="0" keyIndex="0" type="Chroma"/>
            <Op id="KeyFillInput" mixEffectBlockIndex="0" keyIndex="0" input="Camera1"/>
            <Op id="AdvancedChromaKeyForegroundLevel" mixEffectBlockIndex="0" keyIndex="0" foregroundLevel="0.04"/>
            <Op id="AdvancedChromaKeyBackgroundLevel" mixEffectBlockIndex="0" keyIndex="0" backgroundLevel="1"/>
            <Op id="AdvancedChromaKeyKeyEdge" mixEffectBlockIndex="0" keyIndex="0" keyEdge="0.8"/>
            <Op id="AdvancedChromaKeySpillSuppress" mixEffectBlockIndex="0" keyIndex="0" spillSuppress="0"/>
            <Op id="AdvancedChromaKeyFlareSuppress" mixEffectBlockIndex="0" keyIndex="0" flareSuppress="0"/>
            <Op id="AdvancedChromaKeyForegroundBrightness" mixEffectBlockIndex="0" keyIndex="0" foregroundBrightness="0"/>
            <Op id="AdvancedChromaKeyForegroundContrast" mixEffectBlockIndex="0" keyIndex="0" foregroundContrast="0"/>
            <Op id="AdvancedChromaKeyForegroundColour" mixEffectBlockIndex="0" keyIndex="0" foregroundColour="1"/>
            <Op id="AdvancedChromaKeyForegroundRed" mixEffectBlockIndex="0" keyIndex="0" foregroundRed="0"/>
            <Op id="AdvancedChromaKeyForegroundGreen" mixEffectBlockIndex="0" keyIndex="0" foregroundGreen="0"/>
            <Op id="AdvancedChromaKeyForegroundBlue" mixEffectBlockIndex="0" keyIndex="0" foregroundBlue="0"/>
            <Op id="KeyMaskEnable" mixEffectBlockIndex="0" keyIndex="0" enable="False"/>
            <Op id="KeyFlyEnable" mixEffectBlockIndex="0" keyIndex="0" enable="False"/>
            <Op id="AdvancedChromaKeyCursorSize" mixEffectBlockIndex="0" keyIndex="0" size="0.5"/>
            <Op id="AdvancedChromaKeyCursorXPosition" mixEffectBlockIndex="0" keyIndex="0" xPosition="9"/>
            <Op id="AdvancedChromaKeyCursorYPosition" mixEffectBlockIndex="0" keyIndex="0" yPosition="3"/>
            <Op id="AdvancedChromaKeyPreviewEnabled" mixEffectBlockIndex="0" keyIndex="0" enabled="False"/>
            <Op id="AdvancedChromaKeySamplingModeEnabled" mixEffectBlockIndex="0" keyIndex="0" enabled="False"/>
            <Op id="AutoTransition" mixEffectBlockIndex="0"/>
            <Op id="MacroSleep" frames="45"/>
            <Op id="MediaPlayerSourceStillIndex" mediaPlayer="1" index="2"/>
            <Op id="MediaPlayerSourceStill" mediaPlayer="1"/>
            <Op id="ProgramInput" mixEffectBlockIndex="0" input="MediaPlayer2"/>
            <Op id="MediaPlayerSourceStillIndex" mediaPlayer="0" index="0"/>
            <Op id="MediaPlayerSourceStill" mediaPlayer="0"/>
            <Op id="DownstreamKeyAuto" keyIndex="0"/>
        </Macro>


I hope this helps you think creatively / differently to solve your specific problem. It took me sometime to not think terms of IF..THIS..THEN..THAT style of solving the problem because the hardware and software combination currently does not support it without getting into external software and hardware which I am at the moment not interested in investing.

-Amit

Return to Live Production

Who is online

Users browsing this forum: No registered users and 24 guests