node-red-contrib-axis-host
Version:
Axis Devices resource binding nodes that provides access to events, image capture and analytics data. Node-RED must be running on the Axis Device.
105 lines (96 loc) • 3.37 kB
HTML
<script type="text/x-red" data-template-name="Camera">
<div class="form-row">
<label for="node-input-resolution"><i class="icon-tag"></i> Resolution</label>
<select id="node-input-resolution">
<option value="2688x1512">2688x1512 [16:9]</option>
<option value="1920x1080">1920x1080 [16:9]</option>
<option value="1280x720">1280x720 [16:9]</option>
<option value="640x360">640x360 [16:9]</option>
<option value="320x180">320x180 [16:9]</option>
<option value="800x600">800x600 [4:3]</option>
<option value="640x480">640x480 [4:3]</option>
<option value="320x240">320x240 [4:3]</option>
<option value="4096x4096">2048x2048 [1:1]</option>
<option value="2048x2048">2048x2048 [1:1]</option>
<option value="1280x1280">1280x1280 [1:1]</option>
<option value="800x800">800x800 [1:1]</option>
<option value="640x640">640x640 [1:1]</option>
</select>
</div>
<div class="form-row">
<label for="node-input-overlay"><i class="icon-tag"></i> Overlay</label>
<select id="node-input-overlay">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</div>
<div class="form-row">
<label for="node-input-channel"><i class="icon-tag"></i> Channel</label>
<select id="node-input-channel">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<div class="form-row">
<label for="node-input-output"><i class="icon-tag"></i> Output</label>
<select id="node-input-output">
<option value="buffer">Buffer</option>
<option value="base64">Base64</option>
</select>
</div>
</script>
<script type="text/javascript">
RED.nodes.registerType('Camera',{
category: 'Axis',
color: '#FFCC33',
defaults: {
resolution: { value:"1280x720"},
overlay: { value:"yes"},
channel: { value:"1"},
output: { value:"buffer"}
},
icon: "font-awesome/fa-camera",
inputs: 1,
outputs:1,
label: function() {
return this.resolution || "Camera";
}
});
</script>
<script type="text/x-red" data-help-name="Camera">
<h2>Inputs</h2>
<br/>
<p>
<b>Resolution</b><br/>
Set the resolution you want. Note that if the resolution is not supported by the camera, an error will be thrown.
<dl class="message-properties">
<dt>msg.resolution<span class="property-type">string</span></dt>
<dd>
Overrides the node setting resolution. The syntax is "WIDTHxHEIGHT";
</dd>
</dl>
</p><br/>
<p>
<b>Overlay</b><br/>
Select if you want text, image and graphics overlay in the image (if present).
</p><br/>
<p>
<b>Image crop</b><br/>
It is possible to extract part of the image (crop). Make sure that coordinates are within the image resolution.
<dl class="message-properties">
<dt>msg.crop<span class="property-type">object</span></dt>
<dd>
{<br/>
"x":100,<br/>
"y":100,<br/>
"w":200,<br/>
"h":150<br/>
}<br/>
</dd>
</dl>
</p><br/><br/>
<h2>Outputs</h2>
JPEG image as binary buffer or base64
</script>