tencent cloud

Feedback

Creating a New Live Stream Session

Last updated: 2024-09-24 18:09:15
    It is used to create a new video stream and obtain the playback URL for the digital human video.

    Calling Protocol

    HTTPS + JSON
    POST /v2/ivh/sessionmanager/sessionmanagerservice/createsession
    Header Content-Type: application/json;charset=utf-8

    Request Parameters

    Parameter name
    Type
    Required
    Description
    ReqId
    String
    Yes
    Unique identifier for each request, a 32-character UUID.
    SessionId
    String
    Yes
    A unique identifier for the session. The SaaS environment does not allow input from the cloud; the Private Environment allows input.
    VirtualmanProjectId
    String
    Yes
    The ID for the digital human project. (It is the same as the previous VirtualmanKey.)
    UserId
    String
    Yes
    The unique identifier for the user, maintained by the caller. Creating a new stream with the same UserIdentifier will cause the previous stream with that UserIdentifier to close.
    Protocol
    String
    Yes
    Currently supported parameters: rtmp, trtc, and webrtc
    DriverType
    int
    Yes
    The driving method for the digital human.
    1: text-only driving;
    3: audio driving (original voice), which supports both audio and text driving modes in this setting;
    ProtocolOption
    Yes
    Custom parameters for the protocol; ignore trtc if it is not used.
    
    ProtocolOption
    
    Name
    Type
    Required
    Description
    TrtcUseExternalApp
    boolean
    Yes
    It indicates whether to use an external trtc. If you do not use it, the unified trtc appid of the digital human platform will be used.
    Note:
    When the unified trtc appid of the digital human platform is used, it is limited to the debugging stage and cannot be used in the production stage.
    TrtcAppId
    string
    Yes
    The trtc appid (required when using an external trtc appid).
    TrtcRoomId
    int
    Yes
    The trtc room ID (The room ID will be assigned by the cloud if it is not specified.).
    TrtcUserSig
    string
    Yes
    The trtc AI Digital Human user signature (required when using an external trtc appid).
    TrtcPrivateMapKey
    string
    Yes
    The trtc AI Digital Human user permission key (required when using an external trtc appid).
    CssCustomPushUrl
    string
    Yes
    Custom Cloud Streaming Services (CSS) streaming URL. The streaming protocol is fixed to use rtmp. By using rtmp to push the stream to CSS, various pull protocols supported by CSS can be used for playback. The required format for the streaming URL is:
    rtmp://xyz.com/cssAppName/streamid?txSecret={0}&txTime={1} For the calculation method of txSecret and txTime, see https://www.tencentcloud.com/document/product/267/32720?from_cn_redirect=1

    Response Parameter

    Name
    Type
    Required
    Description
    ReqId
    String
    Yes
    Unique identifier for a single request.
    SessionId
    String
    Yes
    Unique identifier for the session
    SessionStatus
    int
    Yes
    Status:
    1: In progress (ready), the cache hit directly provides the playback URL.
    3: Preparing (not ready), the cache missed requires waiting for model to load. Use the Check Session Status API to poll the session status until the stream status changes to 1. This usually takes no more than 2 minutes.
    PlayStreamAddr
    String
    Yes
    The playback URL, in the format: rtmp://liveplay.ivh.qq.com/live/m789
    This field will not be returned if a custom CSS streaming URL is specified through the CssCustomPushUrl parameter.

    Request Sample

    { "Header": { }, "Payload": { "ReqId": "f2612aa810014e8997f95bda97917268", "VirtualmanProjectId": "1b2c9f1c268a4edfbf6c6274da31bc5d", "UserId": "f2612aa810014e8997f95bda97917268", "Protocol": "rtmp", "DriverType": 1 } }

    Response Sample

    {
    "Header": {
    "Code": 0,
    "Message": "",
    "RequestID": "123",
    },
    "Payload": {
    "ReqId": "d7aa08da33dd4a662ad5be508c5b77cf",
    "SessionId": "m789",
    "SessionStatus": 1,
    "PlayStreamAddr": "rtmp://live.qq.com/live/m789"
    }
    }
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support