From 028df49c8730cc7cb3e555ef54f5805a1bdd3810 Mon Sep 17 00:00:00 2001 From: mikatong Date: Wed, 13 Mar 2024 17:07:10 +0800 Subject: [PATCH 1/2] fix vod doc --- tencentcloud/provider.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index f3dd195c9e..9864dfca68 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -1119,6 +1119,9 @@ Video on Demand(VOD) tencentcloud_vod_image_sprite_template tencentcloud_vod_super_player_config tencentcloud_vod_sub_application + tencentcloud_vod_sample_snapshot_template + tencentcloud_vod_transcode_template + tencentcloud_vod_watermark_template Oceanus Data Source From f400c05a3b524527d2a49e1b56ea3e2512e7c42e Mon Sep 17 00:00:00 2001 From: mikatong Date: Wed, 13 Mar 2024 17:09:52 +0800 Subject: [PATCH 2/2] update doc --- .../vod/resource_tc_vod_transcode_template.go | 2 +- ...vod_sample_snapshot_template.html.markdown | 67 +++++++++++ .../r/vod_transcode_template.html.markdown | 113 ++++++++++++++++++ .../r/vod_watermark_template.html.markdown | 89 ++++++++++++++ website/tencentcloud.erb | 9 ++ 5 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 website/docs/r/vod_sample_snapshot_template.html.markdown create mode 100644 website/docs/r/vod_transcode_template.html.markdown create mode 100644 website/docs/r/vod_watermark_template.html.markdown diff --git a/tencentcloud/services/vod/resource_tc_vod_transcode_template.go b/tencentcloud/services/vod/resource_tc_vod_transcode_template.go index b31795567c..79eb25e0eb 100644 --- a/tencentcloud/services/vod/resource_tc_vod_transcode_template.go +++ b/tencentcloud/services/vod/resource_tc_vod_transcode_template.go @@ -108,7 +108,7 @@ func ResourceTencentCloudVodTranscodeTemplate() *schema.Resource { "vcrf": { Type: schema.TypeInt, Optional: true, - Description: "The video constant rate factor (CRF). Value range: 1-51.If this parameter is specified, CRF encoding will be used and the bitrate parameter will be ignored.If `Codec` is `H.266`, this parameter is required (`28` is recommended).We don’t recommend using this parameter unless you have special requirements.", + Description: "The video constant rate factor (CRF). Value range: 1-51.If this parameter is specified, CRF encoding will be used and the bitrate parameter will be ignored.If `Codec` is `H.266`, this parameter is required (`28` is recommended).We don't recommend using this parameter unless you have special requirements.", }, "gop": { Type: schema.TypeInt, diff --git a/website/docs/r/vod_sample_snapshot_template.html.markdown b/website/docs/r/vod_sample_snapshot_template.html.markdown new file mode 100644 index 0000000000..e4a9b6833c --- /dev/null +++ b/website/docs/r/vod_sample_snapshot_template.html.markdown @@ -0,0 +1,67 @@ +--- +subcategory: "Video on Demand(VOD)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_vod_sample_snapshot_template" +sidebar_current: "docs-tencentcloud-resource-vod_sample_snapshot_template" +description: |- + Provides a resource to create a vod snapshot template +--- + +# tencentcloud_vod_sample_snapshot_template + +Provides a resource to create a vod snapshot template + +## Example Usage + +```hcl +resource "tencentcloud_vod_sub_application" "sub_application" { + name = "snapshotTemplateSubApplication" + status = "On" + description = "this is sub application" +} + +resource "tencentcloud_vod_sample_snapshot_template" "sample_snapshot_template" { + sample_type = "Percent" + sample_interval = 10 + sub_app_id = tonumber(split("#", tencentcloud_vod_sub_application.sub_application.id)[1]) + name = "testSampleSnapshot" + width = 500 + height = 400 + resolution_adaptive = "open" + format = "jpg" + comment = "test sample snopshot" + fill_type = "black" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `sample_interval` - (Required, Int) Sampling interval. If `SampleType` is `Percent`, sampling will be performed at an interval of the specified percentage. If `SampleType` is `Time`, sampling will be performed at the specified time interval in seconds. +* `sample_type` - (Required, String) Sampled screencapturing type. Valid values: Percent: by percent. Time: by time interval. +* `sub_app_id` - (Required, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID. +* `comment` - (Optional, String) Template description. Length limit: 256 characters. +* `fill_type` - (Optional, String) Fill type. Fill refers to the way of processing a screenshot when its aspect ratio is different from that of the source video. The following fill types are supported: stretch: stretch. The screenshot will be stretched frame by frame to match the aspect ratio of the source video, which may make the screenshot shorter or longer; black: fill with black. This option retains the aspect ratio of the source video for the screenshot and fills the unmatched area with black color blocks. white: fill with white. This option retains the aspect ratio of the source video for the screenshot and fills the unmatched area with white color blocks. gauss: fill with Gaussian blur. This option retains the aspect ratio of the source video for the screenshot and fills the unmatched area with Gaussian blur.Default value: black. +* `format` - (Optional, String) Image format. Valid values: jpg, png. Default value: jpg. +* `height` - (Optional, Int) Maximum value of the height (or short side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `Width` and `Height` are 0, the resolution will be the same as that of the source video; If `Width` is 0, but `Height` is not 0, `Width` will be proportionally scaled; If `Width` is not 0, but `Height` is 0, `Height` will be proportionally scaled; If both `Width` and `Height` are not 0, the custom resolution will be used.Default value: 0. +* `name` - (Optional, String) Name of a sampled screencapturing template. Length limit: 64 characters. +* `resolution_adaptive` - (Optional, String) Resolution adaption. Valid values: open: enabled. In this case, `Width` represents the long side of a video, while `Height` the short side; close: disabled. In this case, `Width` represents the width of a video, while `Height` the height.Default value: open. +* `width` - (Optional, Int) Maximum value of the width (or long side) of a screenshot in px. Value range: 0 and [128, 4,096]. If both `Width` and `Height` are 0, the resolution will be the same as that of the source video; If `Width` is 0, but `Height` is not 0, `Width` will be proportionally scaled; If `Width` is not 0, but `Height` is 0, `Height` will be proportionally scaled; If both `Width` and `Height` are not 0, the custom resolution will be used.Default value: 0. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +vod snapshot template can be imported using the id, e.g. + +``` +terraform import tencentcloud_vod_sample_snapshot_template.sample_snapshot_template $subAppId#$templateId +``` + diff --git a/website/docs/r/vod_transcode_template.html.markdown b/website/docs/r/vod_transcode_template.html.markdown new file mode 100644 index 0000000000..c01b23ffcb --- /dev/null +++ b/website/docs/r/vod_transcode_template.html.markdown @@ -0,0 +1,113 @@ +--- +subcategory: "Video on Demand(VOD)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_vod_transcode_template" +sidebar_current: "docs-tencentcloud-resource-vod_transcode_template" +description: |- + Provides a resource to create a vod transcode template +--- + +# tencentcloud_vod_transcode_template + +Provides a resource to create a vod transcode template + +## Example Usage + +```hcl +resource "tencentcloud_vod_sub_application" "sub_application" { + name = "transcodeTemplateSubApplication" + status = "On" + description = "this is sub application" +} + +resource "tencentcloud_vod_transcode_template" "transcode_template" { + container = "mp4" + sub_app_id = tonumber(split("#", tencentcloud_vod_sub_application.sub_application.id)[1]) + name = "720pTranscodeTemplate" + comment = "test transcode mp4 720p" + remove_video = 0 + remove_audio = 0 + video_template { + codec = "libx264" + fps = 26 + bitrate = 1000 + resolution_adaptive = "open" + width = 0 + height = 720 + fill_type = "stretch" + vcrf = 1 + gop = 250 + preserve_hdr_switch = "OFF" + codec_tag = "hvc1" + + } + audio_template { + codec = "libfdk_aac" + bitrate = 128 + sample_rate = 44100 + audio_channel = 2 + } + segment_type = "ts" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `container` - (Required, String) The container format. Valid values: `mp4`, `flv`, `hls`, `mp3`, `flac`, `ogg`, `m4a`, `wav` ( `mp3`, `flac`, `ogg`, `m4a`, and `wav` are audio file formats). +* `audio_template` - (Optional, List) Audio stream configuration parameter. This field is required when `RemoveAudio` is 0. +* `comment` - (Optional, String) Template description. Length limit: 256 characters. +* `name` - (Optional, String) Transcoding template name. Length limit: 64 characters. +* `remove_audio` - (Optional, Int) Whether to remove audio data. Valid values:0: retain 1: remove Default value: 0. +* `remove_video` - (Optional, Int) Whether to remove video data. Valid values: +- 0: retain +- 1: remove +Default value: 0. +* `segment_type` - (Optional, String) The segment type. This parameter is valid only if `Container` is `hls`. Valid values: `ts`: TS segment; `fmp4`: fMP4 segment Default: `ts`. +* `sub_app_id` - (Optional, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID. +* `tehd_config` - (Optional, List) TESHD transcoding parameter. +* `video_template` - (Optional, List) Video stream configuration parameter. This field is required when `RemoveVideo` is 0. + +The `audio_template` object supports the following: + +* `bitrate` - (Required, Int) Audio stream bitrate in Kbps. Value range: 0 and [26, 256].If the value is 0, the bitrate of the audio stream will be the same as that of the original audio. +* `codec` - (Required, String) The audio codec.If `Container` is `mp3`, the valid value is:`libmp3lame`If `Container` is `ogg` or `flac`, the valid value is:`flac`If `Container` is `m4a`, the valid values are:`libfdk_aac``libmp3lame``ac3`If `Container` is `mp4` or `flv`, the valid values are:`libfdk_aac` (Recommended for MP4)`libmp3lame` (Recommended for FLV)`mp2`If `Container` is `hls`, the valid value is:`libfdk_aac`If `Format` is `HLS` or `MPEG-DASH`, the valid value is:`libfdk_aac`If `Container` is `wav`, the valid value is:`pcm16`. +* `sample_rate` - (Required, Int) The audio sample rate. Valid values:`16000` (valid only if `Codec` is `pcm16`)`32000``44100``48000`Unit: Hz. +* `audio_channel` - (Optional, Int) Audio channel system. Valid values:1: mono-channel2: dual-channel6: stereoYou cannot set the sound channel as stereo for media files in container formats for audios (FLAC, OGG, MP3, M4A).Default value: 2. + +The `tehd_config` object supports the following: + +* `type` - (Required, String) TESHD transcoding type. Valid values: TEHD-100, OFF (default). +* `max_video_bitrate` - (Optional, Int) Maximum bitrate, which is valid when `Type` is `TESHD`.If this parameter is left blank or 0 is entered, there will be no upper limit for bitrate. + +The `video_template` object supports the following: + +* `bitrate` - (Required, Int) Bitrate of video stream in Kbps. Value range: 0 and [128, 35,000].If the value is 0, the bitrate of the video will be the same as that of the source video. +* `codec` - (Required, String) The video codec. Valid values:libx264: H.264; libx265: H.265; av1: AOMedia Video 1; H.266: H.266. The AOMedia Video 1 and H.266 codecs can only be used for MP4 files. Only CRF is supported for H.266 currently. +* `fps` - (Required, Int) Video frame rate in Hz. Value range: [0,100].If the value is 0, the frame rate will be the same as that of the source video. +* `codec_tag` - (Optional, String) The codec tag. This parameter is valid only if the H.265 codec is used. Valid values:hvc1hev1Default value: hvc1. +* `fill_type` - (Optional, String) Fill type, the way of processing a screenshot when the configured aspect ratio is different from that of the source video. Valid values:stretch: stretches the video image frame by frame to fill the screen. The video image may become squashed or stretched after transcoding.black: fills the uncovered area with black color, without changing the image's aspect ratio.white: fills the uncovered area with white color, without changing the image's aspect ratio.gauss: applies Gaussian blur to the uncovered area, without changing the image's aspect ratio.Default value: black. +* `gop` - (Optional, Int) I-frame interval in frames. Valid values: 0 and 1-100000.When this parameter is set to 0 or left empty, `Gop` will be automatically set. +* `height` - (Optional, Int) The maximum video height (or short side) in pixels. Value range: 0 and [128, 8192].If both `Width` and `Height` are 0, the output resolution will be the same as that of the source video.If `Width` is 0 and `Height` is not, the video width will be proportionally scaled.If `Width` is not 0 and `Height` is, the video height will be proportionally scaled.If neither `Width` nor `Height` is 0, the specified width and height will be used.Default value: 0. +* `preserve_hdr_switch` - (Optional, String) Whether to output an HDR (high dynamic range) video if the source video is HDR. Valid values:ON: If the source video is HDR, output an HDR video; if not, output an SDR (standard dynamic range) video.OFF: Output an SDR video regardless of whether the source video is HDR.Default value: OFF. +* `resolution_adaptive` - (Optional, String) Resolution adaption. Valid values:open: enabled. In this case, `Width` represents the long side of a video, while `Height` the short side;close: disabled. In this case, `Width` represents the width of a video, while `Height` the height.Default value: open.Note: this field may return null, indicating that no valid values can be obtained. +* `vcrf` - (Optional, Int) The video constant rate factor (CRF). Value range: 1-51.If this parameter is specified, CRF encoding will be used and the bitrate parameter will be ignored.If `Codec` is `H.266`, this parameter is required (`28` is recommended).We don't recommend using this parameter unless you have special requirements. +* `width` - (Optional, Int) The maximum video width (or long side) in pixels. Value range: 0 and [128, 8192].If both `Width` and `Height` are 0, the output resolution will be the same as that of the source video.If `Width` is 0 and `Height` is not, the video width will be proportionally scaled.If `Width` is not 0 and `Height` is, the video height will be proportionally scaled.If neither `Width` nor `Height` is 0, the specified width and height will be used.Default value: 0. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +vod transcode template can be imported using the id, e.g. + +``` +terraform import tencentcloud_vod_transcode_template.transcode_template $subAppId#$templateId +``` + diff --git a/website/docs/r/vod_watermark_template.html.markdown b/website/docs/r/vod_watermark_template.html.markdown new file mode 100644 index 0000000000..b315a2b4ce --- /dev/null +++ b/website/docs/r/vod_watermark_template.html.markdown @@ -0,0 +1,89 @@ +--- +subcategory: "Video on Demand(VOD)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_vod_watermark_template" +sidebar_current: "docs-tencentcloud-resource-vod_watermark_template" +description: |- + Provides a resource to create a vod watermark template +--- + +# tencentcloud_vod_watermark_template + +Provides a resource to create a vod watermark template + +## Example Usage + +```hcl +resource "tencentcloud_vod_sub_application" "sub_application" { + name = "watermarkTemplateSubApplication" + status = "On" + description = "this is sub application" +} + +resource "tencentcloud_vod_watermark_template" "watermark_template" { + type = "image" + sub_app_id = tonumber(split("#", tencentcloud_vod_sub_application.sub_application.id)[1]) + name = "myImageWatermark" + comment = "a png watermark" + coordinate_origin = "TopLeft" + x_pos = "10%" + y_pos = "10%" + image_template { + image_content = filebase64("xxx.png") + width = "10%" + height = "10px" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `sub_app_id` - (Required, Int) The VOD [application](https://intl.cloud.tencent.com/document/product/266/14574) ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID. +* `type` - (Required, String) Watermarking type. Valid values: image: image watermark; text: text watermark; svg: SVG watermark. +* `comment` - (Optional, String) Template description. Length limit: 256 characters. +* `coordinate_origin` - (Optional, String) Origin position. Valid values: TopLeft: the origin of coordinates is in the top-left corner of the video, and the origin of the watermark is in the top-left corner of the image or text; TopRight: the origin of coordinates is in the top-right corner of the video, and the origin of the watermark is in the top-right corner of the image or text; BottomLeft: the origin of coordinates is in the bottom-left corner of the video, and the origin of the watermark is in the bottom-left corner of the image or text; BottomRight: the origin of coordinates is in the bottom-right corner of the video, and the origin of the watermark is in the bottom-right corner of the image or text.Default value: TopLeft. +* `image_template` - (Optional, List) Image watermarking template. This field is required when `Type` is `image` and is invalid when `Type` is `text`. +* `name` - (Optional, String) Watermarking template name. Length limit: 64 characters. +* `svg_template` - (Optional, List) SVG watermarking template. This field is required when `Type` is `svg` and is invalid when `Type` is `image` or `text`. +* `text_template` - (Optional, List) Text watermarking template. This field is required when `Type` is `text` and is invalid when `Type` is `image`. +* `x_pos` - (Optional, String) The horizontal position of the origin of the watermark relative to the origin of coordinates of the video. % and px formats are supported: If the string ends in %, the `XPos` of the watermark will be the specified percentage of the video width; for example, `10%` means that `XPos` is 10% of the video width; If the string ends in px, the `XPos` of the watermark will be the specified px; for example, `100px` means that `XPos` is 100 px.Default value: 0 px. +* `y_pos` - (Optional, String) The vertical position of the origin of the watermark relative to the origin of coordinates of the video. % and px formats are supported: If the string ends in %, the `YPos` of the watermark will be the specified percentage of the video height; for example, `10%` means that `YPos` is 10% of the video height; If the string ends in px, the `YPos` of the watermark will be the specified px; for example, `100px` means that `YPos` is 100 px.Default value: 0 px. + +The `image_template` object supports the following: + +* `image_content` - (Required, String) The [Base64](https://tools.ietf.org/html/rfc4648) encoded string of a watermark image. Only JPEG, PNG, and GIF images are supported. +* `height` - (Optional, String) Watermark height. % and px formats are supported: If the string ends in %, the `Height` of the watermark will be the specified percentage of the video height; for example, `10%` means that `Height` is 10% of the video height; If the string ends in px, the `Height` of the watermark will be in px; for example, `100px` means that `Height` is 100 px. Valid values: 0 or [8,4096]. Default value: 0 px, which means that `Height` will be proportionally scaled according to the aspect ratio of the original watermark image. +* `repeat_type` - (Optional, String) Repeat type of an animated watermark. Valid values: once: no longer appears after watermark playback ends. repeat_last_frame: stays on the last frame after watermark playback ends. repeat (default): repeats the playback until the video ends. +* `transparency` - (Optional, Int) Image watermark transparency: 0: completely opaque 100: completely transparent Default value: 0. +* `width` - (Optional, String) Watermark width. % and px formats are supported: If the string ends in %, the `Width` of the watermark will be the specified percentage of the video width. For example, `10%` means that `Width` is 10% of the video width; If the string ends in px, the `Width` of the watermark will be in pixels. For example, `100px` means that `Width` is 100 pixels. Value range: [8, 4096]. Default value: 10%. + +The `svg_template` object supports the following: + +* `height` - (Optional, String) Watermark height, which supports six formats of px, %, W%, H%, S%, and L%: If the string ends in px, the `Height` of the watermark will be in px; for example, `100px` means that `Height` is 100 px; if `0px` is entered and `Width` is not `0px`, the watermark height will be proportionally scaled based on the source SVG image; if `0px` is entered for both `Width` and `Height`, the watermark height will be the height of the source SVG image; If the string ends in `W%`, the `Height` of the watermark will be the specified percentage of the video width; for example, `10W%` means that `Height` is 10% of the video width; If the string ends in `H%`, the `Height` of the watermark will be the specified percentage of the video height; for example, `10H%` means that `Height` is 10% of the video height; If the string ends in `S%`, the `Height` of the watermark will be the specified percentage of the short side of the video; for example, `10S%` means that `Height` is 10% of the short side of the video; If the string ends in `L%`, the `Height` of the watermark will be the specified percentage of the long side of the video; for example, `10L%` means that `Height` is 10% of the long side of the video; If the string ends in %, the meaning is the same as `H%`. Default value: 0 px. +* `width` - (Optional, String) Watermark width, which supports six formats of px, %, W%, H%, S%, and L%: If the string ends in px, the `Width` of the watermark will be in px; for example, `100px` means that `Width` is 100 px; if `0px` is entered and `Height` is not `0px`, the watermark width will be proportionally scaled based on the source SVG image; if `0px` is entered for both `Width` and `Height`, the watermark width will be the width of the source SVG image; If the string ends in `W%`, the `Width` of the watermark will be the specified percentage of the video width; for example, `10W%` means that `Width` is 10% of the video width; If the string ends in `H%`, the `Width` of the watermark will be the specified percentage of the video height; for example, `10H%` means that `Width` is 10% of the video height; If the string ends in `S%`, the `Width` of the watermark will be the specified percentage of the short side of the video; for example, `10S%` means that `Width` is 10% of the short side of the video; If the string ends in `L%`, the `Width` of the watermark will be the specified percentage of the long side of the video; for example, `10L%` means that `Width` is 10% of the long side of the video; If the string ends in %, the meaning is the same as `W%`. Default value: 10W%. + +The `text_template` object supports the following: + +* `font_alpha` - (Required, Float64) Text transparency. Value range: (0, 1] 0: completely transparent 1: completely opaque Default value: 1. +* `font_color` - (Required, String) Font color in 0xRRGGBB format. Default value: 0xFFFFFF (white). +* `font_size` - (Required, String) Font size in Npx format where N is a numeric value. +* `font_type` - (Required, String) Font type. Currently, two types are supported: simkai.ttf: both Chinese and English are supported; arial.ttf: only English is supported. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +vod watermark template can be imported using the id, e.g. + +``` +terraform import tencentcloud_vod_watermark_template.watermark_template $subAppId#$templateId +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index f80e80ab70..2f22f3b363 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -5860,6 +5860,9 @@
  • tencentcloud_vod_procedure_template
  • +
  • + tencentcloud_vod_sample_snapshot_template +
  • tencentcloud_vod_snapshot_by_time_offset_template
  • @@ -5869,6 +5872,12 @@
  • tencentcloud_vod_super_player_config
  • +
  • + tencentcloud_vod_transcode_template +
  • +
  • + tencentcloud_vod_watermark_template +