All Products
Search
Document Center

Intelligent Media Management:TargetVideo

Last Updated:Dec 11, 2024
ParameterTypeDescriptionExample
object

The video processing settings.

DisableVideoboolean

Specifies whether to disable video stream generation. Valid values:

  • true: disables video stream generation. No video stream is included in the output file.
  • false: does not disable video stream generation. This is the default value.
false
Streamarray

The index numbers of video streams. If you do not specify this parameter, the first video stream (the one with the smallest index number) is processed. If the array contains an element greater than 100, all video streams are processed.

  • For example, you can set the parameter to [0,1] to process video streams with index numbers 0 and 1, [1] to process only the video stream with the index number 1, or [101] to process all video streams.
Note If you specify an index number but no video stream with the index number is found, the index number is ignored.
integer

The index number of the video stream.

0
TranscodeVideoobject

The video transcoding parameters. If you do not specify this parameter, no video streams are included in the output file.

Note We recommend that you do not use this parameter to disable video stream generation.
Codecstring

The video encoding format. Valid values:

  • copy, h264, h265, and vp9 for the CreateMediaConvert operation. The default value is copy.

    **

    Warning When you set the parameter to copy, the video stream is directly copied into the output file and all other parameters in TranscodeVideo do not take effect. The copy value is commonly used in container format conversion scenarios. You cannot use this value in video merging scenarios.

  • h264 and h265 for the GenerateVideoPlaylist operation. The default value is h264.

h264
PixelFormatstring

The pixel format. By default, the pixel format matches that of the source video. Valid values:

  • yuv420p
  • yuv422p
  • yuv444p
  • yuv420p10le
  • yuv422p10le
  • yuv444p10le
  • yuva420p
Note You can set the parameter to yuva420p only when you call the CreateMediaConvert operation and set the Codec parameter to vp9.
yuv420p
FrameRateOptionstring

The frame rate option. Valid values:

  • fixed: always uses the target frame rate.
  • adaptive: uses the source frame rate when the source frame rate is smaller than the target frame rate.
  • fall: returns a failure if the source frame rate is smaller than the target frame rate.

Default value:

  • fixed for the CreateMediaConvert operation.
  • adaptive for the GenerateVideoPlaylist operation.
Note This parameter must be used in conjunction with the FrameRate parameter.
fixed
FrameRatefloat

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

25
ResolutionOptionstring

The resolution option. Valid values:

  • fixed: always uses the target resolution.
  • adaptive: uses the source resolution when the source resolution is smaller than the target resolution.
  • fall: returns a failure when the source resolution is smaller than the target resolution.

Default value:

  • fixed for the CreateMediaConvert operation.
  • adaptive for the GenerateVideoPlaylist operation.
Note This parameter must be used in conjunction with the Resolution parameter.
fixed
Resolutionstring

The target resolution in WidthxHeight format. By default, the target resolution is the same as the source resolution. You can specify both width and height or only one of them. You can use this parameter together with the AdaptiveResolutionDirection parameter to set both the long edge and short edge or one of them. The value of each edge falls within the range of (0,4096].

  • Example 1: If AdaptiveResolutionDirection is set to false, 1280x720 specifies a width of 1280 pixels and a height of 720 pixels, 1280x specifies a width of 1280 pixels and the same height as the source video, and x720 specifies a height of 720 pixels and the same width as the source video.
  • Example 2: If AdaptiveResolutionDirection is set to true, 1280x720 specifies a long edge of 1280 pixels and a short edge of 720 pixels, 1280x specifies a long edge of 1280 pixels and the same short edge as the source video, and x720 specifies a short edge of 720 pixels and the same long edge as the source video.
Note If the source video contains rotation information, the width, height, long edge, and short edge depend on the frame after rotation, namely, the playback resolution.
640x480
AdaptiveResolutionDirectionboolean

Specifies whether to enable adaptive resolution direction. Valid values:

  • true: enables adaptive resolution direction. The format of the Resolution parameter is LongEdge×ShortEdge. This is the default value.
  • false: disables adaptive resolution direction. The format of the Resolution parameter is Width×Height
true
ScaleTypestring

The resizing mode. Valid values:

  • stretch: forcibly stretches the video based on the specified width and height or long edge and short edge to fill the remaining space. This is the default value.
  • crop: proportionally resizes the video to the minimum resolution outside the rectangular shape based on the specified width and height or long edge and short edge, and crops the parts beyond the rectangular shape from the center.
  • fill: proportionally resizes the video to the maximum resolution within the rectangular shape based on the specified width and height or long edge and short edge and fills the empty space with black from the center.
  • fit: proportionally resizes the video to the maximum resolution within the rectangular shape based on the specified width and height or long edge and short edge.
Note This parameter must be used in conjunction with the Resolution parameter.
crop
Rotationinteger

The degrees to rotate the video clockwise. Valid values:

  • 0 (default)
  • 90
  • 180
  • 270
90
BitrateOptionstring

The video bitrate option. Valid values:

  • fixed: always uses the target bitrate.
  • adaptive: uses the source bitrate when the source bitrate is smaller than the target bitrate.
  • fall: returns a failure when the source bitrate is smaller than the target bitrate.

Default value:

  • fixed for the CreateMediaConvert operation.
  • adaptive for the GenerateVideoPlaylist operation.
Note This parameter must be used in conjunction with the Bitrate parameter.
fixed
Bitrateinteger

The bitrate of the video stream. Unit: bit/s.

Note This parameter and the CRF parameter are mutually exclusive. If you leave both the parameters empty, the CRF parameter with a value of 23 applies.
128000
GOPSizeinteger

The interval between keyframes. Default value: 150.

Note This parameter is not available to the GenerateVideoPlaylist operation.
60
CRFfloat

The constant rate factor (CRF). The value of this parameter falls within the [0,51] range. The greater the value, the poor the quality. We recommend that you specify a value within the [18,38] range. This parameter and the Bitrate parameter are mutually exclusive.

18
BufferSizeinteger

The size of the buffer for decoding when the dynamic bitrate is used. Unit: bit/s.

Note This parameter must be used in conjunction with the CRF parameter.
4000000
MaxBitrateinteger

The maximum bitrate when the dynamic bitrate is used. If you specify this parameter, you must also specify the BufferSize parameter.

Note This parameter must be used in conjunction with the CRF parameter.
128000
BFramesinteger

The number of consecutive B frames. Default value: 3.

3
Refsinteger

The number of reference frames. Default value: 2.

2
FilterVideoobject

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

Note This parameter is not available to the GenerateVideoPlaylist operation.
Watermarksarray<object>

The video watermarks.

object

The information about the watermark.

Typestring

The watermark type. Valid values:

  • text: a text watermark. This is the default value.
  • file: a still or animated image watermark.
text
Dxfloat

The value of the parameter can be an integer or a decimal.

  • 0: indicates that both the offset pixels and the ratio of the horizontal offset relative to the height of the target resolution are 0. This is the default value.
  • An integer: the offset pixels. Valid values: [1,4096].
  • A decimal: the ratio of the horizontal offset relative to the height of the target resolution. Valid values: (0,1).
0
Dyfloat

The value of the parameter can be an integer or a decimal.

  • 0: indicates that both the offset pixels and the ratio of the vertical offset relative to the height of the target resolution are 0. This is the default value.
  • An integer: the offset pixels. Valid values: [1,4096].
  • A decimal: the ratio of the vertical offset relative to the height of the target resolution. Valid values: (0,1).
0
StartTimedouble

The start time of watermarking (in seconds). By default, the watermark begins at the start time of the video.

0
Durationdouble

The duration of the watermark (in seconds). By default, the watermark lasts until the video ends.

0
ReferPosstring

The reference position for adding the watermark. Valid values:

  • topleft: the upper-left corner. This is the default value.
  • topright: the upper-right corner.
  • bottomright: the lower-right corner.
  • bottomleft: the lower-left corner.
topleft
Contentstring

The content of the text watermark. By default, this parameter is left empty.

Note This parameter takes effect only when the Type parameter is set to text.
example
FontNamestring

The font of the text watermark. Valid values:

  • SourceHanSans-Regular (default)
  • SourceHanSans-Bold
  • SourceHanSerif-Regular
  • SourceHanSerif-Bold
Note This parameter takes effect only when the Type parameter is set to text.
SourceHanSans-Bold
FontSizeinteger

The font size of the text watermark. Default value: 16. The value must be an integer within the (4,120) range.

Note This parameter takes effect only when the Type parameter is set to text.
18
FontColorstring

The font color of the text watermark. The color can be specified by using the #RRGGBB format or a color name such as red or green. Default value: #000000.

Note This parameter takes effect only when the Type parameter is set to text.
red
FontAphafloat

The font transparency of the text watermark. Valid values: (0,1]. Default value: 1, which specifies that the text watermark is fully opaque.

Note This parameter takes effect only when the Type parameter is set to text.
0.8
BorderWidthinteger

The width of the text watermark border. Unit: pixels. The value must be an integer within the [0,4096] range. Default value: 0.

Note This parameter takes effect only when the Type parameter is set to text.
2
BorderColorstring

The color of the text watermark border. The color can be specified by using the #RRGGBB format or a color name such as red or green. Default value: #000000.

Note This parameter takes effect only when the Type parameter is set to text.
red
URIstring

The Object Storage Service (OSS) URI of the watermark file. The watermark file can be a PNG or MOV file.

Specify the OSS URI in the oss://<bucket>/<object> format, where <bucket> is the name of the bucket in the same region as the current project and <object> is the path of the object with the extension included.**Note This parameter takes effect only when the Type parameter is set to file.

oss://test-bucket/watermark
Widthfloat

The width of the image watermark. By default, the width is the same as the width of the original watermark file. The value of the parameter can be an integer or a decimal.

  • An integer: the number of pixels excluding the width of the logo. Valid values: [1,4096].
  • A decimal: the ratio relative to the width of the target resolution. Valid values: (0,1).
80
Heightfloat

The height of the image watermark. By default, the height is the same as the height of the original watermark file. The value of the parameter can be an integer or a decimal.

  • An integer: the number of pixels excluding the height of the logo. Valid values: [1,4096].
  • A decimal: the ratio relative to the height of the target resolution. Valid values: (0,1).
40
Delogosarray<object>

The configurations for blurring a rectangular shape of the video. This parameter is used to remove logos from videos, such as TV channel logos.

object

The video blurring parameters.

StartTimedouble

The start time of blurring (in seconds). By default, the blur begins at the start time of the video.

0
Durationdouble

The duration of the blur in seconds. By default, the blur lasts until the end of the video.

15
Dxfloat

The value of the parameter can be an integer or a decimal.

  • 0: indicates that both the offset pixels and the ratio of the horizontal offset relative to the height of the target resolution are 0. This is the default value.
  • An integer: the offset pixels. Valid values: [1,4096].
  • A decimal: the ratio of the horizontal offset relative to the height of the target resolution. Valid values: (0,1).
0
Dyfloat

Default value: 0. The value of the parameter can be an integer or a decimal.

  • 0: indicates that both the offset pixels and the ratio of the vertical offset relative to the height of the target resolution are 0. This is the default value.
  • An integer: the offset pixels. Valid values: [1,4096].
  • A decimal: the ratio of the vertical offset relative to the height of the target resolution. Valid values: (0,1).
0
Widthfloat

The width of the blur. The default value is 1.0, which specifies that the blur is as wide as the video. The value can be a decimal or an integer.

  • An integer: the number of pixels. Valid values: [1,4096].
  • A decimal: the ratio relative to the width of the target resolution. Valid values: (0,1).
100
Heightfloat

The height of the blur. The default value is 1.0, which specifies that the blur is as high as the video. The value can be a decimal or an integer.

  • An integer: the number of pixels. Valid values: [1,4096].
  • A decimal: the ratio relative to the height of the target resolution. Valid values: (0,1).
40
ReferPosstring

The reference position of the blur. Valid values:

  • topleft: the upper-left corner. This is the default value.
  • topright: the upper-right corner.
  • bottomright: the lower-right corner.
  • bottomleft: the lower-left corner.
topleft