TargetVideo

Updated at:

Parameter

Type

Description

Example

object

Parameter settings for video processing.

DisableVideo

boolean

Specifies whether to disable video stream generation. Valid values:

  • true: Disables video stream generation. The output file will not contain a video stream.

  • false (default): Enables video stream generation.

false

Stream

array

A list of index numbers for the source video streams to process. If you leave this parameter empty (default), the system processes the video stream with the smallest index number (the first video stream). If you set the index number to a value greater than 100, the system processes all video streams.

  • Example: [0,1] processes video streams with index numbers 0 and 1. [1] processes the video stream with index number 1. [101] processes all video streams.

Note

The system only processes video streams with existing index numbers. If a video stream corresponding to an index number does not exist, the system ignores that index number.

integer

The index number of the video stream to process.

0

TranscodeVideo

object

The video transcoding parameters. An empty value disables video processing. The output file will not contain a video stream.

Note

Do not disable video processing by leaving this parameter empty.

Codec

string

The video encoding format. Valid values:

  • For the CreateMediaConvert API: copy (default), h264, h265, and vp9.
    Warning If you set this parameter to copy, the system directly copies the video stream to the output file. In this case, the other parameters under TranscodeVideo are invalid. The copy value cannot be used for video concatenation and is typically used for container format conversion.
  • For the GenerateVideoPlaylist API: h264 (default) and h265.

h264

PixelFormat

string

The pixel format. By default, this is the same as the source video. Valid values:

  • yuv420p

  • yuv422p

  • yuv444p

  • yuv420p10le

  • yuv422p10le

  • yuv444p10le

  • yuva420p

Note

The yuva420p value is available only for the CreateMediaConvert API, and the Codec parameter must be set to vp9.

yuv420p

FrameRateOption

string

The frame rate option. Valid values:

  • fixed: Always uses the specified target video frame rate.

  • adaptive: Uses the source video frame rate if it is lower than the specified target video frame rate.

  • fall: The task fails if the source video frame rate is lower than the specified target video frame rate.

Default value:

  • For the CreateMediaConvert API, the default value is fixed.

  • For the GenerateVideoPlaylist API, the default value is adaptive.

Note

This parameter must be set together with the FrameRate parameter.

fixed

FrameRate

number

The video frame rate. By default, this is the same as the source video.

25

ResolutionOption

string

The resolution option. Valid values:

  • fixed: Always uses the specified target video resolution.

  • adaptive: Uses the source video resolution if its area is smaller than the area of the specified target video resolution.

  • fall: The task fails if the area of the source video resolution is smaller than the area of the specified target video resolution.

Default value:

  • For the CreateMediaConvert API, the default value is fixed.

  • For the GenerateVideoPlaylist API, the default value is adaptive.

Note

This parameter must be set together with the Resolution parameter.

fixed

Resolution

string

The resolution of the output video in the format of width × height. By default, this is the same as the playback resolution of the source video. You can configure both width and height, or only width or height. You can also use this parameter with the AdaptiveResolutionDirection parameter to configure both the long and short edges, or only the long or short edge. The value for a single edge ranges from (0, 4096].

  • Example 1: If AdaptiveResolutionDirection is set to false, 1280x720 sets the width to 1280 and the height to 720. 1280x sets the width to 1280 and keeps the height the same as the source video. x720 sets the height to 720 and keeps the width the same as the source video.

  • Example 2: If AdaptiveResolutionDirection is set to true, 1280x720 sets the long edge to 1280 and the short edge to 720. 1280x sets the long edge to 1280 and keeps the short edge the same as the source video. x720 sets the short edge to 720 and keeps the long edge the same as the source video.

Note

If the source video contains rotation information, the width, height, long edge, and short edge are determined based on the rotated video, which means the playback resolution is used.

640x480

AdaptiveResolutionDirection

boolean

Specifies whether to enable adaptive resolution for long and short edges. Valid values:

  • true: Yes. In this case, the format for the Resolution parameter is long edge × short edge.

  • false (default): No. In this case, the format for the Resolution parameter is width × height.

true

ScaleType

string

The scaling mode. Valid values:

  • stretch (default): Fixes the width and height or the long and short edges, and forces scaling to stretch and fill any blank areas.

  • crop: Scales the video proportionally to the minimum resolution that extends beyond the specified rectangle (defined by width/height or long/short edges), and then center-crops the excess parts.

  • fill: Scales the video proportionally to the maximum resolution that fits within the specified rectangle (defined by width/height or long/short edges), and then center-fills any blank areas with black.

  • fit: Scales the video proportionally to the maximum resolution that fits within the specified rectangle (defined by width/height or long/short edges).

Note

This parameter must be set together with the Resolution parameter.

crop

Rotation

integer

The clockwise rotation angle of the video in degrees. Valid values:

  • 0 (default)

  • 90

  • 180

  • 270

90

BitrateOption

string

The video bitrate option. Valid values:

  • fixed: Always uses the specified target video bitrate.

  • adaptive: Uses the source video bitrate if it is lower than the specified target video bitrate.

  • fall: The task fails if the source video bitrate is lower than the specified target video bitrate.

Default value:

  • For the CreateMediaConvert API, the default value is fixed.

  • For the GenerateVideoPlaylist API, the default value is adaptive.

Note

This parameter must be set together with the Bitrate parameter.

fixed

Bitrate

integer

The video stream bitrate in bits per second (bit/s).

Note

This parameter is mutually exclusive with CRF. If both this parameter and the CRF parameter are empty, the system encodes the video with a CRF value of 23.

128000

GOPSize

integer

The size of the Group of Pictures (GOP) in frames. The default value is 150.

Note

This parameter is not supported by the GenerateVideoPlaylist API.

60

CRF

number

Specifies the Constant Rate Factor (CRF) mode. This parameter is mutually exclusive with Bitrate. The value ranges from 0 to 51. A larger value indicates lower image quality. A value from 18 to 38 is recommended.

18

BufferSize

integer

The size of the decoding buffer for dynamic bitrate, in bits per second (bps).

Note

This parameter is effective only when used with the CRF parameter.

4000000

MaxBitrate

integer

The maximum bitrate limit for dynamic bitrate. When you use this parameter, you must also specify the BufferSize parameter.

Note

This parameter is effective only when used with the CRF parameter.

128000

BFrames

integer

The number of consecutive B-frames. The default value is 3.

3

Refs

integer

The number of reference frames. The default value is 2.

2

VideoSlim

integer

Enables the Narrowband HD mode. Set the value as follows:

0: The default value. Disables the mode.

1: Enables transcoding in Narrowband HD mode.

Note

For best results, use the officially recommended Bitrate or CRF parameters for video transcoding and encoding in Narrowband HD mode.

Important Narrowband HD only supports the h.264/h.265 format, yuv420p, and an 8-bit depth. It does not support transcoding output for multiple target videos or video concatenation. For more information, see Introduction to Narrowband HD.

0

FilterVideo

object

The video processing parameters. This parameter is invalid if TranscodeVideo is empty or if TranscodeVideo.Codec is set to copy.

Note

You cannot set this parameter for the GenerateVideoPlaylist API.

Watermarks

array

A list of video watermarks.

object

The video watermark information.

Type

string

The watermark type. Valid values:

  • text (default): A text watermark.

  • file: An image or animated image watermark.

text

Dx

number

The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • 0 (default): The pixel offset is 0. The ratio of the horizontal offset to the output video width is also 0.

  • Integer: The offset in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the horizontal offset to the output video width. The value ranges from (0, 1).

0

Dy

number

The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • 0 (default): The pixel offset is 0. The ratio of the vertical offset to the output video height is also 0.

  • Integer: The offset in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the vertical offset to the output video height. The value ranges from (0, 1).

0

StartTime

number

The start time for adding the watermark, in seconds (s). By default, the watermark is added from the beginning of the video.

0

Duration

number

The duration for which the watermark is displayed, in seconds (s). By default, the watermark is displayed until the end of the video.

0

ReferPos

string

The reference position for adding the watermark. Valid values:

  • topleft (default): The top-left corner.

  • topright: The top-right corner.

  • bottomright: The bottom-right corner.

  • bottomleft: The bottom-left corner.

topleft

Content

string

The content of the text watermark. The default value is empty.

Important This parameter is effective only when the Type parameter is set to text.

example

FontName

string

The font name for the text watermark. Valid values:

  • SourceHanSans-Regular (default)

  • SourceHanSans-Bold

  • SourceHanSerif-Regular

  • SourceHanSerif-Bold

Important This parameter is effective only when the Type parameter is set to text.

SourceHanSans-Bold

FontSize

integer

The font size for the text watermark. The default value is 16. The value must be an integer in the range (4, 120).

Important This parameter is effective only when the Type parameter is set to text.

18

FontColor

string

The font color of the watermark text. The format is #RRGGBB. The default value is #000000. You can also enter values such as "red" or "green".

Important This parameter is effective only when the Type parameter is set to text.

red

FontApha

number

The font opacity of the text watermark. The value ranges from (0, 1]. The default value is 1, which means fully opaque.

Important This parameter is effective only when the Type parameter is set to text.

0.8

BorderWidth

integer

The outline width for the text watermark, in pixels (px). The value must be an integer from 0 to 4096. The default value is 0.

Important This parameter is effective only when the Type parameter is set to text.

2

BorderColor

string

The outline color of the watermark text. The format is #RRGGBB. The default value is #000000. You can also enter values such as "red" or "green".

Important This parameter is effective only when the Type parameter is set to text.

red

URI

string

The OSS URL of the watermark file. Supported formats are PNG and MOV.

The OSS URL must follow the format oss://<bucket>/<object>, where <bucket> is the name of an OSS bucket in the same region as the current project, and <object> is the full path of the file, including the file name extension.

Important This parameter is effective only when the Type parameter is set to file.

oss://test-bucket/watermark.jpg

Width

number

The width of the watermark image. By default, this is the width of the original watermark image. The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • Integer: The width of the watermark in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the watermark width to the output video width. The value ranges from (0, 1).

80

Height

number

The height of the watermark image. By default, this is the height of the original watermark image. The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • Integer: The height of the watermark in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the watermark height to the output video height. The value ranges from (0, 1).

40

Delogos

array

Blurs a rectangular area of the video to remove logos, station icons, and other elements.

object

The parameters for video blurring.

StartTime

number

The start time for adding the mosaic, in seconds (s). By default, the mosaic is added from the beginning of the video.

0

Duration

number

The duration for which the mosaic is displayed, in seconds (s). By default, the mosaic is displayed until the end of the video.

15

Dx

number

The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • 0 (default): The pixel offset is 0. The ratio of the horizontal offset to the output video width is also 0.

  • Integer: The offset in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the horizontal offset to the output video width. The value ranges from (0, 1).

0

Dy

number

The default value is 0. The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • 0 (default): The pixel offset is 0. The ratio of the vertical offset to the output video height is also 0.

  • Integer: The offset in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the vertical offset to the output video height. The value ranges from (0, 1).

0

Width

number

The width of the mosaic. The default value is the decimal 1.0, which means it fills the entire width of the output video. The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • Integer: The width in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the mosaic width to the output video width. The value ranges from (0, 1).

100

Height

number

The height of the mosaic. The default value is the decimal 1.0, which means it fills the entire height of the output video. The meaning of this parameter varies depending on whether the value is an integer or a decimal:

  • Integer: The height in pixels (px). The value ranges from 1 to 4096.

  • Decimal: The ratio of the mosaic height to the output video height. The value ranges from (0, 1).

40

ReferPos

string

The reference position for adding the mosaic. Valid values:

  • topleft (default): The top-left corner.

  • topright: The top-right corner.

  • bottomright: The bottom-right corner.

  • bottomleft: The bottom-left corner.

topleft

Speed

number

The video playback speed setting. The value ranges from 0.5 to 1.0. The default value is 1.0.

Note
  • This is the ratio of the default playback speed of the transcoded media file to that of the source media file. This is not a high-speed transcoding feature.

Important
  • This parameter applies only to the CreateMediaConvertTask API.

1.0

Desensitization

object

The video desensitization configuration.

Important
  • This parameter applies only to the CreateMediaConvertTask API.

Face

object

The facial desensitization configuration.

Note

This feature is in public preview. If you have any questions, join the DingTalk group for feedback. For the DingTalk group number, see Contact us.

Confidence

number

The confidence threshold for facial recognition. This sets the lower limit for the confidence level. If the confidence level of a detected face is below this threshold, the face is not desensitized.

  • Value range: 0.0 to 1.0.

  • Default value: 0.0 (no confidence filtering).

0.4

MinSize

integer

The minimum face size threshold. This sets the minimum size for a face to be desensitized. If the width or height of a detected face is smaller than this threshold, the face is not desensitized. The unit is pixels. The default value is 0, which means there is no restriction on face size.

0.4

LicensePlate

object

The license plate desensitization configuration.

Note

This feature is in public preview. If you have any questions, join the DingTalk group for feedback. For the DingTalk group number, see Contact us.

Confidence

number

The confidence threshold for license plate recognition. This sets the lower limit for the confidence level. If the confidence level of a detected license plate is below this threshold, the license plate is not desensitized.

  • Value range: 0.0 to 1.0.

  • Default value: 0.0 (no confidence filtering).

0.4

MinSize

integer

The minimum license plate size threshold. This sets the minimum size for a license plate to be desensitized. If the width or height of a detected license plate is smaller than this threshold, the license plate is not desensitized. The unit is pixels. The default value is 0, which means there is no restriction on license plate size.

0.4