Pushing Local PC Desktop Streams to SRS Using OBS
Application Scenario
SRS is a simple and an efficient real-time video server that supports various real-time streaming media protocols, such as RTMP, WebRTC, HLS, HTTP-FLV, and SRT. Supported By FlexusL, the SRS image uses Ubuntu 22.04 and is deployed using Docker. The Nginx and Docker have been preconfigured in the image. This section describes how to push PC desktop streams to SRS using OBS.
Resource Planning and Costs
This practice uses the following resource planning as an example. You can adjust it as required.
Resource |
Configuration |
Description |
---|---|---|
Cloud server |
|
Select appropriate instance specifications based on your service requirements. |
Image |
SRS |
Select the SRS application image. |
Security group |
Inbound rule: |
|
Domain name |
wpwebsite.com |
|
Process
Procedure |
Description |
---|---|
Purchase a FlexusL instance and select the SRS application image. |
|
Add inbound security group rules to ensure that the application preinstalled in the image can be accessed. |
|
Understand the SRS working interface. |
|
Learn how to push local PC desktop streams to SRS using OBS. |
Step 1: Purchase a FlexusL Instance
- Log in to the FlexusLconsole and click Buy FlexusL.
- Specify required parameters for the FlexusL instance.
Parameter
Example
Description
Region
CN-Hong Kong
For low network latency and quick resource access, select the region nearest to your target users. After a FlexusL instance is created, the region cannot be changed. Exercise caution when selecting a region.
Application Images
SRS
Select the SRS application image.
Instance Specifications
2 vCPUs | 4 GiB memory and 80 GiB system disk
Select instance specifications as needed.
Instance Name
SRS-Example
Customize an instance name that is easy to identify, for example, SRS-Example.
(Optional) Associated Services
- Data disk: 10 GiB
- Host security
- Cloud backup vault: 90 GiB
You can bundle any of the services to your FlexusL instances as needed: EVS, HSS (basic edition), and CBR and set specifications as needed.
Required Duration
1 month
The minimum duration of a purchase is one month and the maximum duration is three years.
Auto-renew is enabled by default, which means the purchased FlexusL instances will be automatically renewed before they expire. If you do not enable auto-renew during the purchase process, you can still enable it later after the instances are created. For more information about auto-renewal rules, see Auto-Renewal Rules.
Quantity
1
Set the number of FlexusL instances to be purchased.
- Click Buy Now and complete the payment as prompted.
- Go back to the FlexusL console and view the purchased FlexusL instance.
After a FlexusL instance is created using an application image, wait until the image with the pre-installed application is up and running. Then, you can perform operations such as restarting or stopping the instance, or resetting the password. Otherwise, the installation may fail and you cannot log in to the image application dashboard.
Step 2: Configure Security Groups
Add inbound security group rules to ensure that the application preinstalled in the image can be accessed.
- Log in to the FlexusL console and click a resource card to go to the instance details page.
- In the navigation pane on the left, choose Cloud Servers. Locate the server and click its name.
- On the Security Groups tab, click Add Rule. In the displayed dialog box, add rules displayed in the following figure and click OK.
The following figure only displays common rules. You can add more rules as needed.
Table 1 Security group rules Priority
Action
Type
Protocol & Port
Source
Description
100
Allow
IPv4
TCP: 9001
0.0.0.0/0
Allows external access to the application dashboard.
100
Allow
IPv4
TCP: 1935
0.0.0.0/0
Allows access to the RTMP livestreaming server.
100
Allow
IPv4
TCP: 1985
0.0.0.0/0
Allows access to the HTTP API server to deliver HTTP-API and WebRTC streams.
100
Allow
IPv4
TCP: 8080
0.0.0.0/0
Allows access to the HTTP livestreaming server to deliver HTTP-FLV and HLS streams.
100
Allow
IPv4
TCP: 8000
0.0.0.0/0
Allows access to the WebRTC media server.
Step 3: Learn About the SRS Working Interface
- On the Overview page, click Access in the Dashboard field in the Image area.
If the dashboard of WordPress cannot be accessed, it may be because the port for accessing the dashboard is not allowed or the application has not been up and running. To solve this problem, see Why Can't I Open the Dashboard of the Application Pre-installed in the Application Image?
- Understand the SRS working interface.
You do not need to set the username and password for logging in to SRS. On the SRS working interface, you can:
- Log in to the SRS console.
- Obtain the ingest URL.
- Start SRS player to watch the livestreaming content.
Then, you have obtained an SRS hosting server. You can start using SRS or follow the steps in Step 4: Push Local PC Desktop Streams to SRS Using OBS to push and watch livestreams.
Step 4: Push Local PC Desktop Streams to SRS Using OBS
This section describes how to push local PC desktop streams to SRS using OBS.
- Download and install OBS based on your operating system.
- Open OBS tool and click Settings in the Controls area.
- On the Stream page, configure parameters and click Apply.
Parameter
Description
Service
Multiple platforms can push livestreams via OBS. For SRS, select Custom.
Server
Enter the stream pushing address specified by SRS, for example, rtmp://124.70.x.x/live/.
Stream key
Specify a character string following the specified stream pushing address, for example, the livestream following live/ in rtmp://124.70.x.x/live/.
Use authentication
Select Use authentication and set the Username and Password.
- In the Output page, configure parameters and click Apply.
Set Video Bitrate to 1000 kbps. Select Software for Video Encoder to avoid the need for high-end graphics cards and prevent potential streaming issues. Configure other parameters as needed.
- Click OK.
- In the displayed Sources area, click +, select Display Capture, create a source, and click OK.
- Perform any operation to change the desktop screen, and you can see that the screen starts to capture desktop content. Click OK.
- Click Start Streaming. After the connection is successful, a green block is displayed in the lower right corner, indicating that the stream pushing is successful.
- Log in to the FlexusL console and click a resource card to go to the instance details page.
- On the Overview page, in the Image area, click Access to access the image application dashboard.
- Start SRS player.
- Watch the desktop livestreams.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot