Page 1
Matrox Monarch HD Dev Tools Reference Guide May 16, 2017 Y11308-301-0219...
Page 2
Unauthorized recording or use of broadcast television programming, video tape, or other copyrighted material may violate copyright laws. Matrox Electronic Systems Ltd. assumes no responsibility for the illegal duplication, use, or other acts that infringe on the rights of copyright owners.
Contents Chapter 1 Using the Monarch HD Control API Monarch HD Control API Overview ............2 Commands ....................2 GetStatus ......................3 StartStreaming....................3 StartRecording ....................4 StartStreamingAndRecording ................4 StopStreaming ....................4 StopRecording....................5 StopStreamingAndRecording ................5 GetInputStatus....................5 SetStreamingVideoDataRate ................
Page 4
Change bit rate while streaming..............24 Chapter 3 Using the Monarch HD Command Line Utility Updating or rebooting the Monarch HD using the command line ...26 Update/reboot command line syntax examples ..........27 Update on a different subnet ....................27 Reboot on the same subnet ....................27...
Using the Monarch HD Control API This chapter describes how to use the Monarch HD HTTP-based Control API to control the streaming and recording functions for a Monarch device.
Monarch HD Control API Overview The Monarch HD Control API is an HTTP-based API that allows you to control the streaming, recording, and other related functions for a Monarch HD device using third-party applications and scripting languages. Users and system integrators can create their own software to control the various functions of a Monarch device, such as starting or stopping streaming/recording, getting the device status, and more.
RTMP - Streaming Example 5 RECORD: DISABLED, STREAM:RTMP,ON, NAME:DEVICE5 StartStreaming This command is used to start the stream function on a Monarch HD device that is set to RTMP mode. Returns: • SUCCESS, if streaming is enabled on the device (Stream-only or Stream-and-record mode) and the stream was started successfully.
Monarch is executing a command while receiving another. The first command received will execute, and the others will return RETRY. StopStreaming This command is used to stop the stream function on a Monarch HD device that is set to RTMP mode. Returns: •...
Monarch is executing a command while receiving another. The first command received will execute, and the others will return RETRY. StopRecording This command is used to stop the record function on a Monarch HD device. Returns: • SUCCESS, if recording is enabled on the device (Record-only or Stream-and-record mode) and the recording was stopped successfully.
RTSP on the device. This command will always fail unless the Monarch is idle (not streaming or recording). Format: • SetRTSP,<url name>,<port>. • <url name> is the path to connect to and <port> is either 554 or 8554. Returns: Chapter 1, Using the Monarch HD Control API...
• SUCCESS, if the settings were applied. • FAILED, if the device is currently streaming or recording, or the port is not 554 or 8554. The call will also fail if the URL contains invalid characters. Alphanumeric characters are accepted, as well as the following characters in brackets (.
RETRY. Example third-party tools Different tools can be used to send commands to Monarch HD. Matrox has tested the following applications and scripting languages for use with Monarch HD: Chapter 1, Using the Monarch HD Control API...
¦ Note In order for third-party applications to send commands to Monarch HD successfully, they must support username and password authentication. The following are examples of how to use the Monarch HD API command line in third-party applications. GNU Wget wget --user=<username>...
Page 14
Your notes Chapter 1, Using the Monarch HD Control API...
Configuring the Monarch HD XML File This chapter describes how to properly configure an XML file for use with the automatic configuration feature of the Monarch HD device.
• From the Monarch HD Command Center, you can import the settings by loading a previously-generated XML configuration file. • You can host the XML parameters on a web page, and then have the Monarch HD download the settings from the web page URL. You can specify the URL through the Command Center, or in a parameter in the XML file.
Monarch HD Command Center user interface, and they are subject to the same conditions and limitations. • Parameters can be listed in the XML file in any order. For example, you can have the height tag listed before the width if you choose.
Example: <deviceName>MonarchHD</deviceName> <monarchSettingsVersion> This is the version of the XML configuration file (currently at 1.0.0). This version number tag is not related to the version of the Monarch HD firmware. Example: <monarchSettingsVersion>1.0.0</monarchSettingsVersion> Sample XML and parameter descriptions...
Value can be “true” or “false”. When true, the values in the width and height are ignored and the encoding resolution will match the input resolution. This tag reflects the option “Use input for recording” in the Monarch HD Command Center.
Page 21
• <width> Width of the encoding resolution. Must be between 128 and 1920, and be a multiple of 16. If the connected input resolution width is smaller than this value, the input resolution is used and supersedes this width. • <height> Height of the encoding resolution.
30 minutes. The maximum duration you can set is 290 minutes. If you enter a duration of 0, Monarch HD will automatically switch to a new file every 290 minutes, as a built-in precaution to avoid possible data loss from having files that are too large.
Page 23
• <audioEnabled> Specifies whether or not to stream audio. Values can be “true” or “false”. • <jumboFramesEnabled> Specifies whether or not to broadcast data in bigger network packets. Values can be “true” or “false”. The network card on the computer receiving the data must support this option.
XML from the Automatic Configuration page. For more information, see the Matrox Monarch HD User Guide. <facebookAccessToken> This is an encrypted code automatically generated in the Monarch Command Center. This token gets the required RTMP parameters related to your Facebook Live streaming setup.
The URL value must start with the common web-based prefix “http://”. You can disable this feature by leaving the tag blank. After the Monarch validates the XML file from the webpage, it will send an error to the same URL server, but with the device serial number, error and the status. If the error is 0, than the XML is considered validated.
This is an example of what the XML would look like for streaming to a CDN using RTMP only. <?xml version="1.0" encoding="UTF-8" standalone="true"?> <MatroxMonarch> <monarchSettingsVersion>1.0.0</monarchSettingsVersion> <encoder2> <streamParam> <audioEnabled>true</audioEnabled> <rtspStreamName> </rtspStreamName> <rtspPort></rtspPort> <jumboFramesEnabled>false</jumboFramesEnabled> <rtmpDestinationURL>rtmp://monarchStream/live</rtmpDestina- tionURL> <rtmpStreamName>livestream</rtmpStreamName> <rtmpUsername> </rtmpUsername> <rtmpPassword> </rtmpPassword> Chapter 2, Configuring the Monarch HD XML File...
<streamType>RTMP</streamType> </streamParam> </encoder2> </MatroxMonarch> You don’t need the <encoder1> tag or the <encoderParam> tags inside the <encoder2>, but you need all the tags inside <streamParam></streamParam>. Changing encoding parameters for recording This is an example of what the XML would look like if you wanted to change the encoding parameters for a recording session.
This is an example of what the XML would look like if you wanted to change the average video bit rate to 8.5 Mbits/s while the Monarch is streaming. <MatroxMonarch> <dynamicBitrateInKbps> <encoder2> <bitrate>8500</bitrate> </encoder2> </ dynamicBitrateInKbps > </MatroxMonarch> Chapter 2, Configuring the Monarch HD XML File...
Page 29
Using the Monarch HD Command Line Utility This chapter describes how to use the Windows command line to remotely reboot or update Monarch HD devices.
By using the Windows command line utility, you can remotely reboot or update one or more Monarch HD devices on the same subnet, or on a different subnet if you know the Monarch’s IP address(es). You can choose to manually execute the...
To reboot four Monarch devices on the same subnet, you can use the serial numbers or IP addresses. With serial numbers: MonarchHDUtils.exe Reboot Serial 123456 654321 654789 987456 With IP addresses: MonarchHDUtils.exe Reboot IP 192.168.12.34 192.168.56.78 192.168.9.10 192.168.10.11 Updating or rebooting the Monarch HD using the command line...
Page 32
Your notes Chapter 3, Using the Monarch HD Command Line Utility...