Rate This Document
Findability
Accuracy
Completeness
Readability

Starting a Video Stream Cloud Phone Instance

You can set parameters in the cfct_config file to start video stream cloud phone instances with custom resolutions and frame rates, and set initial video encoding parameters in the default.prop file. If you use an APK to access the video stream cloud phone, you can configure the snapshot resolution in the APK settings.

  1. (Optional) To start video stream cloud phone instances with custom frame rates, modify the frame rate property in the cfct_config file. The default frame rate is 30 fps. 60 fps is also supported when the resolution is 720p or 1080p.
    BUILD_FPS=30
  2. (Optional) To start video stream cloud phone instances with the C2 decoder enabled (applicable to configuration scheme 1), configure ENABLE_AMD_C2_DECODE=1 in the cfct_config file. 1 indicates that the C2 decoder is enabled. 0 (default) and other values indicate that it is disabled. The C2 decoder needs to be enabled or disabled during the initial container startup; dynamic switching is not supported. Built-in cloud phone applications will automatically select the appropriate decoder based on their specific requirements.
    ENABLE_AMD_C2_DECODE=0
  3. To start video stream cloud phone instances with custom initial encoding parameters, snapshot resolutions, and audio and video output formats, perform the following operations:
    1. Decompress DemoVideoEngine.tar.gz to obtain the vendor folder and copy the default.prop file in the folder to the current directory.
      1
      2
      3
      cd /home/kbox_video/
      tar -xvf DemoVideoEngine.tar.gz vendor
      cp vendor/default.prop .
      
    2. Set initial encoding parameters by configuring property fields started with vmi.video.encode in default.prop. For details about the property fields, see Configuration Items in the Startup Script.
    3. Set the snapshot resolution by configuring property fields started with vmi.video.frame in default.prop. For details about the property fields, see Configuration Items in the Startup Script. After changing the resolution, you are advised to change the screen pixel density in the cfct_config file as well to achieve the optimal display effect. Table 1 lists the recommended configurations.
      Table 1 Recommended configurations for different resolutions

      Screen Width (BUILD_WIDTH)

      Screen Density (BUILD_DENSITY)

      360

      120

      480

      160

      720

      320

      1080

      480

      1440

      640

      2160

      960

      After you change the video output resolution (to a resolution different from the configuration at the last startup), the rendering resolution of the AOSP system and apps is changed. In this case, a compatibility issue or rendering problem may occur in some apps. Generally, this problem can be solved by restarting apps. It is recommended that you return to the home screen and clear background apps before changing the resolution.

      Modifications in the default.prop file do not take effect immediately after you start the container. You need to manually restart the container to apply the modifications.

    4. Set the audio and video output formats.

      If you access a video stream cloud phone instance using an APK, configure property fields in default.prop to set video and audio output formats. For details, see Configuration Items in the Startup Script.

  4. Start a video stream cloud phone.
    1
    2
    cd /home/kbox_video/
    ./cfct_video start ${index1} 
    
    ${index1} in the preceding command indicates the ID of the instance to be started. Start a video stream cloud phone whose ID is 1.
    1
    ./cfct_video start 1
    

    During the container startup, errors such as "writing syncT "procError"" and "exec /system/bin/chmod: no such file" may occur. These errors do not affect the functionality and can be ignored.

    To start multiple cloud phone instances, run the following command:

    ./cfct_video start ${start_index} ${end_index}
  5. List video stream cloud phones running on the Docker container runtime.
    1
    docker ps -a
    

    Example command output:

    Make sure that the started container can be found and is in normal state.

  6. Check whether the video stream cloud phone has been successfully started on the Docker container runtime. ${index} indicates the instance ID. For example, in the last column in the command output of 5, the ${index} of android_35 is 35.
    1
    docker exec -it android_${index} sh 
    
    1
    getprop sys.boot_completed
    

    If the value of sys.boot_completed in the output is 1, the startup is successful.