Starting a Video Stream Cloud Phone
- (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.
BUILD_FPS=30
- (Optional) To start video stream cloud instances with different capture and initial encoding parameters, perform the following operations:
- 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 .
- Set capture and encoding parameters. Modify the corresponding properties in the default.prop file, or run the setprop command in the container after the startup to modify the corresponding properties. Table 1 describes the properties.
Table 1 Property fields of the video stream engine Field Name
Field Description
Value Range
Default Value
vmi.video.encodertype
Encoder type.
When this item is set to CPU, 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: CPU (software encoding via CPU)
- 1: VPU (hardware encoding via external hardware)
- 2: GPU (not supported currently)
1
vmi.video.videoframetype
Frame data output format.
- 0: H.264
- 1: YUV (not supported currently)
- 2: RGB (not supported currently)
- 3: H.265 (unavailable if vmi.video.encodertype is set to 0)
0
vmi.video.frame.width
Width of the adaptive resolution. The value must be a multiple of 2.
360 to 1080
720
vmi.video.frame.height
Height of the adaptive resolution. The value must be a multiple of 2.
360 to 2304
1280
vmi.video.frame.density
Pixel density of the adaptive resolution.
240 to 480
320
vmi.video.encode.gopsize
Encoding GOP size.
30 to 3000
30
vmi.video.encode.profile
Encoding profile. (Only main can be used for H.265 encoding.)
- 0: baseline (supported only in H.264 encoding)
- 1: main
- 2: high (supported only in H.264 encoding)
0
vmi.video.encode.bitrate
Encoding bit rate.
1000000 to 10000000
Unit: bit/s
3000000
vmi.video.encode.forcekeyframe
Forced I-frame encoding.
- 0: Disable forced I-frame encoding.
- 1: Forcibly generate an I-frame as the next frame.
0
vmi.video.encode.rcmode
Encoding format.
- 0: average bit rate (ABR) mode (not supported currently)
- 1: constant rate factor (CRF) (not supported currently)
- 2: constant bit rate (CBR) mode
- 3: capped CRF (not supported currently)
2
vmi.video.encode.interpolation
Frame interpolation.
- 0: Disable frame interpolation.
- 1: Enable frame interpolation.
1
vmi.audio.audiotype
Audio output format.
- 0: OPUS
- 1: PCM
0
vmi.audio.encode.sampleinterval
Audio output sampling interval.
- 5: 5 ms (not supported currently)
- 10: 10 ms
- 20: 20 ms (not supported currently)
10
vmi.audio.encode.bitrate
Audio OPUS encoding bit rate (bit/s).
13200 to 512000
192000
vmi.mic.audiotype
Microphone input format.
- 0: OPUS
- 1: PCM
0
- To change the width and height of the adaptive resolution, you are advised to change the pixel density to achieve the optimal display effect. Table 2 lists the recommended configurations.
Table 2 Recommended configurations for different resolutions Screen Width
Screen Density (BUILD_DENSITY)
720
320
1080
480
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.
- Decompress DemoVideoEngine.tar.gz to obtain the vendor folder and copy the default.prop file in the folder to the current directory.
- 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)
- Query video stream cloud phones.
1docker ps -a
Information similar to the following is displayed:

Make sure that the container to be started exists and is in normal state.
- 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.