tencent cloud

Using the Personal Asset Image to Create a Stream
Last updated: 2025-01-17 16:24:37
Using the Personal Asset Image to Create a Stream
Last updated: 2025-01-17 16:24:37
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/createsessionbyasset
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
No
Session unique identifier. SaaS environment does not allow input assigned by cloud-based, private environment allows input.
AssetVirtualmanKey
String
Yes
Personal asset image ID. It is obtained from the Asset Management of the digital human platform, as shown in the image:



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
No
Custom parameters for the protocol; ignore trtc if it is not used.
SpeechParam
No
Parameters related to timbres.

ProtocolOption

Name
Type
Required
Description
TrtcUseExternalApp
boolean
No
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
No
The trtc appid (required when using an external trtc appid).
TrtcRoomId
int
No
The trtc room ID (The room ID will be assigned by the cloud if it is not specified.).
TrtcUserSig
string
No
The trtc AI Digital Human user signature (required when using an external trtc appid).
TrtcPrivateMapKey
string
No
The trtc AI Digital Human user permission key (required when using an external trtc appid).
CssCustomPushUrl
string
No
Custom Cloud Streaming Services (CSS) push URL. The streaming protocol is fixed to use rtmp. By using rtmp to push the stream to CSS, various pull protocols supported by CSS are available for live playback.
The required streaming URL format is:
rtmp://xyz.com/cssAppName/streamid?txSecret={0}&txTime={1}
Reference for txSecret and txTime calculation method: https://www.tencentcloud.com/document/product/267/32720?from_cn_redirect=1

SpeechParam

Name
Type
Required
Description
Speed
float
No
Speech speed, with a range of [50, 200]. A value of 50 indicates 50% of the default speed. If the speed is not specified, it is recommended to use the default value of 100.
TimbreKey
string
No
Timbre key.
Volume
int
No
Volume level, with a range of [-10, 10]. A value of -10 indicates a decrease of 10 dB relative to the default volume. If the volume is not specified, it is recommended to use the default value of 0.
TimbreLanguage
string
No
Voice type language. For optional languages, see the Personal Asset Management API Paginated Query Timbre List API. Multilingual voice types must select the corresponding language during synthesis.

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 miss requires waiting for model to load. Use the Query 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
No
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": "d7aa08da33dd4a662ad5be508c5b77cf",
"AssetVirtualmanKey": "d7aa08da33dd4a662ad5be508c5b77cf",
"DriverType": 1,
"UserId": "henry",
"Protocol": "rtmp"
}
}

Response Sample

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

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback