You can use an IoT Platform instance of the video type to perform pan-tilt-zoom (PTZ) control on IP cameras. This way, you can adjust the field of view (FOV) and zoom actions of the camera.
To implement PTZ control on your IP camera, you must define PTZ control services. In the IoT Platform console, you can define the services in the Thing Specification Language (TSL) model for the product to which your IP camera belongs. For more information about the TSL model, see What is a TSL model?
Prerequisites
An IoT Platform instance of the video type is purchased, and a video device is connected to IoT Platform. For more information, see Device Connection.
Make sure that your IP camera supports the PTZ control feature.
Background
You must perform operations described in the "Cloud-side development" section to call the PTZ control services defined in the TSL model.
This topic does not provide instructions on how to implement PTZ control in the application. You can implement PTZ control in the application based on the following logic: The application sends a command to IoT Platform, which then calls the InvokeThingService operation provided by LinkVisual to perform PTZ control on the IP camera.
Cloud-side development
Log on to the IoT Platform console. On the Instance Overview page, find the instance of the video type that you created, and click the instance name.
In the left-side navigation pane, choose Devices > Products, and click the name of the video product that you want to configure.
On the Product Details page that appears, click the Define Feature tab to view the TSL model of your device. The TSL model includes the services defined for the product.
LinkVisual allows you to perform PTZ control in the following modes:
Mode
Service
Description
Manually start and stop PTZ control
StartPTZAction
StopPTZAction
StartPTZAction: You can specify the Speed and ActionType parameters for the IP camera. The camera then changes its FOV or zooms in or out as instructed.
StopPTZAction: You can manually stop the FOV change or zoom action of the IP camera.
NoteThe two services must be used together.
Set exposure value steps (EVS) for PTZ control
PTZActionControl
You can specify the Step and ActionType parameters for the IP camera. The camera then changes its FOV or zooms in or out as instructed. The camera stops performing additional actions after it completes the required action by the specified Step value.
Click View in the Actions column of a service, such as StartPTZAction. The service details are then displayed.
To enable PTZ control services, call the InvokeThingService operation with the input parameters.
The following table describes the main request parameters of the InvokeThingService operation. For more information about other request parameters, see InvokeThingService.
Parameter
Description
Identifier
The identifier of a service. To view a service identifier in the IoT Platform console, go to the Define Feature tab of the Product Details page. You can also call the QueryThingModel operation and view the service identifier in the returned TSL data.
Args
The values of input parameters used to enable services are in the JSON format.
The following table describes the examples of Identifier and Args parameters for each PTZ control service.
Service
Example
StartPTZAction
"identifier":"StartPTZAction", "args":{ "ActionType":0, "Speed":0 }
StopPTZAction
"identifier":"StopPTZAction", "args":{ }
PTZActionControl
"identifier":"PTZActionControl", "args":{ "ActionType":0, "Step":1 }