Overview
Menu

ProcessLiveStream

1. API Description

Domain name for API request: mps.tencentcloudapi.com.

This API is used to initiate live stream processing tasks. Such tasks may include the following:

  • Intelligent content moderation (detection of pornographic content in images and audio, detection of sensitive information)
  • Intelligent content recognition (face, full text, text keyword, full speech, speech keyword, real-time speech translation, object recognition, game event tracking)
  • Intelligent content analysis (real-time news splitting)
  • Quality control, including recognizing live stream format, checking audio/video content for flickering, blur, low light, overexposure, black bars, white bars, black screen, white screen, noise, pixelation, QR code, etc., and no-reference scoring.
  • Recording

HTTP callbacks are supported for live stream processing events. Notifications can also be written in real time to and read from a CMQ queue. The output files of processing tasks are saved to the storage you specify.

A maximum of 100 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: ProcessLiveStream.
VersionYesStringCommon Params. The value used for this API: 2019-06-12.
RegionNoStringCommon Params. This parameter is not required for this API.
UrlYesStringLive stream URL, which must be a live stream file address. RTMP, HLS, and FLV are supported.
TaskNotifyConfigYesLiveStreamTaskNotifyConfigEvent notification information of a task, which is used to specify the live stream processing result.
OutputStorageNoTaskOutputStorageTarget bucket of a live stream processing output file. This parameter is required if a file will be output.
OutputDirNoStringTarget directory of a live stream processing output file, such as /movie/201909/. If this parameter is left empty, the / directory will be used.
AiContentReviewTaskNoAiContentReviewTaskInputType parameter of a video content audit task.
AiRecognitionTaskNoAiRecognitionTaskInputType parameter of video content recognition task.
AiAnalysisTaskNoAiAnalysisTaskInput
AiQualityControlTaskNoAiQualityControlTaskInput
SessionIdNoStringThe ID used for deduplication. If there was a request with the same ID in the last seven days, the current request will return an error. The ID can contain up to 50 characters. If this parameter is left empty or an empty string is entered, no deduplication will be performed.
SessionContextNoStringThe source context which is used to pass through the user request information. The task flow status change callback will return the value of this field. It can contain up to 1,000 characters.
ScheduleIdNoIntegerThe live scheme ID.
Note 1:
  • If an output storage (OutputStorage) and directory (OutputDir) are specified for a subtask of the scheme, those output settings will be applied.

  • u200c
  • If an output storage (OutputStorage) and directory (OutputDir) are not specified for a subtask of the scheme, the output parameters specified for ProcessLiveStream (if any) will be applied.

  • Note 2: If TaskNotifyConfig is specified when ProcessLiveStream is called, the specified settings will be applied instead of the default callback settings of the scheme.

    3. Output Parameters

    Parameter NameTypeDescription
    TaskIdStringTask ID
    RequestIdStringThe unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Initiating a live stream recognition task

    This example shows you how to initiate a content recognition task for a live stream whose URL is http://www.abc.com/abc.m3u8.

    Input Example

    POST / HTTP/1.1
    Host: mps.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ProcessLiveStream
    <Common request parameters>
    
    {
        "Url": "http://www.abc.com/abc.m3u8",
        "AiRecognitionTask": {
            "Definition": "10"
        },
        "TaskNotifyConfig": {
            "CmqRegion": "gz",
            "CmqModel": "Queue",
            "QueueName": "queue-125717729292"
        }
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "5ca61e3a-6b8e-4b4e-9256-fdc701190064ef0",
            "TaskId": "125xxxxxx07-live-procedure-813dc41e6fdc22dcf24aa6e9c61cp92"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error CodeDescription
    FailedOperation.InvalidMpsUserOperation failed: unauthorized MPS user.
    InternalErrorInternal error.
    InvalidParameterParameter error.
    InvalidParameterValue.DefinitionParameter error: Definition.
    InvalidParameterValue.DefinitionsParameter error: Definitions.
    InvalidParameterValue.SessionIdThe deduplication ID already exists. The request is removed due to duplication.