Push Media Stream Into Room(TUILiveKit)
Feature Introduction
Push Media Stream Into Room is a technology that pushes RTMP streams into live broadcast rooms. You can use tools such as OBS or FFMPEG to push pre-recorded videos, real-time generated visuals, or other online video streams (such as surveillance footage, in-game screens, meeting scenes, etc.) into the live broadcast room, simulating the effect of real-time live streaming.
Notes:
The related fees are as follows:
Feature unlock: The Push Media Stream Into Room feature requires subscribing to the Live monthly package Standard or Pro
Edition to unlock (the trial version also allows for experiencing this feature).
Usage fees:
Using the streaming feature will perform transcoding operations, incurring transcoding fees. For details, see On-Cloud MixTranscoding Billing Instructions.
Audio duration fees will be charged for streaming chatbots in the room (note: fees for chatbots in the room generated by the input online media stream feature will be waived until August 15, 2024, and will be charged starting from August 16, 2024).
Note: Audio and video call fees will occur when the audience in the room subscribes to the audio and video content streamed into the room. For details, see Audio and Video Duration Billing Instructions.
Use Cases
Robot streaming is designed for diverse live streaming needs. You can implement the following use cases:
Scenario Type | Description |
24/7 uninterrupted live stream | With robot streaming, you can achieve 24-hour uninterrupted live stream, which is suitable for scenarios such as news broadcasting, music radio stations, and monitoring footage. |
Content replay | Re-push popular live stream content or recorded videos to attract more audience viewing. |
Virtual Streamer | Combine avatar technology and use robot streaming to realize virtual streamer live streaming. |
Corporate live streaming | Used for corporate meetings, product launch events, training, and other scenarios to stream recorded videos to internal or external platforms. |
Game live streaming | Push the game video stream into the live streaming room. Combine it with commentary or background music to enhance the live broadcast effects. |
Education live streaming | Push the recorded course video to the education platform to implement online teaching. |
E-commerce live broadcast | Show product information and promotion activities through robot streaming to enhance the sales conversion rate. |
More scenarios | Any real-time interaction play mode based on media stream can be implemented through RTMP streaming. More play modes are waiting for you to explore. |
User Guide
Following will use RESET API and OBS tool as examples to guide you through the quick start of robot streaming feature.
Robot Push Streaming
Notes:
You need to implement robot push streaming by following the steps of create live streaming room > create robot > use OBS to push RTMP stream to the live streaming room > robot becomes a speaker.
Step 1: Create a Live Streaming Room
You can create a live streaming room via RESET API Create a live streaming room. (It is advisable to set the Host ID as the robot's ID.)
Step 2: Create a Robot
When there is no one in the live streaming room within a period of time, it will be automatically dissolved. To ensure your room is not dissolved, you need to create a robot inside the room.
Step 3: Use OBS to Push RTMP Stream to the Live Streaming Room
Here will guide you to use OBS tool to push RTMP stream to the live streaming room. You can refer to the document RTMP stream push to the live streaming room.
Notes:
Room ID during stream pushing is set to the room ID you set when creating the live streaming room in Step 1.
userId during stream pushing is set to the robot userId you created in Step 2.
Step 4: Robot Takes the Mic
Online live streaming audiences will automatically pull the audio and video stream of the speaker on the mic. To ensure that the audiences in your room receive the audio and video stream pushed via RTMP, you need to put the robot in the speaking state.
Notes:
If you want to customize the size and position of the audio and video stream visual that the audience views in the live streaming room, you can achieve it by using the RESET API to set the room's stream mixing layout.
Robot Stop Streaming
Notes:
You need to implement robot stop streaming by following the steps of robot becomes a listener > delete robot > dismiss live streaming room > stop RTMP streaming.
Step 1: Robot Becomes a Listener
Step 2: Deleting a Robot
Step 3: Dismissing a Live Streaming Room
When you want to dismiss a live streaming room in advance, you can dismiss the live streaming room via RESET API dismiss a live streaming room.
Step 4: Stop RTMP Streaming to the Live Streaming Room
Click the stop live streaming button to stop streaming to the live streaming room.

FAQs
1.What to do if push fails?
Common reasons: No package purchased or expired; Signature error or expired; Pushed B frames (phenomenon on the dashboard is "streaming ends after one second"), baseline encoding can be set.
Other reasons: If it is an embedded hardware device pushing the stream, the URL may be truncated; if H.265 is pushed, change to H.264; if set chunk on the terminal is too large, change to 1360.
2.What to do if there is lagging or mosaic screen effect?
Observe the Tencent Cloud Real-Time Communication console dashboard to check if the streaming frame rate is stable. If it is stable, it is likely an issue on the playback side; check the playback side. If the frame rate is unstable, consider the following points:
1) Check if the local CPU and memory of the push client are under high load. If OBS is used for streaming, monitor the status bar at the bottom of the software for information such as frame loss, network, CPU, and frame rate.
2) Check if the local network bandwidth is sufficient. ping the streaming domain name to observe the RTT; use the network diagnostic tool to detect the streaming domain name and check the bandwidth, which should ideally reach 10M.
3) The pushing end can try reducing the bitrate and frame rate to decrease the client load. For reference, see the settings of OBS in the text. The recommended bitrate for 720p is 1500 Kbps.
3.What to do if the delay is high?
If the pulling end uses the anchor role, the delay is usually lower than that of the audience role. If it is not the anchor role, you can try comparing to see if there is any improvement.
The local encoding and network impact of the streaming end are relatively large. You can try testing on different platforms. If OBS is used, you can try streaming on Windows systems; ping the streaming domain to observe the RTT.
4.What to do if the RTMP streaming is interrupted?
If you restore RTMP streaming within 5 minutes after stream disconnection, the audience in the same room will pull the audio and video stream again. If it exceeds 5 minutes, the audience needs to re-enter the room to pull the audio and video stream.
5.How to set the layout for streaming?
You can use the REST API for setting room stream mixing layout to implement this feature. When LayoutMode is set to 0, it defaults to a nine-grid layout. When LayoutMode is set to 1000, it is a custom layout. You can set the video size and position for the audience end by setting these two fields: VideoEncode and LayoutInfo.
6.What to do if you can't see the corresponding robot room in the online live stream list?
Answer: When you use the RESET API to create a live streaming room, set the IsPublicVisible field to true.