{"id":48748,"date":"2021-05-13T17:23:33","date_gmt":"2021-05-13T09:23:33","guid":{"rendered":"https:\/\/www.kiloview.com\/en\/support\/docs\/ndi-device-http-apiversion-1-0\/1-2\/"},"modified":"2021-05-13T17:23:33","modified_gmt":"2021-05-13T09:23:33","slug":"1-2","status":"publish","type":"docs","link":"https:\/\/www.kiloview.com\/en\/docs\/ndi-device-http-apiversion-1-0\/1-2\/","title":{"rendered":"NDI Sources discovery"},"content":{"rendered":"<p><strong>Module name:<\/strong> decoder\/discovery<\/p>\n<p><strong>Basic URL:<\/strong> \/api\/v1\/decoder\/discovery\/<\/p>\n<p><strong>Note<\/strong>: : APIs of this module is only effective when the device works in <strong>Decoder<\/strong> mode. <\/p>\n<h2>Get NDI Sources discovered in network<\/h2>\n<hr \/>\n<h4>API URL<\/h4>\n<p>\u200b   <strong>\/api\/v1\/decoder\/discovery\/get<\/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>force<\/td>\n<td><strong>[ANY]<\/strong>, <strong>Optional<\/strong><\/td>\n<td>If you specify <strong>force<\/strong> parameter, no matter what it is, it requires NDI Device to force a rescan of the network.<\/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    &quot;data&quot;: [\n        {\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        },\n        \/* ... Each discovered items in the array ... *\/\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>group<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>NDI Source located NDI Group. If the Group you get is a empty string <strong>&quot;&quot;<\/strong>, it means public group by default.<\/td>\n<\/tr>\n<tr>\n<td>name<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>NDI Source Name. It is original name for NDI Source. If you want to get device name, channel name, please refer to device_name and channel_name.<\/td>\n<\/tr>\n<tr>\n<td>device_name<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>NDI Device Name resolved from <strong>name<\/strong>\uff0cwhich normally represent host name of NDI Source.<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td>NDI Channel Name resolved from <strong>name<\/strong><\/td>\n<\/tr>\n<tr>\n<td>url<\/td>\n<td><strong>[STRING]<\/strong><\/td>\n<td>NDI Source URL. <br \/><strong>Note<\/strong>: Current URL format is  <code>&lt;IP&gt;:&lt;port&gt;<\/code>\uff0cbut it is recommended to not take it as the fact, NDI SDK does not guarantee this. Please keep the url original value and don&#8217;t attempt to change it while using.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>TIPS<\/strong>:<\/p>\n<blockquote>\n<p>A. NDI Discovery based on mDNS mechanism, which can only discover NDI Sources that in the same subnetwork with current NDI Device by default.  <\/p>\n<p>B. Considering there a huge lot of NDI Sources in your network, and NDI Discovery speed is not as fast as you imagine, so NDI Device will cache the sources discovered previously and return the results to you as soon as possible. In the same time, NDI Device will keep scanning and update cache in the background. Therefor, the result you get may not be completely up-to-date (but in most cases). You can get updates by calling this API periodically.<\/p>\n<\/blockquote>\n<h2>Manual discovery: specify IP and\/or NDI Groups<\/h2>\n<hr \/>\n<p>In most cases, we can discover automatically NDI Sources via network, but there some special conditions: <\/p>\n<ul>\n<li>NDI auto discovery can&#8217;t discover NDI Sources not in the same Subnet;<\/li>\n<li>NDI has its own logical group, by default, NDI auto discovery can only discover devices of group <strong>&quot;public&quot;<\/strong>;<\/li>\n<li>Other conditions that due to network restricted network <strong>Multicast<\/strong>.<\/li>\n<\/ul>\n<p>Under above conditions, we may need to manually specify target IP address and\/or NDI Groups of NDI discovery. <\/p>\n<h4>API URL<\/h4>\n<p>\u200b   <strong>\/api\/v1\/decoder\/discovery\/set_manual_targets<\/strong><\/p>\n<h4>Request<\/h4>\n<p>\u200b   Method: <strong>POST<\/strong>  ( <code>Please note<\/code>This API can only use POST method and submitted parameters need to use JSON format) <\/p>\n<p><strong>Parameters (example):<\/strong><\/p>\n<pre><code class=\"language-json\">{\n    &quot;ip&quot;: [&quot;192.168.100.3&quot;, &quot;172.16.10.5&quot; \/*, ...*\/],\n    &quot;group_name&quot;: [&quot;public&quot;, &quot;private_group&quot;, &quot;my-group&quot; \/*,...*\/]\n}<\/code><\/pre>\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>ip<\/td>\n<td><strong>[ARRAY(STRING)]<\/strong> , <strong>Optional<\/strong><\/td>\n<td>Through JSON array, specifying one or more target IP addresses of NDI Sources that NDI Sources manually discovered. Specified IP address can be in different Subnet with current NDI Device.   <br \/>This parameter is optional. If not specify, the former specified manual IPs will be cleared.<\/td>\n<\/tr>\n<tr>\n<td>group_name<\/td>\n<td><strong>[ARRAY(STRING)]<\/strong> , <strong>Optional<\/strong><\/td>\n<td>Group Names. Through JSON array, specifying one or more NDI Group Names that NDI Sources manually discovered <br \/>This parameter is optional. If not specified, the former specified Group Name will be cleared.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Note: <\/strong><\/p>\n<p>A) The IP and NDI Groups that you manually specified will be recorded and saved by the device. Therefore, even if you restart the device, these IP and NDI Groups will work.<\/p>\n<p>B) Manually specifying IP and NDI Groups will not influence it auto discovery. Therefore, you will see all the auto-discovery NDI Sources and manually specified Sources (if target exists). <\/p>\n<p>C) As showed in the parameter description, if you do not specify &quot;ip&quot; or &quot;group_name&quot;, it means that it will clear the previous settings. If you need to keep the previous settings, be sure to pass the original value as a parameter. You can get the previous value via API <strong>\/api\/v1\/decoder\/discovery\/get_manual_targets<\/strong>.<\/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 set successfully, it will return the message of result = &quot;ok&quot;.  Otherwise, please refer to 1.3 for error message descriptions. <\/p>\n<h2>Get specified manual discovery and NDI Groups<\/h2>\n<hr \/>\n<h4>API URL<\/h4>\n<p>\u200b   <strong>\/api\/v1\/decoder\/discovery\/get_manual_targets<\/strong><\/p>\n<h4>Request<\/h4>\n<p>\u200b   Method: <strong>GET\/POST<\/strong> <\/p>\n<p>\u200b   Parameter: 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        &quot;ip&quot;: [&quot;192.168.100.3&quot;, &quot;172.16.10.5&quot; \/*, ...*\/],\n        &quot;group_name&quot;: [&quot;public&quot;, &quot;private_group&quot;, &quot;my-group&quot; \/*,...*\/]\n    }\n}<\/code><\/pre>\n<p><strong>Data field description: <\/strong><\/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>ip<\/td>\n<td><strong>[ARRAY(STRING)]<\/strong><\/td>\n<td>Return a list of all manually specified IP addresses through the array.<\/td>\n<\/tr>\n<tr>\n<td>group_name<\/td>\n<td><strong>[ARRAY(STRING)]<\/strong><\/td>\n<td>Return a list of all manually specified NDI Groups through the array.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"featured_media":0,"parent":48319,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-48748","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\/48748","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=48748"}],"version-history":[{"count":0,"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/48748\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/48319"}],"next":[{"title":"NDI decoding Preset","link":"https:\/\/www.kiloview.com\/en\/docs\/ndi-device-http-apiversion-1-0\/ndi-decoding-preset\/","href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/8783"}],"prev":[{"title":"NDI Encoder status and settings","link":"https:\/\/www.kiloview.com\/en\/docs\/ndi-device-http-apiversion-1-0\/ndi-encoder-status-and-settings\/","href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/docs\/8779"}],"wp:attachment":[{"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/media?parent=48748"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.kiloview.com\/en\/wp-json\/wp\/v2\/doc_tag?post=48748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}