要将多用户的agora通道推送到CDN,是否需要为每个用户调用以下方法?或者为一个主机设置代码转换和启动直播流是否自动为频道中的每个人启动流。另外,有没有类似录制的默认转码布局?
client.setLiveTranscoding(LiveTranscoding);
client.startLiveStreaming("your RTMP URL", true)发布于 2020-09-19 05:22:14
要推送通道中的所有用户,您只需从单个用户调用setLiveTranscoding和startLiveStreaming。在Live Transcoding Config对象中,您可以使用userCount属性设置用户数,并使用transcodingUsers对象为每个用户定制各种设置。
// CDN transcoding settings.
var liveTranscodingConfig = {
// Width of the video (px). The default value is 640.
width: 640,
// Height of the video (px). The default value is 360.
height: 360,
// Bitrate of the video (Kbps). The default value is 400.
videoBitrate: 400,
// Frame rate of the video (fps). The default value is 15. Agora adjusts all values over 30 to 30.
videoFramerate: 15,
audioSampleRate: AgoraRTC.AUDIO_SAMPLE_RATE_48000,
audioBitrate: 48,
audioChannels: 1,
videoGop: 30,
// Video codec profile. Choose to set as Baseline (66), Main (77), or High (100). If you set this parameter to other values, Agora adjusts it to the default value of 100.
videoCodecProfile: AgoraRTC.VIDEO_CODEC_PROFILE_HIGH,
userCount: 1,
userConfigExtraInfo: {},
backgroundColor: 0x000000,
// Adds a PNG watermark image to the video. You can add more than one watermark image at the same time.
images: [{
url: "http://www.com/watermark.png",
x: 0,
y: 0,
width: 160,
height: 160,
}],
// Sets the output layout for each user.
transcodingUsers: [{
x: 0,
y: 0,
width: 640,
height: 360,
zOrder: 0,
alpha: 1.0,
// The uid must be identical to the uid used in Client.join.
uid: 1232,
}],
};
client.setLiveTranscoding(liveTranscodingConfig);
client.startLiveStreaming("your RTMP URL", true)https://stackoverflow.com/questions/63951770
复制相似问题