Rate This Document
Findability
Accuracy
Completeness
Readability

Starting a Video Stream Cloud Phone

You can set parameters in the cfct_config file to start video stream cloud phone instances with different resolution and frame rates, and set the initial video encoding parameters in the default.prop file. If WebRTC is used for data transmission, you can modify the default.prop file to change the snapshot resolution; and 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 different 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 different network connection modes, initial encoding parameters, and snapshot resolution, 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 "Configurable Non-commercial Module Properties of the Video Stream Engine" > "Video Stream Engine Property Configuration Items" in Video Stream Engine Developer Guide.
    3. Set the snapshot resolution.
      If you access the video stream cloud phone instance over WebRTC, configure property fields started with vmi.video.frame in default.prop. For details about the property fields, see "Configurable Non-commercial Module Properties of the Video Stream Engine" > "Video Stream Engine Property Configuration Items" in Video Stream Engine Developer Guide. You can also run the setprop command in the container after starting the cloud phone to change property settings. 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)

      720

      320

      1080

      480

      1440

      640

      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 the app. It is recommended that you return to the home screen and clear background apps before changing the resolution.

    4. Set the audio and video output formats.

      If you access the video stream cloud phone instance over WebRTC, configure corresponding property fields in default.prop to set video and audio output formats. For details about the property fields to be configured, see "Configurable Non-commercial Module Properties of the Video Stream Engine" > "WebRTC Configuration Items" in Video Stream Engine Developer Guide.

    5. Enable the adaptive resolution function.

      If you access the video stream cloud phone instance using an APK, you can enable the adaptive resolution function on the APK settings page. For details, see Using an APK. If adaptive resolution is disabled, configure property fields started with vmi.video.frame in default.prop to change the snapshot resolution. For details about the property fields, see "Configurable Non-commercial Module Properties of the Video Stream Engine" > "Video Stream Engine Property Configuration Items" in Video Stream Engine Developer Guide. 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.

  3. Start a video stream cloud phone.
    1
    2
    cd /home/kbox_video/
    ./cfct_video start ${index1} ${index2}
    

    In the preceding command, ${index1} and ${index2} indicate instance IDs, and ${index2} can be left blank.

    Example: ./cfct_video start 2 (Start instance 2.)

    ./cfct_video start 2 5 (Start instances 2 to 5)

  4. Query video stream cloud phones.
    • Video stream cloud phone with Docker:
      1
      docker ps -a
      

      Example command output:

    • Video stream cloud phone with containerd:
      1
      nerdctl ps -a
      

      Example command output:

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

  5. Check whether the video stream cloud phone is successfully started. ${index} indicates the ID of the instance to be started. For example, in the last column in the command output of 4, the ${index} of android_35 is 35.
    • Video stream cloud phone with Docker:
      1
      docker exec -it android_${index} sh 
      
    • Video stream cloud phone with containerd:
      1
      nerdctl 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.