Facility Control

 View Only
  • 1.  NDI Window - Seting 'Sub Window (x,y,w,h); via ogscript

    Posted 07-30-2025 04:37

    I have seen from some previous posts that there is a ndiwin.setSource() command for changing the source. Is there an equivalent command to set the sub window?

    Is there any documentation detailing these commands? 



    ------------------------------
    Richard Hills
    ------------------------------



  • 2.  RE: NDI Window - Seting 'Sub Window (x,y,w,h); via ogscript

    Posted 07-30-2025 06:33

    I have a solution using parameters, thank you Daniel Bailey.  File attached.

    I would still be interested to know if there is a direct command like setSource, and if there is a document with all these commands in it.



    ------------------------------
    Richard Hills
    ------------------------------



  • 3.  RE: NDI Window - Seting 'Sub Window (x,y,w,h); via ogscript

    Posted 07-31-2025 04:43

    Following up from Richards post as the file didn't seem to attach.

    The example below uses a parameter we created called subWindowString in the definition of the NDI window so that it is evaluated when window is loaded:

    <ndi height="250" id="NDI_Window" left="136" srcname="HCS_FR5 (HDX_Stream)" style="bg#BEA1A1;" top="213" width="487" window="%value['subWindowString'][0]%"/>

    NDI window has an ID of NDI_Window. And whenever subWindowString is changed we just have to reload the window:

    ogscript.reload("NDI_Window");

    <abs contexttype="opengear" id="_top" keepalive="false" style="">
       <meta>
          <params>
             <param access="1" maxlength="0" name="subWindowString" oid="subWindowString" type="STRING" value="50,50,60,80" widget="default"/>
          </params>
       </meta>
       <ndi height="250" id="NDI_Window" left="136" srcname="HCS_FR5 (HDX_Stream)" style="bg#BEA1A1;" top="213" width="487" window="%value['subWindowString'][0]%"/>
       <param expand="true" height="31" left="765" oid="subWindowString" top="216" width="468"/>
       <button buttontype="push" height="122" left="824" name="Reload" top="282" width="336">
          <task tasktype="ogscript">
    
    
    /*! block id=1000 !*/
    ogscript.reload("NDI_Window");
    /*!!
     &lt;block id="1000" type="ogscript_reload" x="223" y="206" w="243" ID="NDI_Window" /&gt;
    !!*/
    /*!!&lt;checksum&gt;5e59e696c40b4d3aad4064456a6dceff&lt;/checksum&gt;!!*/</task>
       </button>
    </abs>
    


    ------------------------------
    Daniel Bailey
    Solutions Architect - Hyperconverged Solutions
    Ross Video
    ------------------------------



  • 4.  RE: NDI Window - Seting 'Sub Window (x,y,w,h); via ogscript

    Posted 07-31-2025 09:21

    You can avoid the rebuild by using ogscript.getComponentsById to get the NDI panel and then call panel.setImageWindow(x, y, w, h);

    <abs contexttype="opengear" id="_top" keepalive="false">
       <meta>
          <params>
             <param access="1" constraint="0.0;1080.0;0.0;1080.0;1" constrainttype="INT_STEP_RANGE" name="Top" oid="Top" precision="0" type="INT32" value="0" widget="slider-vertical"/>
             <param access="1" constraint="0.0;1920.0;0.0;1920.0;1" constrainttype="INT_STEP_RANGE" name="Left" oid="Left" precision="0" type="INT32" value="0" widget="slider-horizontal"/>
             <param access="1" constraint="0.0;1920.0;0.0;1920.0;1" constrainttype="INT_STEP_RANGE" name="Width" oid="Width" precision="0" type="INT32" value="1920" widget="spinner"/>
             <param access="1" constraint="0.0;1080.0;0.0;1080.0;1" constrainttype="INT_STEP_RANGE" name="Height" oid="Height" precision="0" type="INT32" value="1080" widget="spinner"/>
          </params>
          <api>function updateWindow()
    {
       var top = params.getValue('Top', 0);
       var left = params.getValue('Left', 0);
       var width = params.getValue('Width', 0);
       var height = params.getValue('Height', 0);
    
       var ndiPanel = ogscript.getComponentsById('my-ndi')[0];
       ndiPanel.setImageWindow(left, top, width, height);
    }</api>
       </meta>
       <ndi fill="both" height="277" id="my-ndi" left="144" quality="high" srcname="L-OTTJPELTZER4 (Test Pattern)" top="121" width="482" window="%value['Left'][0]%,%value['Top'][0]%,%value['Width'][0]%,%value['Height'][0]%"/>
       <param expand="true" height="278" left="649" oid="Top" top="119" width="79">
          <task tasktype="ogscript">updateWindow();</task>
       </param>
       <param expand="true" height="87" left="756" oid="Left" top="69" width="383">
          <task tasktype="ogscript">updateWindow();</task>
       </param>
       <param expand="true" height="51" left="790" oid="Width" top="209" width="134">
          <task tasktype="ogscript">updateWindow();</task>
       </param>
       <param expand="true" height="51" left="946" oid="Height" top="208" width="134">
          <task tasktype="ogscript">updateWindow();</task>
       </param>
    </abs>
    


    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------