Rate This Document
Findability
Accuracy
Completeness
Readability

Starting a Video Stream Cloud Phone

  1. (Optional) To start video stream cloud phones with different resolutions and frame rates, modify the resolution width, height, and frame rate in the cfct_config file. Table 1 describes the configurations.
    Table 1 Resolution and frame rate configuration for various cloud phone specifications

    Cloud Phone Specifications

    Screen Width (BUILD_WIDTH)

    Screen Height (BUILD_HEIGHT)

    Screen Density (BUILD_DENSITY)

    Screen Refresh Frame Rate (BUILD_FPS)

    720p@30 fps

    720

    1280

    320

    30

    720p@60 fps

    720

    1280

    320

    60

    1080p@30 fps

    1080

    1920

    480

    30

    1080p@60 fps

    1080

    1920

    480

    60

    The default values are as follows:

    BUILD_WIDTH=720
    BUILD_HEIGHT=1280
    BUILD_DENSITY=320
    BUILD_FPS=30
  2. (Optional) To start video stream cloud phones with different capture and encoding parameters, 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 the capture and encoding parameters and modify the corresponding properties in default.prop. For details, see Table 2.
      Table 2 Property fields of the capture and encoding parameters of the video stream engine

      Field Name

      Field Description

      Value Range

      Default Value

      ro.vmi.video.capture.format

      Sets the format of captured images. (This item cannot be modified during program running.)

      • 1: YUV (The CPU performs RGB-to-YUV conversion, and an external encoder is used for encoding.)
      • 2: YUV (The GPU performs RGB-to-YUV conversion, and an external encoder is used for encoding.)

      2

      ro.vmi.video.capture.gpu_dev

      Sets the GPU device node for capturing images, which must be the same as the GPU device node for rendering images. (This item cannot be modified during program running.)

      Format: /dev/dri/renderDxxx

      xxx ranges from 128 to 133.

      /dev/dri/renderD128

      persist.vmi.video.capture.interpolation

      Sets the frame interpolation function.

      • 0: Disable the frame interpolation function.
      • 1: Enable the frame interpolation function.

        When the image refresh rate is low (that is, no image is updated within 1/4 seconds), the frame interpolation function is enabled to ensure that the average frame rate of output streams is the same as the frame rate set on the cloud phone.

      1

      persist.vmi.video.encode.bitrate

      Sets the encoding bit rate.

      1000000 to 10000000

      Unit: bit/s

      5000000: The default encoding bit rate is 5 Mbit/s during H.264 encoding.

      3000000: The default encoding bit rate is 3 Mbit/s during H.265 encoding.

      persist.vmi.video.encode.gopsize

      Sets the encoding GOP size.

      30 to 3000

      30

      persist.vmi.video.encode.profile

      Sets the encoding profile. (Only main can be used for H.265 encoding.)

      baseline, main, or high

      baseline: The default encoding profile is baseline during H.264 encoding.

      main: The default encoding profile is main during H.265 encoding.

      persist.vmi.video.encode.param_adjusting

      Sets whether the modifications of encoding parameters take effect.

      The following encoding parameters can be modified during program running:

      • persist.vmi.video.encode.bitrate
      • persist.vmi.video.encode.gopsize
      • persist.vmi.video.encode.profile
      • 0: The modifications of encoding parameters do not take effect at runtime.
      • 1: The modifications of encoding parameters take effect at runtime.

      0

      persist.vmi.video.encode.keyframe

      Sets forced I-frame encoding.

      • 0: Disable forced I-frame encoding.
      • 1: Enable forced I-frame encoding. In the normal encoding phase, after this function is called, the next output frame is an I-frame.

      0

      ro.vmi.demo.video.encode.format

      Sets the encoding format. (This item cannot be modified during program running.)

      When ro.vmi.demo.video.encode.format is set to 0, that is, when software encoding is used, if the cloud phones need to run heavy-load applications, you are advised to change the core binding mode to NUMA to prevent insufficient CPU resources in the default core binding mode (two containers, two cores). The modification method is as follows:

      Change the value of CPU_BIND_MODE in the cfct_config file to 1.

      0: openH264 software encoding

      1: NETINT H.264 hardware encoding

      2: NETINT H.265 hardware encoding

      1

  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.
    1
    docker ps -a
    

    Information similar to the following is displayed:

    Make sure that the container to be started exists 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.
    1
    2
    docker exec -it android_${index} sh 
    getprop sys.boot_completed
    

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