Help Center/ Huawei HiLens/ SDK Reference/ Output/ Constructing Output Monitors
Updated on 2023-06-15 GMT+08:00

Constructing Output Monitors

This section describes how to construct monitors to display images or output images to video streams. If the operation fails, the system displays "CreateError". You can view the skill logs or output to locate the error cause.

If the file type is H264_FILE, the generated file is only an H.264-encoded raw video stream and does not contain information such as the frame rate. In addition, the HiLens Framework does not limit the file size. Therefore, it is recommended that this function be used only for debugging.

API Calling

static std::shared_ptr hilens::Display::Create(Type type, const char * path = NULL)

Parameter Description

Table 1 Parameters

Parameter

Description

type

Display type. The options are HDMI, RTMP, and H264_FILE.

path

If the file type is HDMI, ignore this parameter. If the file type is RTMP, set the path to the RTMP server URL (rtmp://xxxx). If the file type is H264_FILE, set the path to the output file path (for example, hilens::GetWorkspacePath()+"/out.h264").

Return Value

If the operation is successful, a monitor instance is returned. If the operation fails, nullptr is returned.