Streamline Your Production with mimoLive’s Automation Layer
mimoLive’s Automation layer was originally developed as a proof of concept, but has since proven to be an incredibly useful tool for users. This layer can be used to automate the switching on and off of layers in a specific sequence, or at predetermined times.
This can be especially helpful for creating complex productions with multiple layers and inputs, as it eliminates the need for manual switching and timing. With the Automation layer, users can focus on creating engaging content and let the software handle the timing and sequencing of their production.
Example: Automation Layer
Warning: Automation Scripts in mimoLive Do Not Run in Real Time
Please note that the timing of automation scripts in mimoLive may not be accurate due to the asynchronous nature of HTTP requests called by the video rendering engine. These scripts rely on HTTP requests to the API and the length of these requests cannot be accurately determined, resulting in potential timing discrepancies. Please keep this in mind when using automation scripts in your production workflow.
In order to make this layer work you need to switch on the HTTP Server in mimoLive to enable the Remote Control API. Go to mimoLive -> Preferences -> Remote Controls: Check the “Allow Remote Control Access” option. (Currently it only works without a password)
Set up the Automation Layer
There are two options on how the layer should behave after switched live:
|Switch layer off automatically||For this option there is only one script available. Once this script has been processed the layer will switch itself of. This option can be used of a sequence should be performed once.|
|Switch layer off manually (e.g. by operator)||In this case there are three scripts available. When the layer is switch live the “On Live” script will be processed. Once this is done the “While Live” script gets processed in an endless loop. Once the layer gets switched off the “Turned Off” script gets processed.|
If you don’t have a need for a certain phase you can leave the associated script empty.
Source Code Comments
To help you remember the function of your script we recommend to make use of comments in your script:
// Now sleep for 5 seconds sleep(5) // Start the stopwatch layer: layerOn(7C4665C4-0E17-4F63-BCFF-B59D68D75956)
!Comments needs to be in a separate line and the // needs to be at the beginning of that line.
The scripting language is proprietary and has only a view commands.
layerOn(API Layer ID)
This command lets you switch a layer or a layer variant on.
// switching on a layer by its id layerOn(234674-se5634-2w435456) // switching on a layer variant by its id layerOn(4E38A868-DCB5-4E9C-AC75-231764229BFA/variants/5F18C566-F59F-45B4-8D40-27EF289D47B1) // switching on a layer by its long API Endpoint URL layerOn(/api/v1/documents/863743527/layers/68F63C8F-2376-4CA3-9764-CC17CBFC5F8D) // switching on a layer with a defined variable setVariable($myLayerID, "234674-se5634-2w435456") layerOn($myLayerID)
layerOff(API Layer ID)
This command lets you switch a layer or a layer variant off. This command lets you switch a layer or a layer variant off.
// switching off a layer by its id layerOff(234674-se5634-2w435456) // switching off a layer variant by its id layerOff(4E38A868-DCB5-4E9C-AC75-231764229BFA/variants/5F18C566-F59F-45B4-8D40-27EF289D47B1) // switching off a layer by its long API Endpoint URL layerOff(/api/v1/documents/863743527/layers/68F63C8F-2376-4CA3-9764-CC17CBFC5F8D) // switching off a layer with a defined variable setVariable($myLayerID, "234674-se5634-2w435456") layerOff($myLayerID)
layerSetRecall(API Layer Set ID)
This command can be used to trigger the recall for a certain Layer Sets.
// recall a Layer Set by its id layerSetRecall(E6950B7A-7457-44C5-81F7-972D9B04DBC3) // recall a Layer Set by its long API Endpoint URL layerSetRecall(/api/v1/documents/863743527/layer-sets/E6950B7A-7457-44C5-81F7-972D9B04DBC3) // recall a Layer Set with a defined variable setVariable($myLayerSetID, "E6950B7A-7457-44C5-81F7-972D9B04DBC3") layerSetRecall($myLayerSetID)
outputOn(API Output Destination ID)
Use this command to turn on an output destination.
outputOff(API Output Destination ID)
Use this command to turn off an output destination.
The sleep() command will pause the computation of the script for the given seconds.
// pause the script computation for 12 seconds sleep(12) // pause the script computation for 35.6 seconds sleep(35.6) // pause the script computation for a time interval specified by a variable setVariable($mySleepInterval, 17) sleep($mySleepInterval)
The sleepUntil() command will let the script pause until the specified time is reached. if the time has already passed the script will wait until the next day.
// sleep until 5:15pm sleepUntil(17:15:00) // sleep until 9:12am sleepUntil(9:12) // sleep until a time specified by a variable setVariable($myWakeUpTime, "9:41") sleepUntil($myWakeUpTime)
This script command will pause the script until the next “on the minute” friction of an hour will be reached.
// go on every 20 minutes: on the hour, 20 and 40 minutes past the hour: sleepOnTheMinute(20) // go on "on the hour" sleepOnTheMinute(60) // go on every 10 minutes past the hour (specified by a variable) setVariable($myWakeUpMinute, "10") sleepOnTheMinute($myWakeUpMinute)
To define a local variable use the setVariable command. You need to specify a variable name (with a $ postfix) and the value this variable should have. The value can be a number, a text (in quotation marks) or the boolean values “true” and “false”. You can use the variable in every field of the other commands.
setVariable($myText, "This is a text") setVariable($myNumber, 15.73) setVariable($myBoolValue, false)
A global variable can be used in the current layer, or in all Automation layers above this layer. This is very useful if you want to have the same information in all Automation layers (e.g. the API ID of a certain layer). For the value of the variable the same applies as in the setVariable command described.
Please note the a global variables are valid to other Automation layers as long as the layer is live itself. This way you can switch global variables by switching to a different layer with different global variable definitions.
setGlobal($myGlobalText, "This is a text") setGlobal($myGlobalNumber, 15.73) setGlobal($myGlobalBoolValue, false)
ifLayerIsOn() – ifLayerIsOff() [else] endif
Those if statements are testing if a certain layer is currently live or not. if so the following commands are processed. Otherwise the following commands are skipped until an else or endif is found.
setVariable($myLayerA, "D6A326CA-72E6-45E5-836D-9795F8F534F4") setVariable($myLayerB, "8C58DEA7-CCBE-44CB-A60F-97C5BD456C68") ifLayerIsOn($myLayerA) // the layer is live, switch it off layerOff($myLayerA) else // the layer is currently off, switch it on layerOn($myLayerA) endif ifLayerIsOff($myLayerB) // the layer is currently off, switch it on layerOn($myLayerB) endif
ifLayerSetIsActive() – ifLayerSetIsInactive() [else] endif
Those if statements are testing if a certain Layer Set is currently live or not. if so the following commands are processed. Otherwise the following commands are skipped until an else or endif is found.
setVariable($myLayerSetA, "CEF07AFA-B552-40F8-821C-CF424EB93500") setVariable($myLayerSetB, "E4B15B8B-EE34-4CCE-BDE7-58120A65E83A") setVariable($myLayer, "8C58DEA7-CCBE-44CB-A60F-97C5BD456C68") ifLayerSetIsActive($myLayerSetA) // the layer set A is active, switch layer on layerOn($myLayer) else // the layer set A is currently inactive, switch the layer off layerOff($myLayer) endif ifLayerSetIsInactive($myLayerSetB) // the layer set B is currently inactive, switch the layer off layerOn($myLayer) endif
ifLayerData(, , , )
This complex command lets you test on layer any parameter that the HTTP API provides. You need to specify a layer by its API ID, the key path within the JSON data the HTTP API returns, a comparator (in quotation marks as string!) (e.g. “==”) and a value.
Valid comparator values are:
|“>=”||greater or equal than|
|“<=”||less or qual than|
// Example: Testing if the audio volume is turned up on a layer setVariable($myLayerA, "D6A326CA-72E6-45E5-836D-9795F8F534F4") setVariable($myLayerB, "8C58DEA7-CCBE-44CB-A60F-97C5BD456C68") ifLayerData($myLayerA,"data.attributes.volume",">",0.5) // The audio volume is bigger than 0.5 so turn layer B on layerOn($myLayerB) else // The volume is lower than 0.5, lets turn layer B off layerOff($myLayerB) endif
loop() [break] endloop
The loop command lets you execute a certain code multiple times. If you do not specify the iterations then the loop will run endlessly. The break command let you jump out of the loop anytime. endloop is needed at the end of the command block that should be looped.
setVariable($myLayerA, "D6A326CA-72E6-45E5-836D-9795F8F534F4") // blink layer A 4 times loop(4) layerOn(setVariable(myLayerA) sleep(1) layerOff(setVariable(myLayerA) sleep(1) endloop // wait for volume of layer A will be bigger than 0.5 loop ifLayerData($myLayerA,"data.attributes.volume",">",0.5) // The audio volume is bigger than 0.5 exit the loop now break endif sleep(1) endloop
The httpRequest() gives you lot of flexibility on what to trigger with this script. Even in other documents or remote scripts. Please read the HTTP API documentation for all API calls possible.
The parameter should be an API Endpoint for a Layer, a Layer Variant or a Layer Set you can optain those API Endpoints by right clicking on the object in the mimoLive document. A context menu should appear with a “Copy API Endpoint” menu item.
This will copy the API Endpoint for this object to the past board. If you paste it somewhere it will look something like this:
/api/v1/documents/863743527/layers/D6A326CA-72E6-45E5-836D-9795F8F534F4 /api/v1/documents/863743527/layers/68F63C8F-2376-4CA3-9764-CC17CBFC5F8D/variants/3FF72CC3-AF80-4252-A879-F8AFD68DB922 /api/v1/documents/863743527/layer-sets/E6950B7A-7457-44C5-81F7-972D9B04DBC3
You may reduce the API Endpoints to the last part only. This will make your script shorter as shown here:
// switching on a layer: layerOn(/api/v1/documents/863743527/layers/D6A326CA-72E6-45E5-836D-9795F8F534F4) // OR layerOn(D6A326CA-72E6-45E5-836D-9795F8F534F4) // switching on a variant: layerOn(/api/v1/documents/863743527/layers/68F63C8F-2376-4CA3-9764-CC17CBFC5F8D/variants/3FF72CC3-AF80-4252-A879-F8AFD68DB922) // OR layerOn(68F63C8F-2376-4CA3-9764-CC17CBFC5F8D/variants/3FF72CC3-AF80-4252-A879-F8AFD68DB922)
This parameter represents a time in 24 hours representation. Hours, minutes and seconds delimited by “:”.
Run an ad every 10 minutes
In combination with a “PIP Window” layer an a “Media Playlist source” containing multiple short advertising movie clips you can playback one advertising every 10 minutes. Make sure to uncheck the “Non-Stop” option in the Media Playlist source. This way each time the PIP Window gets set to live it will playback one ad from the Playlist source and switches itself off. After 10 minutes the next ad will be played back.
Run a stinger before you switch to a certain layer
You need to prepare a short stinger video that will have an In-transition until it covers all the screen (e.g. after 1 sec). After 1 second you switch live that layer you want to reveal. Place this layer below the layer playing back the stinger video. Now that the stinger video is covering the screen the switching of the layer below can’t be seen. The stinger video should go on with revealing the layer below. Please make sure that the stinger video is rendered in ProRes4444 video codec so that it carries the transparency necessary for the transition with it.
Create a complex show opener
Because you can switch on and off layers one after another over a longer period of time you can have multiple Text or Annotation layers, Placer layer showing graphics or even lower thirds that fills the screen to make you own animated show opener. Get creative!
Trigger a remote HTTP URL by a tap on the Remote Control Surface
If you need to trigger an HTTP Request by a button on your Remote Control Surface you can add an Automation layer to you layer stack and set the “Switch Layer Off” option of that layer to “Automatically”. Now you can put in a single httpRequest() command in the “On Live” script field. On your Remote Control Surface add the Live button of this layer to the layout. Once you press this button on your Remote Control Surface the HTTP request will be performed.