Package io.agora.rtc2.video
Class VirtualBackgroundSource
java.lang.Object
io.agora.rtc2.video.VirtualBackgroundSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int3: Background blur.static final int1: The background is a solid color(eg: Oxffffff).static final int2: Image source in PNG or JPG format.static final int0: Enable segementation with the captured video frame without replacing the background.static final int4: Video source in MP4, AVI, MKV, FLV format.intThe custom background.static final intblur degree high, blur default, hard to find backgroundstatic final intblur degree low, have few blur effectstatic final intblur degree medium, blur more than level 1intThe degree of blurring applied to the custom background image.intThe type of the custom background image.The local absolute path of the custom background image. -
Constructor Summary
ConstructorsConstructorDescriptionVirtualBackgroundSource(int backgroundSourceType, int color, String source, int blurDegree) -
Method Summary
-
Field Details
-
BACKGROUND_NONE
public static final int BACKGROUND_NONE0: Enable segementation with the captured video frame without replacing the background.- See Also:
-
BACKGROUND_COLOR
public static final int BACKGROUND_COLOR1: The background is a solid color(eg: Oxffffff).- See Also:
-
BACKGROUND_IMG
public static final int BACKGROUND_IMG2: Image source in PNG or JPG format.- See Also:
-
BACKGROUND_BLUR
public static final int BACKGROUND_BLUR3: Background blur. blur your background, not including your body.- See Also:
-
BACKGROUND_VIDEO
public static final int BACKGROUND_VIDEO4: Video source in MP4, AVI, MKV, FLV format.- See Also:
-
BLUR_DEGREE_LOW
public static final int BLUR_DEGREE_LOWblur degree low, have few blur effect- See Also:
-
BLUR_DEGREE_MEDIUM
public static final int BLUR_DEGREE_MEDIUMblur degree medium, blur more than level 1- See Also:
-
BLUR_DEGREE_HIGH
public static final int BLUR_DEGREE_HIGHblur degree high, blur default, hard to find background- See Also:
-
backgroundSourceType
public int backgroundSourceTypeThe custom background. - BACKGROUND_NONE (0): Process the background as alpha data without replacement, only separating the portrait and the background. After setting this value, you can call `startLocalVideoTranscoder` to implement the picture-in-picture effect. - BACKGROUND_COLOR (1): (Default) The background image is a solid color. - BACKGROUND_IMG (2): The background image is a file in PNG or JPG format. - BACKGROUND_BLUR (3): The background is a blurred version of the original background. - BACKGROUND_VIDEO (4): The background is a local video in MP4, AVI, MKV, FLV, or other supported formats. -
color
public int colorThe type of the custom background image. The color of the custom background image. The format is a hexadecimal integer defined by RGB, without the # sign, such as 0xFFB6C1 for light pink. The default value is 0xFFFFFF, which signifies white. The value range is [0x000000, 0xffffff]. If the value is invalid, the SDK replaces the original background image with a white background image. -
source
The local absolute path of the custom background image. Supports PNG, JPG, MP4, AVI, MKV, and FLV formats. If the path is invalid, the SDK will use either the original background image or the solid color image specified by `color`. -
blurDegree
public int blurDegreeThe degree of blurring applied to the custom background image. - BLUR_DEGREE_LOW (1): The degree of blurring applied to the custom background image is low. The user can almost see the background clearly. - BLUR_DEGREE_MEDIUM (2): The degree of blurring applied to the custom background image is medium. It is difficult for the user to recognize details in the background. - BLUR_DEGREE_HIGH (3): The degree of blurring applied to the custom background image is high. The user can barely see any distinguishing features in the background.
-
-
Constructor Details
-
VirtualBackgroundSource
-
VirtualBackgroundSource
public VirtualBackgroundSource()
-