Image Streamer Driver Module by Automation Professionals
E-Mail Support

Image Streamer Driver Module

Overview

The Image Streamer Driver Module connects to sources of network video, and to the live image streams from select Machine Vision devices, and repeats the streams from the gateway as Motion JPEG. Any audio content is discarded. In addition to repeating the frames as-is, each stream is simultaneously offered in half-scale and quarter-scale forms. The gateway optimizes CPU load by skipping JPEG compression (and scaling) for streams with no active viewers.

An OPC/UA driver instance is created for each stream source. Ignition's OPC server exposes metadata from the stream source as browseable but read-only OPC items. The resulting MJPEG stream is available from the gateway at a URL of the form:

Full Scale:
http(s)://gateway:port/system/streamer/<device_name>
Half Scale
http(s)://gateway:port/system/streamer/<device_name>?half
Quarter Scale:
http(s)://gateway:port/system/streamer/<device_name>?quarter

In addition to the scaling operation in the URL's query string, a frame skip option can be specified. Add ?skip=N (to the full-scale URL) or &skip=N (to the scaled URLs), where "N" is an integer number of frames to skip between frames delivered to the client. This can be used to reduce CPU load at the client.

These streams are compatible with Ignition's IP Camera Viewer Component in the Vision Module, and can also be viewed directly in most modern browsers.

Since the device name is needed in the URL, avoid device names containing spaces or unusual characters, as they will need to be encoded if present.

Driver instances stay connected to their source and continuously decode it. Reconnection is automatic. New consumers will immediately receive the last decoded image (if any) followed by new images as they arrive. Multiple client connections to the same stream produce very light additional server load, as the compressed bytes are shared to all consumers.

Note: In a full standard installation of Ignition, there is no limit to the number of streaming devices. In all other editions, no more than eight (8) devices are allowed.

OpenCV

This driver uses OpenCV, if available, to offer generic network video streaming. The gateway attempts to locate an installed version of OpenCV and its Java bindings during this driver module's setup. See the OpenCV installation instructions for specific platform details. Success or failure of the OpenCV load attempt is logged.

If the bindings' jar file is successfully loaded, along with the corresponding Java Native Interface library, this driver will expose a Network Video ReStreamer device type. It will also inject many OpenCV classes, functions, and constants into all gateway Script Managers. See the Scripting section for details.

Similar jar and JNI load attempts are made on every client and designer, for scripting support. OpenCV (and FFmpeg) must be installed locally or the support is skipped (with a console message).

An alternative component for video stream viewing is planned to take advantage of locally installed OpenCV features.

Supported Device Types

  1. Network Video ReStreamer via OpenCV

    If OpenCV is loaded, RTSP streams, static video files, and any other video type it supports will be readable and restreamable to Motion JPEG clients. Only one connection to the source is made no matter how many clients connect to the gateway.

  2. Keyence CV-5000 Family

    The Keyence CV-5000 family of Machine Vision controllers offer an option to send captured images (from up to four cameras) out a TCP network connection for generic consumption. The configured image stream will be monitored continuously and restreamed to Motion JPEG clients (separate URLs for each attached camera).

    Also, a command port connection is made and exposed to scripting functions for any desired ad-hoc control scheme. The scripting functions include packing and unpacking of binary payloads, which can be used to handle reference images, as well as selective extraction of prior images from the controller's internal archive. See the Scripting section for details.

    Note: the CV-5000 device is not available in the Maker Edition.

Usage Notes

The IP Camera Viewer will continue showing the last received frame if a stream ends, without any indication that the video is no longer live. Since this driver module ends streams any time the resolution changes, or if a source reconnection is needed, there must be scripting in the client to trigger re-opening the stream. Automation Professionals recommends its Simulation Aids module (free!) combined with the stateCheck() function from shared.ipcamera.py.