Domain name for API request: vod.tencentcloudapi.com.
Live broadcast real-time editing means that during the live broadcast process (that is, before the live broadcast has ended), customers can select a section of past live broadcast content to generate a new video (HLS format) in real time. Developers can share it immediately, or permanently Save it.
Tencent Cloud VOD supports two real-time editing modes:
Notice:
Clip solidification means saving the clipped video into an independent video (with an independent FileId). Its life cycle is not affected by the original live broadcast recording video (even if the original recording video is deleted, the editing results will not be affected in any way); it can also be subjected to secondary processing such as transcoding.
For example: for a complete football match, the original video recorded live may be as long as 2 hours. To save costs, the customer can store this video for 2 months, but for the "highlight moment" video that is edited in real time during the live broadcast However, you can specify a longer storage period, and at the same time, you can separately transcode the "highlight moments" video and other on-demand operations. At this time, you can choose the solution of real-time editing and solidification of the live broadcast.
The advantage of editing and curing is that its life cycle is independent of the original recorded video, and can be managed independently and stored for a long time.
Notice: If solidification is specified during clipping, enable the reception of persistence completed event notifications through the ModifyEventConfig interface. After successful solidification, an event notification of type PersistenceComplete will be received. Before receiving this event notification, operations such as deletion or cooling down of live recording videos should not be performed, otherwise, abnormal playback may occur in the video generated by the clipping.
The editing is not solidified, which means that the result of editing (m3u8 file) and the live recording video share the same ts fragment. The newly generated video is not an independent and complete video (no independent FileId, only playback URL), and its validity period is the same as the live broadcast. The validity period of the complete recorded video is the same. Once the video recorded during the live broadcast is deleted, the clip will also become unplayable.
The clip is not solidified. Because the clip result is not an independent video, it will not be included in on-demand media asset video management (for example, the total number of videos in the console will not count this clip), and this clip cannot be transcoded separately. Video processing operations.
The advantage of not solidifying editing is that its editing operation is very "lightweight" and does not generate additional storage overhead. However, its disadvantage is that the life cycle is the same as the original recorded video, and further video processing such as transcoding cannot be performed.
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.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: LiveRealTimeClip. |
Version | Yes | String | Common Params. The value used for this API: 2018-07-17. |
Region | No | String | Common Params. This parameter is not required. |
StreamId | Yes | String | The live stream code. |
StartTime | Yes | String | Start time of stream clipping in ISO date format. |
EndTime | Yes | String | End time of stream clipping in ISO date format. |
SubAppId | No | Integer | The VOD application 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. |
IsPersistence | No | Integer | Whether to clip persistently. 0: no, 1: yes. Default: no. |
ExpireTime | No | String | Storage expiration time of video generated by persistent clipping in ISO date format. 9999-12-31T23:59:59Z means never expire . After the expiration, the media file and its related resources (such as transcoding results and image sprites) will be permanently deleted. This parameter will be valid only when IsPersistence is 1. By default, the video will never expire. |
Procedure | No | String | VOD task flow processing for video generated by persistent clipping. For more information, please see Specifying Task Flow After Upload. This parameter will be valid only when IsPersistence is 1. |
ClassId | No | Integer | The ID of the media file's category. You can use the CreateClass API to create a category and get the category ID.0 , which means the "Other" category.This parameter is valid only if IsPersistence is 1 . |
SourceContext | No | String | The source context, which is used to pass through user request information. The NewFileUpload callback will return the value of this parameter. It can contain up to 250 characters and is valid only if IsPersistence is 1 . |
SessionContext | No | String | The session context, which is used to pass through user request information. If the Procedure parameter is specified, the ProcedureStateChanged callback will return the value of this parameter. It can contain up to 1,000 characters and is valid only if IsPersistence is 1 . |
MetaDataRequired | No | Integer | Whether the metadata of clipped video needs to be returned. 0: no, 1: yes. Default value: no. |
Host | No | String | Domain name used for live clipping. Time shifting must be enabled in LVB. |
StreamInfo | No | LiveRealTimeClipStreamInfo | The information of the live stream to clip.Type of StreamInfo is set to Transcoding , the video clip will be cut from the output stream of the transcoding template specified by TemplateId . |
ExtInfo | No | String | Reserved field. Do not enter a value for it. |
Parameter Name | Type | Description |
---|---|---|
Url | String | Playback URL of clipped video. |
FileId | String | Unique media file ID of video generated by persistent clipping. Note: this field may return null, indicating that no valid values can be obtained. |
VodTaskId | String | Task flow ID of video generated by persistent clipping. Note: this field may return null, indicating that no valid values can be obtained. |
MetaData | MediaMetaData | Note: This field may return null, indicating that no valid value can be obtained. |
SegmentSet | Array of LiveRealTimeClipMediaSegmentInfo | Cliped media segment info. |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to cut out a video clip from a live stream (live stream code: record-stream; domain name: example.com) from 2018-09-20T10:00:00Z
to 2018-09-20T11:00:00Z
for temporary sharing. The live stream was interrupted for 10 minutes from 2018-09-20T10:30:00Z
to 2018-09-20T10:40:00Z
, so the output parameter SegmentSet
contains the information of two segments, and the actual duration of the video clip is 50 minutes.
POST / HTTP/1.1
Host: vod.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: LiveRealTimeClip
<Common request parameters>
{
"Host": "example.com",
"EndTime": "2018-09-20T11:00:00Z",
"StartTime": "2018-09-20T10:00:00Z",
"StreamId": "record-stream"
}
{
"Response": {
"Url": "http://example.com/playlist.m3u8",
"FileId": "",
"VodTaskId": "",
"MetaData": null,
"SegmentSet": [
{
"StartTime": "2018-09-20T10:00:00Z",
"EndTime": "2018-09-20T10:30:00Z"
},
{
"StartTime": "2018-09-20T10:40:00Z",
"EndTime": "2018-09-20T11:00:00Z"
}
],
"RequestId": "6ca31e3a-6b8e-xxxx-9256-fdc700064ef3"
}
}
This example shows you how to cut out a video clip from a live stream (live stream code: record-stream; domain name: example.com) from 2018-09-20T12:00:00Z
to 2018-09-20T13:00:00Z
for persistent storage, and initiate a task flow on the video.
POST / HTTP/1.1
Host: vod.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: LiveRealTimeClip
<Common request parameters>
{
"IsPersistence": "1",
"Host": "example.com",
"StartTime": "2018-09-20T12:00:00Z",
"StreamId": "record-stream",
"EndTime": "2018-09-20T13:00:00Z",
"Procedure": "SomeProcedure"
}
{
"Response": {
"Url": "http://example.com/playlist.m3u8",
"FileId": "5285890xxxxxx199336",
"VodTaskId": "125xxxx65-procedurev2-bffb15f07530b57bc1aabb01fac74bca",
"MetaData": null,
"SegmentSet": [
{
"StartTime": "2018-09-20T12:00:00Z",
"EndTime": "2018-09-20T13:00:00Z"
}
],
"RequestId": "6ca31e3a-6b8e-xxxx-9256-fdc700064ef3"
}
}
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. |
InternalError | Internal error. |
InvalidParameterValue | Incorrect parameter value. |
InvalidParameterValue.ClipDuration | Incorrect parameter value: the clipping duration is too long. |
InvalidParameterValue.EndTime | Incorrect parameter value: invalid EndTime . |
InvalidParameterValue.ExpireTime | Incorrect parameter value: incorrect ExpireTime format. |
InvalidParameterValue.StartTime | Incorrect parameter value: invalid StartTime . |
InvalidParameterValue.StreamIdInvalid | Incorrect parameter value: invalid StreamId . |
UnauthorizedOperation | Unauthorized operation. |
UnsupportedOperation | Unsupported operation. |
Was this page helpful?