tencent cloud

Tencent Real-Time Communication

소식 및 공지 사항
제품 업데이트
Tencent Cloud 오디오/비디오 단말 SDK 재생 업그레이드 및 권한 부여 인증 추가
TRTC 월간 구독 패키지 출시 관련 안내
제품 소개
제품 개요
기본 개념
제품 기능
제품 장점
응용 시나리오
성능 데이터
구매 가이드
Billing Overview
무료 시간 안내
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
과금 FAQ
Refund Instructions
신규 사용자 가이드
Demo 체험
Call
개요(TUICallKit)
Activate the Service
Run Demo
빠른 통합(TUICallKit)
오프라인 푸시
Conversational Chat
온클라우드 녹화(TUICallKit)
AI Noise Reduction
UI 사용자 정의
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
릴리스 노트
FAQs
라이브 스트리밍
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Demo 실행
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK 다운로드
API 코드 예시
Usage Guidelines
API 클라이언트 API
고급 기능
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
콘솔 가이드
애플리케이션 관리
사용량 통계
모니터링 대시보드
개발 보조
Solution
Real-Time Chorus
FAQs
과금 개요
기능 관련
UserSig 관련
방화벽 제한 처리
설치 패키지 용량 축소 관련 질문
Andriod 및 iOS 관련
Web 관련
Flutter 관련
Electron 관련
TRTCCalling Web 관련
멀티미디어 품질 관련
기타 질문
Protocols and Policies
컴플라이언스 인증
보안 백서
정보 보안에 관한 참고 사항
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
용어집
문서Tencent Real-Time Communication

Robot Streaming (TUIRoomKit)

포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-03-28 11:25:54

Description of the Feature

TUIRoomKit supports the use of robot push streaming, allowing users to push local or online media files into the room. In some scenarios, meetings may require the push of pre-recorded instructional videos or online video streams to online classrooms for users to watch and learn. TUIRoomKit can meet these needs, achieving automated and efficient video playback.
To use this feature, you need to subscribe to the TUIRoomKit Monthly Package. An robot stream will be considered a user in a room, which will incur call duration fees. For more information, please refer to the Billing of Audio and Video Duration. Transcoding operations will be performed during the process of connecting robot streams, thereby incurring transcoding fees. For more information, please refer to the Billing of On-Cloud MixTranscoding.




Application Scenario

Watching together, listening together, playing together, and learning together – experiences that previously required offline, face-to-face interaction are increasingly being moved online. The ability to watch movies, listen to music, and then discuss and share opinions with friends thousands of miles away is a magical real-time interactive experience that is loved by young people today, becoming a focus and mainstream direction of current audio and video products.
TUIRoomKit input media stream feature allows sharing of external media streams within a room. Users can use this feature to share music, movies, lectures, courses, and other media content with other users in the room, engaging in real-time interaction with them. Platforms can leverage this new feature of TUIRoomKit to quickly implement a watch together scenario. In addition to watching movies and listening to music together, the input media stream capability of TUIRoomKit can also bring more innovative possibilities to the platform in scenarios such as interactive classrooms, sports competitions, and web conferences.




Usage: Using RTMP for streaming

TUIRoomKit supports RTMP standard protocol for streaming. Depending on the situation, you can choose to install OBS, FFmpeg, or other RTMP libraries for streaming.

Using FFmpeg to publish streams

FFmpeg requires specific command configuration parameters for different scenarios, so you should have some experience with FFmpeg. Below are commonly used FFmpeg Command Line options; for more FFmpeg Options, please refer to the FFmpeg official website.

FFmpeg Command Line

ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url}

Common FFmpeg Options

Option
Description
-re
Reads input at native frame rate, generally only used for reading local files
Among them, the configurable options for output_file_options include:
Option
Description
-c:v
Video Encoding, recommended to use libx264
-b:v
Video bitrate, for example, 1500k means 1500kbps
-r
Video Frame Rate
-profile:v
Video profile, specifying baseline will not encode B frames, TUIRoomKit backend does not support B frames
-g
GOP frame interval
-c:a
Audio Encoding, recommended to use libfdk_aac
-ac
Number of channels, fill in 2 or 1
-b:a
Audio Bitrate
-f
Specify format, fixed fill in flv, send to TUIRoomKit using FLV container

Usage

The following example uses FFmpeg command to read files and push to TUIRoomKit, note the quotes around the URL.
ffmpeg -loglevel debug -re -i sample.flv -c:v libx264 -preset ultrafast -profile:v baseline -g 30 -sc_threshold 0 -b:v 1500k -c:a libfdk_aac -ac 2 -b:a 128k -f flv 'rtmp://rtmp.rtc.qq.com/push/yourRoomId?userid=yourUserId&sdkappid=xxxxxxxxx&usersig=xxxxxxxxxx'
The explanations for the parameters in the above command are as follows:
Parameter
Meaning
-i sample.flv
The media file that needs to be streamed to TUIRoomKit. You can replace sample.flv with the local or online media file you need to stream.
yourRoomId
The Room ID you need to stream to. You need to replace yourRoomId with your actual RoomId.
userId
The UserID you need to stream with. You need to change the value after "=" to the actual userId.
sdkappid
Your sdkappid, which you have previously obtained in Activate Service. You need to change the value after "=" to the actual sdkAppID.
usersig
Your usersig, which you have obtained when logging into TUIRoomKit. You need to change the value after "=" to the actual userSig.
When you need to implement the above feature in code, you can use the relevant FFmpeg library on your platform or invoke FFmpeg through the command line to achieve the above command.

Using OBS to publish streams

Prerequisites

You have installed OBS.

Step 1. Select a source

In the Sources panel at the bottom, click **+**, and select a source based on your needs. Common sources include the following:
Source
Note
Image
Publishes a single image
Image Slide Show
Publishes multiple images (you can determine the order of playback and whether to loop the playback)
Scene
Inserts an entire scene to enable various streaming effects
Media Source
Uploads a local file and publishes it as a live stream
Text
Adds real-time text to your stream
Window Capture
Captures and publishes the window you select in real time
Video Capture Device
Captures and publishes the images captured by a camera in real time
Audio Input Capture
Audio live streaming (audio input device)
Audio Output Capture
Audio live streaming (audio output device)




Step 2. Set publishing parameters

1. In the Controls panel at the bottom, click Settings.
img


2. Click Stream and select Custom for Service.
3. Enter rtmp://intl-rtmp.rtc.qq.com/push/ for Server.
4. Enter a stream key in the following format:
Room ID?sdkappid=Application&userid=User ID&usersig=Signature
Replace "Room ID", "Application ID", "User ID", and "Signature" with the actual values, for example:
yourRoomId?sdkappid=140*****66&userid=******rtmp2&usersig=eJw1jdE***************ZLgi5UAgOzoMhrayt*cjbmiCJ699T09juc833IMT94Ld7I0iHZqVDzvVAqkZsG-IKlzLiXOnEhswHu1iUyTc9pv*****D8MQwoA496Ke6U1ip4EAH4UMc5H9pSmv6MeTBWLamhwFnWRBZ8qKGRj8Yp-wVbv*mGMVZqS7w-mMDQL




Step 3. Configure the output

Because RTMP does not support B-frames, set the video encoding parameters as follows to remove B-frames.
1. Go to Controls > Settings > Output.
2. Select Advanced for Output Mode. The recommended Keyframe Interval is 1 or 2. For CPU Usage Preset, select ultrafast. For Profile, select baseline. For Tune, select zerolatency. And for x264 Options, enter threads=1, and then click OK.
Warning:
You need to remove the B-frames in RTMP streams, otherwise the connection will be disconnected after pushing. To achieve this, select baseline for Profile.




Step 4. Set video parameters

You can set video resolution and frame rate under the Video section of Settings. Resolution determines the clarity of video shown to audience members. The higher the resolution, the clearer the video. Frame rate (frames per second) determines playback smoothness. Typical frame rate falls in the range of 24 fps to 30 fps. Playback may stutter if frame rate is lower than 16 fps. Video games require higher frame rate and tend to stutter at a frame rate lower than 30 fps.



Step 5. Configure advanced settings

To reduce end-to-end delay, we recommend you do not enable Stream Delay.
Keep Automatically Reconnect enabled and make Retry Delay as short as possible so that the publisher can be reconnected quickly after a disconnection occurs due to network jitter.



Step 6. Publish the stream

1. In the Controls panel at the bottom, click Start Streaming.


2. If streaming is successful, the bottom bar will show streaming statistics, and the entry of a user will be recorded by the monitoring dashboard.





도움말 및 지원

문제 해결에 도움이 되었나요?

피드백