Эта страница является
переводом страницы
IRidium studio 2019 IPCameras. Перевод выполнен на 100%.
Video from IP-cameras and images from internet
allow to integrate to your interface video-streams and static images with the help of linkc in the local net or the Internet
Controlling Video Streams in Interface
Open CAMERAS panel in iRidium studio. Cameras is a storage of links to video streams from IP-cameras,that can be used or that are already used in a visualization interface.
Viewing modes:
- Gallery cameras is a general archive of typical links to popular models of IP-cameras. You can add your links to the archive.
- Project cameras contains links to IP-cameras, what you added to the visualization interface. Unused links can be deleted from a project with the help of Unused resources tool in the Resources tab (tool panel in the right part of the sreen).
Setting Video from IP-cameras
Dynamic Images are snap shots or stream video downloaded from resources in the Internet or local network. DVRs, IP cameras, servers can be used as a resource.
Supported video-codecs:
- JPEG / MJPEG - stream video and frame based data receipt from IP cameras or DVRs, snapshots - *.jpg or *.png images
- H.264 / MPEG-4 - a highly compressed video stream
A direct link to an image or a video stream is required (without interface items or ActiveX components, etc.).
where to find a direct link to the stream from an IP camera:
1 Add the link to iRidium project:
Cameras >
Project cameras > Add camera
- add a link to an IP-camera or to a stream from a DVR to the project.
Example of a link to a dynamic image
http://root:root@192.168.0.100:80/source/video.mjpg
rtsp://root:root@mydomain.com:554/mpeg4/media.amp
| the protocol of data exchange (HTTP or RTSP)
|
| the login:password to access the camera
|
| an address of the resource with video
|
| a connection port to the source
|
| a link to the data stream
|
2 Set the link in the project:
- URI - a link to a video stream (or snapshots). Enter a login, password and connection port to the camera below;
- Port- for JPEG/MJPEG default port is 80, for MPEG-4/H.264 deafault port is 554;
- Login / Password - a login and password to a video stream from a camera;
- Refresh (ms) - re-connection to the source of video;
- Refresh: 0 (ms) - for stream video MJPEG/H.264/MPEG-4;
- Refresh: 1000...n (ms) - for frame-based broadcast JPEG;
- Demuxer - automatic or manual selection of FFMPEG type of stream (for cases when a stream is not determined automatically). It is sometimes used to work with Mobotix;
- Probe Size: 50000 (Kb) - the size of data buffer in Kb, that the app will download before displaying video. If you leave 0 by default, the size of the buffer will be 5 Mb. It can be reduced for cameras with low resolution or for slow connection, But values below 20 000 Kb are not recommended;
- Param - a line to enter a type of RTSP transport. Enter:
-
rtsp_transport=tcp; if RTSP stream from an IP-camera is downloaded via the internet or if its quality is low;
-
rtsp_transport=udp; or an empty field connects download of RTSP stream in the local network via UDP;
- ScaleWidth / ScaleHeight - the width / height of a frame for scaling. If the fields are empty video is displayed in the original resolution;
- Audio - determines if an audio stream from a mxpeg camera must be broadcast (if there is one).
- Disconnect when minimized - getting stream video is stopped when the app is minimized or when the screen of a device is blocked (it allows to save Internet traffic).
To change this parameter while the project is running, a script is used, an example is below:
function onDisconnect()
{
IR.GetImage("Camera name").DisconnectWhenMinimized = state;
}
Where:
Camera name - the name of the camera,
state - the state of the parameter (true - enabled, false - disabled).
The Test In Browser button can be used to check work of a JPEG/MJPEG link: the camera is to be displayed without control items, borders or other software shells in the browser.
3 Assign a camera to a graphic item:
Drag'n'drop a dynamic image from the "Cameras" window onto a required graphic item. Then you can edit a link by double clicking on the item it is assigned to.
Choose a type of scaling on a graphic item in the "Image Stretch" field (Project > States)::
- None – do not scale a stream from the IP camera
- Proportional – scale a stream saving proportions
- Full Size – scale without saving proportions by the item size
Scaling a dynamic image by iRidium creates an additional load on the visualization device, we recomend setting a required resolution in the settings of an IP-camera.
The number of visible cameras in your project must not exceed 4-5 for stable work of your iRidium project. Visible are cameras that are at the moment located on opened pages and popups. The larger the resolution of a camera is and a less powerful control panel is, the fewer cameras can be displayed.
If you exceed the recommended number of cameras, it can lead to malfuntion of the whole project.
Only one dynamic image can be assigned to a graphic item with the help of scripts. It means that you can't assign one image in State 1 and another one in State 2 of an item.
To see video from IP-cameras remotely an external IP-address is used, Cloud Gate can't be used here, as i3 pro gets video from IP-cameras directly bypassing iRidium server. The use of an external IP-address is not secure and it creates a possibility of third-part intrusion. To increase the security level you can use the following options:
- use a service that provides online access to video in real time. There is a lite module ror Ivideon service that allows to build in a video stream, broadcast by the server, in i3 pro interface. If other services are used, video can't be built in the interface, but it can be opened in a browser;
- use a complicated password to the IP-camera, make cameras available in the Internet with the help of DDNS or a static IP-address;
- use VPN as the only way to connect to the whole automation object remotely;
- give up the idea of seeing video from IP-cameras in the internet.
Weather Informers
A weather informer is an image locaded at a static link, the image is periodically updated and is available to download via HTTP. Codes of informers are provided by different websites, for example:
The service provides a code to use on a website. From this code you need only a link to an image in the png or jpeg. The link is set like a link to an IP-camera in the "Cameras".
Example of a weather informer on the website:
Example of a link to a weather informer in iRidium Studio:
- URI is a link to an image checked in a browser, it is entered in the URI string of camera settings.
- Refresh: 1000...n (ms) - frequency of image update (do not enter less than 1000 ms).
http://info.weather.yandex.net/moscow/3_white.ru.png
| a protocol of data exchange (HTTP)
|
| the address of a resource - video source
|
| a link to an image-informer
|
Use the Test In Browser button to test the work of a ready link.
Drag'n'drop an image on an item. The size of an item must be the same as the resolution of the informer for high-qaulity display.
A link can be edited with a double-click on the item it is assigned to.
PTZ Control
PTZ control is control of an IP-camera or a DVR via HTTP. If your camera supports PTZ commands, you can control it: change its position if it has an actuator to turn, change the focus point, set recording parameters, etc.
PTZ commands are must be sent with the help of the AV & Custom Systems (HTTP) driver. They are usually formed as GET requests which can be sent via a browser. Study REST API of your camera or DVR to get a list of PTZ commands. Use the list following the manual for AV & Custom Systems (HTTP).
Video from Cameras of Control Panels
If i3 pro works on an iOS, Windows or Android device with a front camera (or on the laptop with the web-camera), you can display video from this camera in your iRidium project.
This feature is usually used when working with SIP video for displaying the stream which is broadcst via the SIP protocol to another subscriber.
To display video from the main or the front camers of a control panel in your project, assign a link to the camera to a graphic item and start getting a stream. The setting is done in theScript Editor (JS):
IR.AddListener(IR.EVENT_START,0,function()
{
// link the camera image to a display Item
IR.GetItem("Page 1").GetItem("Item 1").GetState(0).Image = "ir_camera://";
});
function CameraStart ()
{
// start the camera record and flip it into vertical position (if started on iPad)
IR.Camera(IR.CAMERA_RECORD, IR.CAMERA_FRONT, IR.CAMERA_RESOLUTION_MEDIUM);
IR.Camera(IR.CAMERA_FLIP_VERTICAL, 1);
}
function CameraStop ()
{
// stop the camera record
IR.Camera(IR.CAMERA_STOP);
}
You can start and stop display of video by calling the functions CameraStart and CameraStop with the ScriptCall command:
The same can be done by adding a function call by some event in the script:
IR.AddListener(IR.EVENT_APP_ENTER_FOREGROUND, 0, function()
{
CameraStart (); // start video when iRidium in foreground
});
IR.AddListener(IR.EVENT_APP_ENTER_BACKGROUND, 0, function()
{
CameraStop (); // stop video when iRidium in background
});
Video settings (quality, angle, etc.) are formed when a video stream is created with the help of IR.Camera() method. It is described in detail in JavaScript Handbook.
SIP-video
During SIP video -calls it is required to display a video-stream sent by a subscriber who you are connected to.
The stream is formed automaticalle when a video call is done by means of a SIP-driver. To diplay video, assign it to a graphic item. Video is assigned to a graphic item in the Script Editor (JS):
IR.AddListener(IR.EVENT_START,0,function()
{
// display the SIP video
IR.GetItem("Page 1").GetItem("Item 1").GetState(0).Image = "sip_image://";
});