Domain name for API request: vod.tencentcloudapi.com.
This API is used to edit a video (by clipping, splicing, etc.) to generate a new VOD video. Editing features include:
You can also specify whether to perform a task flow for the generated new video.
A maximum of 100 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
This document describes the parameters for Signature V1. It's recommended to use the V3 signature, which provides higher security. Note that for Signature V3, the common parameters need to be placed in the HTTP Header. See details.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: EditMedia. |
Version | Yes | String | Common parameter. The value used for this API: 2018-07-17. |
Region | No | String | Common parameter. This parameter is not required for this API. |
InputType | Yes | String | Input video type. Valid values: File, Stream. |
FileInfos.N | No | Array of EditMediaFileInfo | Information of input video file, which is required if InputType is File . |
StreamInfos.N | No | Array of EditMediaStreamInfo | Input stream information, which is required if InputType is Stream . |
Definition | No | Integer | Editing template ID. Valid values: 10, 20. If this parameter is left empty, template 10 will be used. |
ProcedureName | No | String | Task flow template name, which should be entered if you want to perform a task flow on the generated new video. |
OutputConfig | No | EditMediaOutputConfig | Configuration of file generated after editing. |
SessionContext | No | String | Identifies the source context which is used to pass through the user request information. The EditMediaComplete callback and task flow status change callback will return the value of this field. It can contain up to 1,000 characters. |
TasksPriority | No | Integer | Task priority. The higher the value, the higher the priority. Value range: -10-10. If this parameter is left empty, 0 will be used. |
SessionId | No | String | Used to identify duplicate requests. After you send a request, if any request with the same SessionId has already been sent in the last three days (72 hours), an error message will be returned. SessionId contains up to 50 characters. If this parameter is not carried or is an empty string, no deduplication will be performed. |
ExtInfo | No | String | Reserved field for special purposes. |
SubAppId | No | Integer | Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty. |
Parameter Name | Type | Description |
---|---|---|
TaskId | String | Video editing task ID, which can be used to query the status of editing task (with task type being EditMedia ). |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to clip the 60th to 120th seconds of video 5285485487985271487
to generate a new VOD video.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=File
&FileInfos.0.FileId=5285485487985271487
&FileInfos.0.StartTimeOffset=60.0
&FileInfos.0.EndTimeOffset=120.0
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-EditMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
This example shows you how to splice three LVB recording streams whose IDs are 99873, 99874, and 99875 to generate a new VOD video.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=Stream
&StreamInfos.0.StreamId=99873
&StreamInfos.1.StreamId=99874
&StreamInfos.2.StreamId=99875
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-clipMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
This example shows you how to clip the segment between 10:00:00 and 11:00:00 on September 20, 2018 of the LVB recording stream whose ID is 99873 to generate a new VOD video.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=Stream
&StreamInfos.0.StreamId=99873
&StreamInfos.0.StartTime=2018-09-20T10:00:00Z
&StreamInfos.0.StartTime=2018-09-20T11:00:00Z
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-clipMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
This example shows you how to generate a new VOD video from LVB recording stream whose ID is 99873.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=Stream
&StreamInfos.0.StreamId=99873
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-EditMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
This example shows you how to clip the 60th to 120th seconds of videos 5285485487985271487
, 5285485487985271488
, and 5285485487985271489
respectively and splice the clips to generate a new VOD video.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=File
&FileInfos.0.FileId=5285485487985271487
&FileInfos.0.StartTimeOffset=60.0
&FileInfos.0.EndTimeOffset=120.0
&FileInfos.1.FileId=5285485487985271488
&FileInfos.1.StartTimeOffset=60.0
&FileInfos.1.EndTimeOffset=120.0
&FileInfos.2.FileId=5285485487985271489
&FileInfos.2.StartTimeOffset=60.0
&FileInfos.2.EndTimeOffset=120.0
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-EditMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
This example shows you how to clip the 60th to 120th seconds of video 5285485487985271487
to generate a new VOD video and run task flow TranscodeAndSnapshot
.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=File
&FileInfos.0.FileId=5285485487985271487
&FileInfos.0.StartTimeOffset=60.0
&FileInfos.0.EndTimeOffset=120.0
&ProcedureName=TranscodeAndSnapshot
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-clipMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
This example shows you how to clip the segments between 10:00:00 and 11:00:00 on September 20, 2018 of three LVB recording streams whose IDs are 99873, 99874, and 99875 and splice them to generate a new VOD video.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=Stream
&StreamInfos.0.StreamId=99873
&StreamInfos.0.StartTime=2018-09-20T10:00:00Z
&StreamInfos.0.StartTime=2018-09-20T11:00:00Z
&StreamInfos.1.StreamId=99874
&StreamInfos.1.StartTime=2018-09-20T10:00:00Z
&StreamInfos.1.StartTime=2018-09-20T11:00:00Z
&StreamInfos.2.StreamId=99875
&StreamInfos.2.StartTime=2018-09-20T10:00:00Z
&StreamInfos.2.StartTime=2018-09-20T11:00:00Z
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-clipMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
This example shows you how to splice videos 5285485487985271487
, 5285485487985271488
, and 5285485487985271489
to generate a new VOD video.
https://vod.tencentcloudapi.com/?Action=EditMedia
&InputType=File
&FileInfos.0.FileId=5285485487985271487
&FileInfos.1.FileId=5285485487985271488
&FileInfos.2.FileId=5285485487985271489
&<Common request parameters>
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"TaskId": "125xxx65-EditMedia-bffb15f07530b57bc1aabb01fac74bca"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
FailedOperation | Operation failed. |
FailedOperation.InvalidVodUser | The VOD service is not activated. |
InternalError | Internal error. |
InvalidParameterValue.SessionContextTooLong | SessionContext is too long. |
InvalidParameterValue.SessionId | The deduplication ID already exists. The request is removed due to duplication. |
InvalidParameterValue.SessionIdTooLong | SessionId is too long. |
InvalidParameterValue.SubAppId | Incorrect parameter value: subapplication ID |
ResourceNotFound | The resource does not exist. |
UnauthorizedOperation | Unauthorized operation. |
本页内容是否解决了您的问题?