CloudHub Docs
Download Documents

RTC


CloudHub JSSDK

LiveTranscoding

What it does: About live streaming LiveTranscoding data definition, data is JSON structure. When calling set LiveTranscoding, set the live streaming by specifying LiveTranscoding.

namedescription
width:numberThe total width of the push video. Default is 640, in pixels.
* If you push the video stream, the width value must not be less than 64, otherwise the ChoudHub will be adjusted to 64.
* If you push the audio stream, set width and height to 0.
height:numberThe total height of the push video. Default is 360 in pixels.
* If you push the video stream, the height value must not be less than 64, otherwise the ChoudHub will be adjusted to 64.
* If you push the audio stream, set width and height to 0.
videoBitrate:numberThe bit rate of the output video used for live streaming, in Kbps.A positive integer, the default value is 400 Kbps, and the value range is [1,1000000]. See Video resolution table To set it up. If the rate is set beyond a reasonable range, the CloudHub server will automatically adjust the rate value within a reasonable range.
videoFramerate:numberThe frame rate of the output video used for live streaming, in fps.A positive integer, the default value is 15 fps, and the value range is [1,30].The server changes the frame rate setting above 30 to 30.
audioSampleRate:numberSampling rate for output audio for live streaming
* 32000: Audio sampling rate 32 kHz
* 44100:(Default) audio sampling rate 44.1 kHz
* 48000: Audio sampling rate 48 kHz
audioBitrate:numberThe bit rate of the output audio used for live streaming, in Kbps.A positive integer, the default value is 48, and the maximum value is 128.
audioChannels:numberThe default value of the number of channels of output audio used for live streaming is 1. The value range is an integer in [1,2].
* 1: (Default) monophonic
* 2: Double Channel
audioCodecProfile:numberThe encoding specification of the output video used for bypass streaming, the default value is 0
Can be set to 0 and 1. If you set other values, Choud Hub will set it to the default value 0.
* 0: LC-AAC specification, which represents the basic audio coding specification.
* 1: HE-AAC specification, which means high-efficiency audio coding specification.
videoGop:numberThe GOP of the output video used for live streaming, in units of frames.A positive integer, the default value is 30 frames, and the value range is [1,10000].
videoCodecProfile:numberThe encoding specification of the output video used for live streaming, the default value is 100
Can be set to 66, 77 or 100. If you set other values, Choud Hub will uniformly set the default value of 100.
* 66: Baseline-level video encoding specifications are generally used for low-level or additional fault-tolerant applications, such as video calls, mobile video, etc.
* 77: Main-level video encoding specifications are generally used in mainstream consumer electronic products, such as mp4, portable video players, PSP, and i Pad.
* 100(Default): High-level video encoding specifications, generally used for broadcasting and video disc storage, high-definition TV.
streamCount:numberThe number of streams participating in the combined graph, the default is 0, and the maximum is 24 streams.
backgroundColor:numberBackground color
The default is 0x000000, which must be in hexadecimal format. The value range is [0x000000, 0xffffff].
transcodingStreams:arrayThe stream of the video transfer drawing photo transmitted by the live broadcast stream is used, and the number of items is TranscodingStream。
A maximum of 24 people are supported to participate in transcoding at the same time. See TranscodingStream Description”。

Structures such as:

{
    "width": 640,
    "height": 360, 
    "videoBitrate": 400,
    "videoFramerate": 15,
    "audioSampleRate": 48000,
    "audioBitrate": 48,
    "audioChannels": 1,
    "audioCodecProfile": 0,
    "videoGop": 30,
    "videoCodecProfile": 100,
    "streamCount": 1,
    "backgroundColor": 0x000000,
    "transcodingStreams": [{
        "x": 0,
        "y": 0,
        "width": 640,
        "height": 360,
        "zOrder": 0,
        "uid": "123456",
        "type": 'video',
        "sourceID": 'default_source_id'
    }]
}

TranscodingStream

What it does: When calling set LiveTranscoding, it is used to manage the stream of video transcoding and combining pictures participating in the CDN live broadcast. The type is object.

namedescription
uid:stringUser id of the stream
type:stringType of stream
sourceID:stringSourceID of the stream
width:numberVideo frame width
Integer, the range of values is [0,10000]The default is 640。
height:numberVideo frame height
Integer, the range of values is[0,10000]The default is 360。
x:numberThe horizontal position of the top left corner of the video frame
Integer, the range of values is[0,10000]The default is 0。
y:numberThe vertical axis position of the upper left corner of the video frame
Integer, the range of values is[0,10000]The default is 0。
zOrder:numberLayer numbering of streaming video frames on live video
Integer, the range of values is[0,100]。
The minimum value is 0(the default) , indicating that the region image is at the bottom level.
The maximum value is 100, indicating that the region image is at the topmost level.