Low latency IP Camera video in the D2000 SCADA scheme? Anything is possible.
Today we will explore an interesting topic of the IP Camera video integration into the scheme designed in the D2000 system. This question pops up from our clients now and then and brings interesting possibilities into SCADA monitored/controlled processes – e.g. to see and check visual video output together with data obtained from PLCs.
Therefore, our requirement is to display real-time video recording in our SCADA scheme to be able to correlate visual output with digitally metered numbers. The real-time aspect is an essential property of the solution because showing the video output e.g. with 30 seconds delay albeit with much better video quality could be critically insufficient, e.g. in cases like alarm state checking. Upon this basic requirement, we could think of additional requirements like:
- the possibility to record video output for a specific time interval – e.g. when the alarm is on, we can record the video output from the camera
- the ability to control the camera's pan/tilt/zoom directly from a scheme
- the possibility to enhance output e.g. with monitored values or status icons placed directly upon video canvas
- using the video output in D2000 web solutions – Thin Client and Smart Web
- adding of processing filters, e.g. to identify motion detection on the screen
101 Course of the IP Camera technologies
In order to present the following possibilities, we need to shortly introduce relevant technologies and conditions required for the correct work. The vast majority of IP Camera hardware publish video (+audio) stream via a combination of RTSP+RTP+RTCP protocols. RTSP (Real Time Streaming Protocol) is used as a remote control for your TV or video recorder; it allows listing and choosing specific channels to be played. Video stream delivery is physically realized using RTP (Real-time Transport Protocol) which could be dynamically adapted from the consumer side by the last protocol from the list – RTCP (Real Time Control Protocol). The implementation of video streaming using this technology stack is not trivial and takes serious computational resources (including video codec encoding).
Due to performance reasons, consumer applications usually do not play video streams directly from the IP Camera but they use something called NVR (Network Video Recorder) hardware or some media gateway or Video Surveillance System software which stands between consumers and IP cameras to handle desired demand and workload. Surveillance systems have a special position among them – they support the ONVIF standard protocol for IP Cameras that allows controlling cameras in various ways –the most popular one is the PTZ (Pan/Tilt/Zoom) functionality.
Although none of the mentioned IP Camera protocols is natively supported in D2000, the flexibility of our platform allows multiple ways of how to integrate live video streams from intermediary systems into a scheme. Besides handling the workload of video streaming, these intermediate systems often transcode video streams to protocols that are more approachable to a client often utilizing various web technologies.
Recommended solution
The D2000 Graphic editor offers various components like HTML5 Frame, WebFrame or ActiveX which could be used for video streaming. Of course, every solution has its own advantages and disadvantages and it is tightly connected to the usage of the intermediary component.
We have made a proper analysis of these components ranging from NVR to Media and Surveillance systems. From the point of view of performance and cost, we recommend using the ZoneMinder open-source surveillance system as an intermediary server dedicated to video transcoding and including video recording and the IP Camera control. ZoneMinder is a battle-tested software in a lot of different cases; it has a web interface used to easily connect IP Cameras to dynamic identification of its capabilities (e.g. ONVIF) and comprehensive handling of security and configuration options (e.g. motion detection events, recording scheduling, etc.). The best of all is easy integration of video streaming to third-party apps via the MJPEG (Motion JPEG) technology and complex API possibilities to control cameras and setup recording based on various events.
Showing MJPEG live video on the D2000 scheme could be simply made by placing the HTML5 Frame component with an index.html file containing a simple HTML IMG tag pointing towards the MJPEG video URL defined in the ZoneMinder server.
MJPEG video streaming could be used in web modules – Thin Client and Smart Web. Especially in Smart Web, we could easily overlay video output with drawn values from D2000 but this could be done also in the HTML5 Frame.
Other solutions
The absence of native audio streaming and low video compression are major disadvantages of ZoneMinder's MJPEG video streaming. However, there are also other possibilities for how to show the IP Camera output on the scheme.
We have developed functionally similar alternative with the Kurento Media Gateway as an intermediate component. This solution, of course, lacks camera control features and is designed solely to video streaming and processing via the Web RTC standard. Web RTC is a standard in all major browser engines, therefore it is also possible to use it in the HTML5 Frame. Web RTC is a peer-to-peer real-time streaming protocol heavily inspired by already known RTSP+RTP+RTCP combination of protocols.
Another possibility is to install a freely available VideoLAN player and use its ActiveX component in the D2000 Scheme to play stream; in a simple case either directly from the IP Camera or restreamed from any Media Server or NVR.
IP Cameras and hardware NVRs solutions often provide special plugins to Internet Explorer for video stream rendering in the browser or there is a Flash technology used for playing special video stream – RTMP developed by the Macromedia Company. Of course, these solutions use older technologies but sometimes it could be an affordable way to connect older hardware. In the D2000 scheme, we could use the component WebFrame for such cases.