public class SubtitleTemplate extends AbstractModel
header, skipSign
Constructor and Description |
---|
SubtitleTemplate() |
SubtitleTemplate(SubtitleTemplate source)
NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
|
Modifier and Type | Method and Description |
---|---|
String |
getAlignment()
Get Alignment mode.
|
Float |
getBoardAlpha()
Get Subtitle background transparency.
|
String |
getBoardColor()
Get Board color.
|
Long |
getBoardHeight()
Get Board height.
|
Long |
getBoardWidth()
Get Board width.
|
String |
getBoardY()
Get Subtitle background position on the Y-axis.
|
Float |
getFontAlpha()
Get The text transparency.
|
String |
getFontColor()
Get Font color.
|
String |
getFontSize()
Get Font size.
|
String |
getFontType()
Get Font type.
|
Long |
getLineSpacing()
Get Line spacing.
|
Float |
getOutlineAlpha()
Get Stroke transparency.
|
String |
getOutlineColor()
Get Stroke color.
|
Float |
getOutlineWidth()
Get Stroke width.
|
String |
getPath()
Get The URL of the subtitles to add to the video.
|
Float |
getShadowAlpha()
Get Shadow transparency.
|
String |
getShadowColor()
Get Shadow color.
|
Float |
getShadowWidth()
Get Shadow width.
|
Long |
getStreamIndex()
Get Specifies the subtitle track for embedding subtitles into the video.
|
MediaInputInfo |
getSubtitleFileInput()
Get Input information on the subtitle file to be embedded into the video.
|
String |
getYPos()
Get Subtitle position on the Y-axis.
|
void |
setAlignment(String Alignment)
Set Alignment mode.
|
void |
setBoardAlpha(Float BoardAlpha)
Set Subtitle background transparency.
|
void |
setBoardColor(String BoardColor)
Set Board color.
|
void |
setBoardHeight(Long BoardHeight)
Set Board height.
|
void |
setBoardWidth(Long BoardWidth)
Set Board width.
|
void |
setBoardY(String BoardY)
Set Subtitle background position on the Y-axis.
|
void |
setFontAlpha(Float FontAlpha)
Set The text transparency.
|
void |
setFontColor(String FontColor)
Set Font color.
|
void |
setFontSize(String FontSize)
Set Font size.
|
void |
setFontType(String FontType)
Set Font type.
|
void |
setLineSpacing(Long LineSpacing)
Set Line spacing.
|
void |
setOutlineAlpha(Float OutlineAlpha)
Set Stroke transparency.
|
void |
setOutlineColor(String OutlineColor)
Set Stroke color.
|
void |
setOutlineWidth(Float OutlineWidth)
Set Stroke width.
|
void |
setPath(String Path)
Set The URL of the subtitles to add to the video.
|
void |
setShadowAlpha(Float ShadowAlpha)
Set Shadow transparency.
|
void |
setShadowColor(String ShadowColor)
Set Shadow color.
|
void |
setShadowWidth(Float ShadowWidth)
Set Shadow width.
|
void |
setStreamIndex(Long StreamIndex)
Set Specifies the subtitle track for embedding subtitles into the video.
|
void |
setSubtitleFileInput(MediaInputInfo SubtitleFileInput)
Set Input information on the subtitle file to be embedded into the video.
|
void |
setYPos(String YPos)
Set Subtitle position on the Y-axis.
|
void |
toMap(HashMap<String,String> map,
String prefix)
Internal implementation, normal users should not use it.
|
any, fromJsonString, getBinaryParams, GetHeader, getMultipartRequestParams, getSkipSign, isStream, set, SetHeader, setParamArrayObj, setParamArraySimple, setParamObj, setParamSimple, setSkipSign, toJsonString
public SubtitleTemplate()
public SubtitleTemplate(SubtitleTemplate source)
public String getPath()
public void setPath(String Path)
Path
- The URL of the subtitles to add to the video.
Note: This field may return null, indicating that no valid values can be obtained.public Long getStreamIndex()
public void setStreamIndex(Long StreamIndex)
StreamIndex
- Specifies the subtitle track for embedding subtitles into the video. the Streamindex parameter takes value starting from 0, where 0 indicates usage of the first subtitle track in the source video. if Path is specified, use Path preferentially. either Path or Streamindex should be specified.
-Note: StreamIndex must match the subtitle track index in the source file. for example, if the subtitle track in the source file is stream#0:3, StreamIndex should be 3. otherwise, task processing failed.
Note: This field may return null, indicating that no valid value can be obtained.public MediaInputInfo getSubtitleFileInput()
public void setSubtitleFileInput(MediaInputInfo SubtitleFileInput)
SubtitleFileInput
- Input information on the subtitle file to be embedded into the video. Currently, only subtitle files stored in COS are supported.
Note: This field may return null, indicating that no valid values can be obtained.public String getFontType()
public void setFontType(String FontType)
FontType
- Font type. valid values:.
public String getFontSize()
public void setFontSize(String FontSize)
FontSize
- Font size. Format: Npx, where N is a numerical value. If it is not specified, the font size of the subtitle file applies.
It is 5% of the source video height by default.
Note: This field may return null, indicating that no valid value can be obtained.public String getFontColor()
public void setFontColor(String FontColor)
FontColor
- Font color. Format: 0xRRGGBB. Default value: 0xFFFFFF (white).
Note: This field may return null, indicating that no valid value can be obtained.public Float getFontAlpha()
public void setFontAlpha(Float FontAlpha)
FontAlpha
- The text transparency. Value range: 0-1.
public String getYPos()
public void setYPos(String YPos)
YPos
- Subtitle position on the Y-axis. If this parameter is specified, the built-in coordinates in the subtitle file will be ignored. The pixel and percentage formats are supported.
- Pixel: Npx. Value range of N: [0,4096].
- Percentage: N%. Value range of N: [0,100]. For example, 10% indicates that the subtitle position on the Y-axis is 10% of the video height.
By default, the position is 4% of the source video height.
Note: The origin of the coordinate axes is at the bottom of the central axis of the source video, and the subtitle reference position is at the bottom of the central axis of the subtitles, as shown in the figure below.

Note: This field may return null, indicating that no valid value can be obtained.public String getBoardY()
public void setBoardY(String BoardY)
BoardY
- Subtitle background position on the Y-axis. Pixel and percentage formats are supported.
- Pixel: Npx. Value range of N: [0,4096].
- Percentage: N%. Value range of N: [0,100]. For example, 10% indicates that the subtitle background position on the Y-axis is 10% of the video height.
If this parameter is not specified, the subtitle background is disabled.
Note: The origin of the coordinate axes is at the bottom of the central axis of the source video, and the reference position of the subtitle background is at the bottom of the central axis of the source video, as shown in the figure below.

Note: This field may return null, indicating that no valid value can be obtained.public Long getBoardWidth()
public void setBoardWidth(Long BoardWidth)
BoardWidth
- Board width. Unit: pixels. Value range: [0,4096].
It is 90% of the source video width by default.
Note: This field may return null, indicating that no valid value can be obtained.public Long getBoardHeight()
public void setBoardHeight(Long BoardHeight)
BoardHeight
- Board height. Unit: pixels. Value range: [0,4096].
It is 15% of the source video height by default.
Note: This field may return null, indicating that no valid value can be obtained.public String getBoardColor()
public void setBoardColor(String BoardColor)
BoardColor
- Board color. Format: 0xRRGGBB.
Default value: 0x000000 (black).
Note: This field may return null, indicating that no valid value can be obtained.public Float getBoardAlpha()
public void setBoardAlpha(Float BoardAlpha)
BoardAlpha
- Subtitle background transparency. Value range: [0, 1].
public Float getOutlineWidth()
public void setOutlineWidth(Float OutlineWidth)
OutlineWidth
- Stroke width.
Note: This field may return null, indicating that no valid values can be obtained.public String getOutlineColor()
public void setOutlineColor(String OutlineColor)
OutlineColor
- Stroke color. The value should be a 6-digit hexadecimal RGB value.
Note: This field may return null, indicating that no valid values can be obtained.public Float getOutlineAlpha()
public void setOutlineAlpha(Float OutlineAlpha)
OutlineAlpha
- Stroke transparency. The value should be a positive floating-point number in the range of (0, 1].
Note: This field may return null, indicating that no valid values can be obtained.public Float getShadowWidth()
public void setShadowWidth(Float ShadowWidth)
ShadowWidth
- Shadow width. The value should be a floating-point number in the range of [0, 1000].
Note: This field may return null, indicating that no valid values can be obtained.public String getShadowColor()
public void setShadowColor(String ShadowColor)
ShadowColor
- Shadow color. The value should be a 6-digit hexadecimal RGB value.
Note: This field may return null, indicating that no valid values can be obtained.public Float getShadowAlpha()
public void setShadowAlpha(Float ShadowAlpha)
ShadowAlpha
- Shadow transparency. The value should be a positive floating-point number in the range of (0, 1].
Note: This field may return null, indicating that no valid values can be obtained.public Long getLineSpacing()
public void setLineSpacing(Long LineSpacing)
LineSpacing
- Line spacing. The value should be a positive integer in the range of [0, 1000].
Note: This field may return null, indicating that no valid values can be obtained.public String getAlignment()
public void setAlignment(String Alignment)
Alignment
- Alignment mode. Valid values: top alignment. The top position of subtitles is fixed, while the bottom position changes according to the number of lines. bottom: bottom alignment. The bottom position of subtitles is fixed, while the top position changes according to the number of lines.
Note: This field may return null, indicating that no valid values can be obtained.Copyright © 2025. All rights reserved.