node-red-contrib-onvif
Version:
A Node-RED node that interacts with ip cameras using the ONVIF protocol
109 lines (105 loc) • 3.19 kB
HTML
<script type="text/x-red" data-template-name="ONVIF Snapshot">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-url"><i class="fa fa-link"></i> IP Cam URL</label>
<input type="text" id="node-input-url" placeholder="http://192.168.0.10:8080/onvif/device_service">
</div>
<div class="form-row">
<label for="node-input-username"><i class="fa fa-user"></i> Username</label>
<input type="text" id="node-input-username" placeholder="Username">
</div>
<div class="form-row">
<label for="node-input-password"><i class="fa fa-key"></i> Password</label>
<input type="text" id="node-input-password" placeholder="Password">
</div>
<div class="form-row">
<label for="node-input-resize"><i class="fa fa-file-code-o"></i> Resize</label>
<input type="text" id="node-input-resize" placeholder='{"width": 800}'>
</div>
</script>
<script type="text/x-red" data-help-name="ONVIF Snapshot">
<h2>Inputs</h2>
<p>You can wire inject nodes to the input of this node and send the following in <code>msg.payload</code>.</p>
<table>
<thead>
<tr>
<th>msg.payload</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>IP camera name</td>
</tr>
<tr>
<td><code>url</code></td>
<td>IP camera URL</td>
</tr>
<tr>
<td><code>username</code></td>
<td>IP camera username</td>
</tr>
<tr>
<td><code>password</code></td>
<td>IP camera password</td>
</tr>
<tr>
<td><code>resize.width</code></td>
<td>Resize image by width</td>
</tr>
<tr>
<td><code>resize.height</code></td>
<td>Resize image by height</td>
</tr>
</tbody>
</table>
<h2>Output</h2>
<table>
<thead>
<tr>
<th>msg.payload</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>image.base64</code></td>
<td>Base64 encoded image</td>
</tr>
<tr>
<td><code>image.binary</code></td>
<td>Binary image</td>
</tr>
</tbody>
</table>
</script>
<script type="text/javascript">
RED.nodes.registerType("ONVIF Snapshot", {
category: "ONVIF",
color: "#91d2f7",
defaults: {
name: {value: ""},
url: {value: ""},
username: {value: ""},
password: {value: ""}
},
inputs: 1,
outputs: 1,
icon: "onvif-snapshot.png",
label: function() {
return this.name || this.url || this.type;
},
labelStyle: function() {
return this.name ? "node_label_italic" : "";
},
paletteLabel: "Snapshot",
oneditprepare: function() {
},
oneditsave: function() {
}
});
</script>