Материал из Module developer
Перейти к: навигация, поиск

module.CreateImage

{{API Function/ru |description= Create a dynamic image with an indicated set of parameters. If some parameters are not indicated, they have default value or save the previous value. An image is created without assiging to a graphic item. It can be used on different popups refering by name. The name of a created image can't be changed, unlike other properties. |constructor= module.CreateImage(Name, Param); |input=

Name "Camera 1" type: String
name of a dynamic image (camera)
Param type: Object

a set of dynamic image properties

  • URI: link to image
  • Refresh: for image (snapshots), image update frequency. For video stream - 0
  • Demuxer: automatic or manual selection of FFMPEG type of stream - for cases when a stream is not defined automatically. Empty field - automatic selection, mxg - for Mobotix camers
  • Probe Size: data size required to start showing video (caching). By default (0) is 5Mb. It can be lower to speed up showing video.
  • Param: line to indicate type of RTSP transport. Indicate tcp, is video from the camers is not shown via the internet or there are artifacts.
  • Audio: play audio stream. It works with Mobotix (mxg) cameras.
  • ScaleWidth, ScaleHeight: image resolution. If it is not set, the dynamic image is shown in the original resolution

|output=

Object [object ImagePrototype] type: Object
object of a graphic item (image)

|JSsample=

// Create image
module.CreateImage("Camera 1", {URI: "http://login:pass@host:port/file", 
						  Refresh: 0, 
						  Demuxer: '', 
						  ProbeSize: 0, 
						  Param: '', 
						  Audio: false, 
						  ScaleWidth: 640, 
						  ScaleHeight: 480
						  });
}}