产品概述
产品优势
应用场景

功能模块 | 关键动作及功能点 |
媒体服务 | 音视频推流、音视频拉流 |
信令服务 | 远程操控 |








JSONObject jsonObject = new JSONObject();try {jsonObject.put("api", "SetAudioCacheParams");JSONObject params = new JSONObject();params.put("min_cache_time", 80); // 音频本地最小cache时长params.put("max_cache_time", 100); // 音频本地最大cache时长jsonObject.put("params", params);mTRTCCloud.callExperimentalAPI(String.format(Locale.ENGLISH, jsonObject.toString()));} catch (JSONException e) {e.printStackTrace();}JSONObject jsonObject = new JSONObject();try {jsonObject.put("api", "setDecoderStrategy");JSONObject params = new JSONObject();params.put("codecType", 1); // 设置软解jsonObject.put("params", params);mTRTCCloud.callExperimentalAPI(String.format(Locale.ENGLISH, jsonObject.toString()));} catch (JSONException e) {e.printStackTrace();}
NSDictionary *jsonDic = @{@"api": @"SetAudioCacheParams",@"params": @{@"min_cache_time": @(80),@"max_cache_time": @(100)}};NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDic options:NSJSONWritingPrettyPrinted error:nil];NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];[trtcCloud callExperimentalAPI:jsonString];NSDictionary *jsonDic = @{@"api": @"setDecoderStrategy",@"params": @{@"codecType": @(1)}};NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDic options:NSJSONWritingPrettyPrinted error:nil];NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];[trtcCloud callExperimentalAPI:jsonString];.... // 进房的相关代码
const trtc = TRTC.create();// 进入房间try {await trtc.enterRoom({strRoomId,scene:'rtc',sdkAppId,userId,userSig,playoutDelay: { min: 0, max: 0 } // 修改本地延迟});console.log('进房成功');} catch (error) {console.error('进房失败' + error);}
# 视频编码设置编码格式:H264分辨率 : 1080P/720P/540P/360P # 根据清晰度设置比特率控制: VBR # 可变码率I帧间隔:50 # 1-200 I帧间隔越低延迟越低比特率:2000kbps/1200kbps/850kbps/550kbps # 码率设置,码率越高,清晰度越高帧率: 30 # 帧率 20-60帧BaseProfile:启用 # BaseProfile不开启B帧,能进一步降低延迟

// 开启自定义视频采集mTRTCCloud.enableCustomVideoCapture(TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG, true);mTRTCCloud.setDefaultStreamRecvMode(false, false);// 自定义摄像头采集private CustomCameraCapture mCustomCameraCapture;private CustomFrameRender mCustomFrameRender;// 使用视频纹理处理采集数据,降低内存消耗,并发送视频帧private CustomCameraCapture.VideoFrameReadListener mVideoFrameReadListener = new CustomCameraCapture.VideoFrameReadListener() {@Overridepublic void onFrameAvailable(EGLContext eglContext, int textureId, int width, int height) {TRTCCloudDef.TRTCVideoFrame videoFrame = new TRTCCloudDef.TRTCVideoFrame();videoFrame.texture = new TRTCCloudDef.TRTCTexture();videoFrame.texture.textureId = textureId;videoFrame.texture.eglContext14 = eglContext;videoFrame.width = width;videoFrame.height = height;videoFrame.pixelFormat = TRTCCloudDef.TRTC_VIDEO_PIXEL_FORMAT_Texture_2D;videoFrame.bufferType = TRTCCloudDef.TRTC_VIDEO_BUFFER_TYPE_TEXTURE;mTRTCCloud.sendCustomVideoData(TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG ,videoFrame);}};mCustomCameraCapture = new CustomCameraCapture();mCustomFrameRender = new CustomFrameRender(mUserId, TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG);// 开启摄像头采集mCustomCameraCapture.startInternal(mVideoFrameReadListener);// 设置自定义渲染mTRTCCloud.setLocalVideoRenderListener(TRTCCloudDef.TRTC_VIDEO_PIXEL_FORMAT_Texture_2D, TRTCCloudDef.TRTC_VIDEO_BUFFER_TYPE_TEXTURE, mCustomFrameRender);final TextureView textureView = new TextureView(this);mLocalRenderView.addVideoView(textureView);mCustomFrameRender.start(textureView);
public static final int ENCODE_WIDTH = 480;public static final int ENCODE_HEIGHT = 640;JSONObject jsonObject = new JSONObject();try {jsonObject.put("api", "setVideoEncodeParamEx");JSONObject params = new JSONObject();params.put("codecType", 1);params.put("videoWidth", ENCODE_WIDTH);params.put("videoHeight", ENCODE_HEIGHT);params.put("videoFps", 20);params.put("videoBitrate", 1500);params.put("minVideoBitrate", 300);params.put("streamType", 0);params.put("resolutionMode", 1);jsonObject.put("params", params);} catch (JSONException e) {throw new RuntimeException(e);}mTRTCCloud.callExperimentalAPI(jsonObject.toString());
mTRTCCloud.startLocalAudio(TRTCCloudDef.TRTC_AUDIO_QUALITY_SPEECH);
系统层级 | 产品名称 | 场景用途 |
接入层 | 提供低延时、高品质的音视频实时互动解决方案,是音视频通话场景的基础底座能力。 | |
云端服务 | 面向音视频媒体,提供制作上传、存储、转码、媒体处理、媒体 AI、加速分发播放、版权保护等一体化的高品质媒体服务。 | |
数据存储 | 提供音视频录制文件、音视频切片文件的存储服务。 |
文档反馈