All Products
Search
Document Center

ApsaraVideo Live:Technical FAQ

Last Updated:Oct 08, 2024

This topic provides answers to frequently asked questions (FAQ) about Queen SDK.

Table of contents

What are the requirements for calling the API operations of Queen SDK?

Make sure that the following requirements are met when you call the API operations of Queen SDK, including the operations that you can call to create, configure, use, and destroy resources:

  • All API operations must be called by using the same thread.

  • The thread must have a Graphics Library (GL) context. If no GL context exists, you can call an API operation of Queen SDK to create one.

How do I troubleshoot and debug errors?

Android:

After an engine is created, enable debugging.

engine.enableDebugLog();

You can enter the keyword Queen to search for the output logs that record the operational status of Queen SDK. The following figures show some log examples.12

You can obtain detailed information from DEBUG-level logs and more concise information from INFO-level logs.

How do I specify the input and output parameters?

Queen SDK provides a built-in intelligent algorithm that automatically calculates the optimal input parameters for the current image. To view the expected input parameter values, perform the following steps:

  1. When you create an engine, set the input mode of the algorithm to auto: config.algInputMode = AlgInputMode.kModeAutomatic;3

  2. Enable debugging after the engine is created.

    engine.enableDebugLog();

    You can filter logs to view the Logcat output, as shown in the following figure.

    4

    In the log examples, the values of the input_angle, out_angle, and out_flip fields are algorithm-generated values, which are the expected input parameter values for the current image.

Important

Take note that using the intelligent algorithm requires additional performance overheads. After the test is complete, revert the changes made in the preceding two steps in a timely manner.

How does Queen SDK perform?

After years of iterations, Queen SDK strives to lead the industry in terms of performance, retouching effects, and efficiency. Performance optimization is a top priority for Queen SDK. Alibaba Cloud undertakes specialized optimizations and iterations for Queen SDK, especially for low-end devices and earlier versions of operating systems prevalent in Southeast Asia. Thanks to multiple rounds of optimization, Queen SDK delivers industry-leading performance. Queen SDK offers various versions of each feature to cater to different business requirements. For example, the retouching module supports the advanced, power-saving, and smart adjustment modes. During regular iterations, each version has a dedicated multidimensional performance testing report and is verified on a large scale by a large number of internal and external users.

How do I resolve the black screen issue?

Cause: In most cases, a black screen appears when an invalid texture ID is used or an error occurs in the texture generation process. Occasionally, a black screen issue may also occur if you improperly use the returned texture ID or use an invalid texture ID to render your business layer.

Solution: The rendering layer of Queen SDK is built based on Open Graphics Library (OpenGL). To resolve the black screen issue, make sure that the texture ID passed to Queen SDK is valid. This way, Queen SDK ensures that the output texture is normally displayed. Queen SDK can return the original texture even if no effect is applied, invalid parameters exist, or you do not obtain a license to use Queen SDK.

After my application is integrated with Queen SDK, why does my screen flicker with a solid color or change the color when I move the mobile phone, without displaying any image?

Cause: The issue may occur if the construction parameter toScreen of the engine is set to true, the input texture type is oes, and the render() method is used without a parameter.

Solution: Replace render() with renderTexture(matrix). If the input texture type is oes, you must use the renderTexture() method. The value of the matrix parameter is obtained by using the SurfaceTexture class.

What do I do if the application exits unexpectedly after startup?

Make sure that the value of the textureId parameter in engine.setInputTexture is valid, and then restart the application.

How do I resolve the issue where the sticker or makeup feature cannot recognize faces when the image is rotated by 90 degrees and displayed in landscape mode?

Cause: The issue may occur if the construction parameter toScreen of the engine is set to true, the input texture type is oes, the render() method is used without a parameter, and the algorithm uses the frame fetch method instead of the bytebuffer method.

Solution: Use the bytebuffer method. However, the face image may be incorrectly scaled up or down due to changes in width and height.

Why are the advanced retouching, makeup, and sticker features ineffective while the basic retouching feature is effective?

If you can use the basic retouching feature, the initialization, parameter setting, and rendering processes of QueenEngine are valid. The ineffectiveness of the advanced retouching feature is usually caused by invalid parameter settings. If your advanced retouching settings are invalid, faces cannot be recognized and all effects that require facial landmarks become invalid. The following part describes the common invalid parameter settings:

  • You specify invalid values for the width and height parameters of the input texture for the setInputTexture(int texture, int width, int height, boolean isOES) method. The values of the width and height parameters must be the width and height of the current texture that is specified by the texture parameter. The value of the isOES parameter specifies whether the texture is an oes texture, which is specific to Android. Whether the texture is oes determines whether QueenEngine needs to perform texture display conversion. If QueenEngine needs to perform texture display conversion, the correct matrix of the current camera needs to be passed by using the render parameter. The width and height that you specify determine the aspect ratio of the displayed rendering view. This may affect the scaling ratio of the rendering view to which the effects of advanced features are applied. A common result is that the effects of advanced features are applied, but the image is enlarged and deformed.

  • You specify invalid values for the input width and height parameters for the updateInputDataAndRunAlg(byte[] imageData, int format, int width, int height, int stride, int inputAngle, int outAngle, int flipAxis, boolean reuseData) method. The values of the width and height parameters specify the actual width and height of the current input data specified by the imageData parameter. The width and height can be the same as the width and height specified in the preceding scenario, or can be reversed. For example, the value of buffer directly obtained from the camera on Android devices is the buffer when the image is rotated by 90 degrees, and the width and height are reversed. The width and height that you specify determine whether faces can be recognized and whether the features that are related to facial recognition are available.

  • You specify invalid values for input parameters such as inputAngle, outAngle, and flipAxis for the updateInputDataAndRunAlg(byte[] imageData, int format, int width, int height, int stride, int inputAngle, int outAngle, int flipAxis, boolean reuseData) method, or you specify invalid values for input parameters for the updateInputTextureBufferAndRunAlg(int inputAngle, int outAngle, int flipAxis, boolean usePreviousFrame) method. The inputAngle, outAngle, and flipAxis parameters are required for the facial recognition feature. The inputAngle parameter determines how the algorithm uses the input data or texture, whether images need to be rotated, and how many degrees images are rotated. The outAngle parameter determines how the algorithm renders and displays recognized results, whether images need to be rotated, and how many degrees images are rotated. The flipAxis parameter is an enumeration value, which is defined in QueenEngine and determines whether final rendered images are flipped symmetrically, and whether the flip is along the X-axis or the Y-axis. The preceding parameters are critical for the algorithm that is used to implement facial recognition. The parameters are closely related to the current camera angle and whether the front or rear camera is used. The inputAngle, outAngle, and flipAxis parameters are encapsulated into the utility class QueenCameraHelper.java. You can directly use or adjust the values of these parameters for different applications based on your business requirements.