{"id":8783,"date":"2021-05-13T17:39:25","date_gmt":"2021-05-13T09:39:25","guid":{"rendered":"https:\/\/www.kiloview.com\/en\/support\/docs\/ndi-device-http-apiversion-1-0\/ndi-decoding-preset\/"},"modified":"2021-05-13T17:39:25","modified_gmt":"2021-05-13T09:39:25","slug":"ndi-decoding-preset","status":"publish","type":"docs","link":"https:\/\/www.kiloview.com\/en\/docs\/ndi-device-http-apiversion-1-0\/ndi-decoding-preset\/","title":{"rendered":"NDI decoding Preset"},"content":{"rendered":"<p>Our NDI decoder has a very practical function: <strong>Preset<\/strong>. Preset means you can add the discovered NDI Source to 9 presets represented by 1~9, which is your &quot;Favorites&quot;. When you need to quickly select the NDI Source added in Preset for decoding, you only need to specify the Preset ID (1~9).<\/p>\n<p>Preset can bring some additional functional advantages to our NDI decoding devices. For example, we will support an external physical keyboard in the future. Press the 1~9 on the keyboard to complete the rapid switch.<\/p>\n<p>There is also a special <strong>preset-0<\/strong> on the NDI decoder. The meaning of this preset is Blank, used to fill the screen with a customizable color.<\/p>\n<p><strong>Module name:<\/strong> decoder\/preset<\/p>\n<p><strong>Basic URL:<\/strong> \/api\/v1\/decoder\/preset\/<\/p>\n<h2>Get current preset list and status<\/h2>\n<hr \/>\n<h4>API URL<\/h4>\n<p>\u200b   <strong>\/api\/v1\/decoder\/preset\/status<\/strong><\/p>\n<h4>Request<\/h4>\n<p>\u200b   Method: <strong>GET\/POST<\/strong><\/p>\n<p>\u200b   Parameters: NONE<\/p>\n<h4>Response<\/h4>\n<p>Example:<\/p>\n<pre><code class=\"language-json\">{\n    &quot;result&quot;: &quot;ok&quot;,\n    &quot;data&quot;: [\n        {\n            &quot;id&quot;: &quot;1&quot;,\n            &quot;enable&quot;: 1, \/*or 0*\/\n            &quot;group&quot;: &quot;public&quot;,\n            &quot;name&quot;: &quot;Spark_IO-1916001002 (Channel 1)&quot;,\n            &quot;device_name&quot;: &quot;Spark_IO-1916001002&quot;,\n            &quot;channel_name&quot;: &quot;Channel 1&quot;,\n            &quot;url&quot;: &quot;192.168.100.168:5961&quot;,\n            &quot;ip&quot;: &quot;192.168.100.168&quot;,\n            &quot;online&quot;: &quot;on&quot;, \/*or &quot;off&quot;*\/\n            &quot;current&quot;: true \/*or false*\/\n        },\n        \/*...*\/\n        {\n            &quot;id&quot;: &quot;0&quot;,\n            &quot;current&quot;: true, \/*or false*\/\n            &quot;color&quot;: &quot;#000000&quot;\n        }\n    ],\n\n    &quot;data_size&quot;: 10\n}<\/code><\/pre>\n<p><strong>Data field description: <\/strong><\/p>\n<p>&quot;data&quot; is a JSON array, &quot;data_size&quot; is a field that help assist to describe &quot;data&quot; array size (you may not use it) . <\/p>\n<p>Each item of the array means one NDI Source discovered in network:<\/p>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>id<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>1~9  represents normal NDI Source Preset\uff1b0 is Blank<\/td>\n<\/tr>\n<tr>\n<td>enable<\/td>\n<td><strong>[INT]<\/strong><\/td>\n<td>1: This Preset is enabled<br \/>0: This Preset doesn&#8217;t enable NDI Source; in this case, all subsequent fields are meaningless.<\/td>\n<\/tr>\n<tr>\n<td>group<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>Preset saved group name of NDI Source<\/td>\n<\/tr>\n<tr>\n<td>name<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>Preset saved name of NDI Source<\/td>\n<\/tr>\n<tr>\n<td>device_name<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>Device Name of NDI Source extracted from the <code>name<\/code> field<\/td>\n<\/tr>\n<tr>\n<td>channel_name<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>Channel Name of NDI Source extracted from the <code>name<\/code> field<\/td>\n<\/tr>\n<tr>\n<td>url<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>Original URL of NDI Source<\/td>\n<\/tr>\n<tr>\n<td>ip<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>IP address of NDI Source extracted from <code>url<\/code> field<\/td>\n<\/tr>\n<tr>\n<td>online<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>According to NDI discovery results, it detects the online status of NDI Source defined by this preset:<br \/><strong>on:<\/strong> current NDI Source online ( It can be discovered) <br \/><strong>off:<\/strong>  current NDI Source not online ( It can&#8217;t be discovered) <\/p>\n<p><strong>Note:<\/strong> online status is decided by NDI discovery results. It doesn&#8217;t mean whether NDI source can be connected and obtain video data. Therefore, it only provides reference significance and cannot be used as a basis for the device to determine online.<\/td>\n<\/tr>\n<tr>\n<td>current<\/td>\n<td><strong>[BOOLEAN]<\/strong><\/td>\n<td><strong>true:<\/strong> The preset is NDI Source of the current decoding<br \/><strong>false:<\/strong> The preset is not NDI Source of the current decoding<\/td>\n<\/tr>\n<tr>\n<td>color<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td><strong>Only valid for id = &quot;0&quot; <\/strong><br \/>For Preset 0 (Blank)\uff0cit doesn&#8217;t include the following fields <code>enable<\/code>, <code>group<\/code>, <code>name<\/code>, <code>device_name<\/code>, <code>channel_name<\/code>, <code>url<\/code>, <code>ip<\/code>, <code>online<\/code>, while return color represents Blank fill color. For detailed formats please refer to 6.4 <code>\/api\/v1\/decoder\/preset\/set_blank<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Add NDI Source to a specified preset<\/h2>\n<hr \/>\n<h4>API URL<\/h4>\n<p>\u200b   <strong>\/api\/v1\/decoder\/preset\/add<\/strong><\/p>\n<h4>Request<\/h4>\n<p>\u200b   Method: <strong>GET\/POST<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>id<\/td>\n<td><strong>[STRING]<\/strong>, <strong>Required<\/strong><\/td>\n<td>Specify preset ID\uff0cvalid range is 1~9<\/td>\n<\/tr>\n<tr>\n<td>name<\/td>\n<td><strong>[STRING]<\/strong>, <strong>Required<\/strong><\/td>\n<td>NDI source name\uff0cyou can get discovery NDI sources list by API <code>\/api\/v1\/decoder\/discovery\/get<\/code> and extract name field from them.<\/td>\n<\/tr>\n<tr>\n<td>url<\/td>\n<td><strong>[STRING]<\/strong>, <strong>Required<\/strong><\/td>\n<td>Original URL of NDI source\uff0cyou can get discovery NDI sources list by API <code>\/api\/v1\/decoder\/discovery\/get<\/code> and extract url field from them.<\/td>\n<\/tr>\n<tr>\n<td>group<\/td>\n<td><strong>[STRING]<\/strong>, <strong>Optional<\/strong><\/td>\n<td>NDI group name of NDI source. The parameter is optional, If you can get by API <code>\/api\/v1\/decoder\/discovery\/get<\/code> and extract group field, it is best to pass in as a parameter.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>N<\/strong>ote: If the preset ID you specified originally has an NDI source definition, the newly added NDI source will overwrite the old definition.<\/p>\n<h4>Response<\/h4>\n<p>Example:<\/p>\n<pre><code class=\"language-json\">{\n    &quot;result&quot;: &quot;ok&quot;\n}<\/code><\/pre>\n<p>If add successfully, it will return the message of result = &quot;ok&quot;.  Otherwise, please refer to 1.3 for error message descriptions. <\/p>\n<h2>Remove NDI source definition of preset<\/h2>\n<hr \/>\n<h4>API URL<\/h4>\n<p>\u200b   <strong>\/api\/v1\/decoder\/preset\/remove<\/strong><\/p>\n<h4>Request<\/h4>\n<p>\u200b   Method: <strong>GET\/POST<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>id<\/td>\n<td><strong>[STRING]<\/strong>, <strong>Required<\/strong><\/td>\n<td>Specify the preset ID for removing\uff0cvalid range 1~9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<p>Example:<\/p>\n<pre><code class=\"language-json\">{\n    &quot;result&quot;: &quot;ok&quot;\n}<\/code><\/pre>\n<p>If remove successfully, it will return the message of result = &quot;ok&quot;, or please refer to 1.3 for error message descriptions. <\/p>\n<h2>Define preset 0 (Blank) color<\/h2>\n<hr \/>\n<h4>API URL<\/h4>\n<p>\u200b   <strong>\/api\/v1\/decoder\/preset\/set_blank<\/strong><\/p>\n<h4>Request<\/h4>\n<p>\u200b   Method: <strong>GET\/POST<\/strong><\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>color<\/td>\n<td><strong>[STRING]<\/strong>, <strong>Required<\/strong><\/td>\n<td>Specify the color of preset 0 (Blank). The description format of colors is consistent with the description of colors in HTML, namely: <br \/>1. Use RGBA color<br \/>2. Start with #, hex to describe R, G, B and A respectively<\/p>\n<p>Common color description types: <br \/>#RGB (E.g. <strong>#f00<\/strong> means red)<br \/>#RRGGBB (E.g. <strong>#ff00ff<\/strong> means purple)<br \/>#RRGGBBAA (E.g. <strong>#00ff0080<\/strong> means green, 50% transparency)<\/p>\n<p><strong>Note<\/strong>: The current version doesn&#8217;t support Alpha function.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<p>Example:<\/p>\n<pre><code class=\"language-json\">{\n    &quot;result&quot;: &quot;ok&quot;\n}<\/code><\/pre>\n<p>If set successfully, it will return the message of result = &quot;ok&quot;, or please refer to 1.3 for error message descriptions. <\/p>\n","protected":false},"featured_media":0,"parent":48319,"menu_order":5,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-8783","docs","type-docs","status-publish","hentry"],"acf":[],"aioseo_notices":[],"comment_count":0,"_links":{"self":[{"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/8783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/comments?post=8783"}],"version-history":[{"count":0,"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/8783\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/48319"}],"next":[{"title":"Current decoding output","link":"https:\/\/www.kiloview.com\/en\/docs\/ndi-device-http-apiversion-1-0\/current-decoding-output\/","href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/8785"}],"prev":[{"title":"NDI Sources discovery","link":"https:\/\/www.kiloview.com\/en\/docs\/ndi-device-http-apiversion-1-0\/1-2\/","href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/48748"}],"wp:attachment":[{"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/media?parent=8783"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/doc_tag?post=8783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}