Skip to content

Commit

Permalink
Add transcode blog.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Oct 21, 2023
1 parent d9e8dba commit c5a6d25
Show file tree
Hide file tree
Showing 26 changed files with 217 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Ultimately, WebRTC is not designed for live streaming, the only scenario to use

For live streaming, rather than modern and new tech stack, it’s actually disaster to use WebRTC in mobile H5, and unnecessary for mobile native players.

Welcome for more discussion at [discord](https://discord.gg/yZ4BnPmHAd).
Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/22-02-17-WebRTC-Live)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ SRS Stack is a single node video streaming service, but SRS is a media server th

## Conclusion

In this tutorial, you build a video streaming service only by 1-Click, but with powerful features like authentication, SRT and WebRTC etc. If you have further questions about SRS, [the wiki](/docs/v4/doc/introduction) is a good place to start. If you'd like to discuss with SRS, you are welcome to [discord](https://discord.gg/yZ4BnPmHAd).
In this tutorial, you build a video streaming service only by 1-Click, but with powerful features like authentication,
SRT and WebRTC etc. If you have further questions about SRS, [the wiki](/docs/v4/doc/introduction) is a good place to
start. If you'd like to discuss with SRS, you are welcome to [discord](https://discord.gg/yZ4BnPmHAd).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/22-04-09-SRS-Stack-Tutorial)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ Many services own a corresponding exporter. For example, [redis_exporter](https:

At present, SRS has not implemented its own `srs-exporter`, but it will be implemented in the future. For details, please refer to [#2899](https://github.com/ossrs/srs/issues/2899).

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/22-05-16-Load-Balancing-Streaming-Servers)


Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ Here, some of SRT's most troublesome problems are the high retransmission rate a
1. Addition of the BBR congestion control algorithm: The native SRT congestion control is weak, and the evaluated bandwidth fluctuates greatly, both of which are resolved by adding the BBR congestion control algorithm.
1. SRT multi-linkage transfer improved with bandwidth aggregation: The auto mode for live streaming is added to SRT, in addition to its native backup and broadcast modes. In this way, the bandwidths of multiple ENIs are aggregated for live streaming, with smart and dynamic linkage selection.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/22-07-01-Coroutine-Native-SRT)


Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ We demostrate the reusing port of WebRTC and HTTP Stream, but you're able to use

## Future Plan

We're developing SRS 5.0, and we might close features at the end of 2022, so welcome to join the SRS community by [discord](https://discord.gg/yZ4BnPmHAd).
We're developing SRS 5.0, and we might close features at the end of 2022, so welcome to join the SRS community
by [discord](https://discord.gg/yZ4BnPmHAd).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2022-09-05-WebRTC-Over-TCP)

Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,7 @@ CPU 3%, MEM 24.3% (4.3K/thread)
Another example is [SRS](https://github.com/ossrs/srs), which is a simple, high efficiency and realtime video server,
supports RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH and GB28181.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/22-05-16-State-Threads-for-Internet-Applications)

Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,6 @@ There are some developers that contributed to SRS HEVC feature:

Really appreciated for [mpegts.js](https://github.com/xqq/mpegts.js), which supports HEVC for HTTP-FLV and HTTP-TS.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/23-03-07-Lets-Do-H265-Live-Streaming)
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ GitHub Copilot and I wrote this article.

The code of this feature was written by SRS developers and GitHub Copilot.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/23-04-02-Secure-Your-HTTP-API)
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,7 @@ Although there are still some works to do, it's already a big step for HEVC live

We wrote this article with the help of GitHub Copilot.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/23-04-08-Push-HEVC-via-RTMP-by-OBS)

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ ffmpeg -i rtmp://localhost/live/livestream -c copy \

## Conclusion

By adhering to these instructions, you can effectively live stream to YouTube via RTMP or RTMPS using a web browser. This technique offers a practical alternative to OBS, enabling you to harness the power of WebRTC, SRS, and FFmpeg for a smooth and efficient streaming experience.
By adhering to these instructions, you can effectively live stream to YouTube via RTMP or RTMPS using a web browser.
This technique offers a practical alternative to OBS, enabling you to harness the power of WebRTC, SRS, and FFmpeg
for a smooth and efficient streaming experience.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-05-16-Stream-YouTube-Using-Web-Browser)
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ To back the project, think about donating via OpenCollective.

![](/img/blog-2023-05-22-012.png)

Thanks for watching this video on SRS (Simple Realtime Server). If you found it helpful, please give it a thumbs up and subscribe to our channel for more short videos like this. See you in the next one!
Thanks for watching this video on SRS (Simple Realtime Server). If you found it helpful, please give it a thumbs up
and subscribe to our channel for more short videos like this. See you in the next one!

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-05-22-Unlock-the-Power-of-SRS-Real-World-Use-Cases)

Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ straightforward solution for those building their own streaming services. By fol
in this guide, you can ensure that your live streaming service remains secure and accessible only to
authorized users.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-08-29-Ensuring-Authentication-for-Live-Streaming-Publishing)
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ After publishing your stream on all platforms, you can check the multiple stream

### Conclusion

Live streaming to multiple platforms is an effective way to reach a broader audience and increase engagement. SRS Stack makes this process simple and efficient, allowing you to focus on creating quality content while it takes care of the technical aspects. By following the steps outlined in this blog, you can easily set up live streaming on multiple platforms like YouTube, Twitch, and Facebook, and take your content to the next level.
Live streaming to multiple platforms is an effective way to reach a broader audience and increase engagement.
SRS Stack makes this process simple and efficient, allowing you to focus on creating quality content while it takes
care of the technical aspects. By following the steps outlined in this blog, you can easily set up live streaming
on multiple platforms like YouTube, Twitch, and Facebook, and take your content to the next level.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-09-09-Multi-Platform-Streaming)
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ downloading your live streams is simplified, making it easy for you to manage an
content. By following the steps outlined in this blog, you can quickly and efficiently record your live
streams and make them available for your audience to access whenever they want.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-09-10-Record-Live-Streaming)
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@ experiences. Whether you're hosting a concert, a sports event, or an online cour
live events are the future of entertainment, and SRS Stack is here to help you make the most
of it.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-09-11-Virtual-Live-Events)
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,6 @@ been easier, thanks to SRS Stack. With just a few simple steps, you can set up y
live to various platforms, enhancing your live streaming experience. So, go ahead and give SRS Stack a try, and
enjoy the convenience and flexibility it offers for your IP camera streaming needs.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-10-11-Stream-IP-Camera-Events)
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
slug: Live-Transcoding
title: SRS Stack - Efficient Live Streaming Transcoding for Reducing Bandwidth and Saving Costs
authors: []
tags: [live streaming, transcode, srs, ffmpeg]
custom_edit_url: null
---

# Efficient Live Streaming Transcoding for Reducing Bandwidth and Saving Costs

## Introduction

In today's digital world, live streaming has become an essential tool for businesses, content creators, and
individuals alike. With the increasing number of viewers tuning in to watch live streams, it's crucial to optimize
the streaming experience for everyone, regardless of their internet speed or device capabilities. One effective way
to achieve this is through live streaming transcoding, a process that can help reduce bandwidth and save costs
without compromising on video quality. In this blog, we'll explore the benefits of using SRS Stack for
efficient live streaming transcoding and how it can lead to significant cost savings.

<!--truncate-->

Live streaming transcoding involves converting a live stream from SRS Stack using FFmpeg into various bitrates and
resolutions, before pushing it back to SRS Stack. This process allows for a reduction in bandwidth while maintaining
the same resolution, simply by lowering the bitrate of the stream. As a result, the overall viewing bandwidth is
decreased, leading to cost savings for both the streamer and the viewer.

For instance, consider a live streaming scenario with 10,000 viewers all watching the same 2Mbps bitrate stream.
By transcoding the stream to 1Mbps, the required bandwidth is reduced to 10Gbps, resulting in a 50% cost saving.
This not only benefits the content provider but also ensures a smoother streaming experience for viewers with
varying internet speeds and devices.

Stay tuned as we delve deeper into the world of live streaming transcoding, and learn how to harness the power
of SRS Stack to optimize your streaming experience and save costs.

## Step 1: Create SRS Stack by one click

Creating an SRS Stack is simple and can be done with just one click if you use Digital Ocean droplet.
Please see [How to Setup a Video Streaming Service by 1-Click](./2022-04-09-SRS-Stack-Tutorial.md) for detail.

You can also use Docker to create an SRS Stack with a single command line:

```bash
docker run --rm -it --name srs-stack -v $HOME/data:/data \
-p 2022:2022 -p 2443:2443 -p 1935:1935 -p 8000:8000/udp -p 10080:10080/udp \
ossrs/srs-stack:5
```

After creating the SRS Stack, you can access it through `http://your-server-ip/mgmt`.

## Step 2: Publish a Live Stream to SRS Stack

You can use OBS or FFmpeg to publish a live stream to SRS Stack. You can also set up HTTPS and publish via WebRTC.

![](/img/blog-2023-10-21-01.png)

Once the stream is published, you can preview it using an H5 player or VLC.
Please see [How to Setup a Video Streaming Service by 1-Click](./2022-04-09-SRS-Stack-Tutorial.md) for detail.

## Step 3: Transcode the Live Stream to Lower Bitrate

Suppose you've sent an 8Mbps stream to SRS Stack using OBS, and you can't adjust the bitrate in OBS. This could
be because the stream is published by a vendor you can't control, or you need to record the original high-resolution
stream, or some devices like 4K/8K TVs require the high-resolution stream.

However, most of your viewers watch the live stream on mobile devices, and they don't need an 8Mbps stream. A 2Mbps
stream is sufficient for mobile devices, and their bandwidth may only support a 2Mbps bitrate. In this case, you can
use transcoding to convert the 8Mbps stream into a 2Mbps live stream.

![](/img/blog-2023-10-21-02.png)

After transcoding the stream, you can preview the 2Mbps version or forward it to another live streaming platform.
See [Easily Stream Your RTSP IP Camera to YouTube, Twitch, or Facebook](./2023-10-11-Stream-IP-Camera-Events.md)
for more information. You can also pull the RTMP stream from SRS Stack and forward it elsewhere.

## Check Transcoding Status

You can check the transcoding status in the SRS Stack dashboard.

![](/img/blog-2023-10-21-03.png)

You can click the preview link to check the transcoded stream, or forward it to another live streaming platform.
See [Easily Stream Your RTSP IP Camera to YouTube, Twitch, or Facebook](./2023-10-11-Stream-IP-Camera-Events.md)
for more information.

## Conclusion

In summary, we discussed the benefits of live streaming transcoding using SRS Stack and FFmpeg. Transcoding optimizes
streaming for viewers with different internet speeds and devices, reduces bandwidth usage, and saves costs. We
covered setting up SRS Stack and FFmpeg, creating a configuration file, and pushing transcoded streams back to
SRS Stack. Monitoring and adjusting settings is crucial for optimal viewer experience, and transcoding can also
convert high-resolution streams to lower resolutions for mobile devices.

Welcome for more discussion at [discord](https://discord.gg/bQUPDRqy79).

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.io&path=/lts/blog-en/2023-10-21-Live-Transcoding)
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
slug: Live-Transcoding
title: SRS Stack - 直播转码降低带宽并节约成本
authors: []
tags: [live streaming, transcode, srs, ffmpeg]
custom_edit_url: null
---

# Efficient Live Streaming Transcoding for Reducing Bandwidth and Saving Costs

## Introduction

在当今的数字世界中,直播流已成为企业、内容创作者和个人的必备工具。随着越来越多的观众收看直播,优化直播流体验变得至关重要,
无论观众的网络速度或设备性能如何。实现这一目标的有效方法之一是通过直播转码,这个过程可以在不影响视频质量的情况下降低带宽并节省成本。
在这篇博客中,我们将探讨使用 SRS Stack 进行高效直播转码的好处,以及它如何带来显著的成本节省。

<!--truncate-->

直播转码涉及将 SRS Stack 使用 FFmpeg 转换的直播流转换为不同的比特率和分辨率,然后将其推送回 SRS Stack。这个过程通过降低流的
比特率来降低带宽,同时保持相同的分辨率。因此,整体观看带宽减少,为流媒体提供者和观众节省成本。

例如,考虑一个有 10,000 名观众观看相同 2Mbps 比特率流的直播场景。通过将流转码为 1Mbps,所需带宽减少到 10Gbps,节省了 50% 的成本。
这不仅使内容提供商受益,还确保了具有不同网络速度和设备的观众获得更流畅的观看体验。

请继续关注我们对直播转码世界的深入探讨,并学习如何利用 SRS Stack 的力量优化您的直播体验并节省成本。

## Step 1: Create SRS Stack by one click

创建 SRS Stack 很简单,只需点击一下,如果您使用 Digital Ocean droplet,就可以完成。
请参阅[如何通过 1-Click 设置视频流服务](./2022-04-09-SRS-Stack-Tutorial.md)了解详细信息。

您还可以使用 Docker 通过单个命令行创建 SRS Stack:

```bash
docker run --rm -it --name srs-stack -v $HOME/data:/data \
-p 2022:2022 -p 2443:2443 -p 1935:1935 -p 8000:8000/udp -p 10080:10080/udp \
registry.cn-hangzhou.aliyuncs.com/ossrs/srs-stack:5
```

创建 SRS Stack 后,您可以通过 `http://your-server-ip/mgmt` 访问它。

## Step 2: Publish a Live Stream to SRS Stack

您可以使用 OBS 或 FFmpeg 将直播流发布到 SRS Stack。您还可以设置 HTTPS 并通过 WebRTC 发布。

![](/img/blog-2023-10-21-04.png)

发布流后,您可以使用 H5 播放器或 VLC 预览它。
请参阅[如何通过 1-Click 设置视频流服务](./2022-04-09-SRS-Stack-Tutorial.md)了解详细信息。

## Step 3: Transcode the Live Stream to Lower Bitrate

假设您使用 OBS 将 8Mbps 流发送到 SRS Stack,并且您无法在 OBS 中调整比特率。这可能是因为流是由您无法控制的供应商发布的,或者您需要记录原始高分辨率流,或者某些设备(如 4K/8K 电视)需要高分辨率流。

然而,您的大多数观众在移动设备上观看直播,他们不需要 8Mbps 流。对于移动设备来说,2Mbps 流就足够了,他们的带宽可能只支持 2Mbps 比特率。在这种情况下,您可以使用转码将 8Mbps 流转换为 2Mbps 直播流。

![](/img/blog-2023-10-21-05.png)

转码流后,您可以预览 2Mbps 版本或将其转发到另一个直播平台。
请参阅[轻松将您的 RTSP IP 摄像头流式传输到 YouTube、Twitch 或 Facebook](./2023-10-11-Stream-IP-Camera-Events.md)了解更多信息。您还可以从 SRS Stack 拉取 RTMP 流并将其转发到其他地方。

## Check Transcoding Status

您可以在 SRS Stack 仪表板中检查转码状态。

![](/img/blog-2023-10-21-06.png)

您可以点击预览链接检查转码流,或将其转发到另一个直播平台。
请参阅[轻松将您的 RTSP IP 摄像头流式传输到 YouTube、Twitch 或 Facebook](./2023-10-11-Stream-IP-Camera-Events.md)了解更多信息。

## 结论

总之,我们讨论了使用 SRS Stack 和 FFmpeg 进行直播转码的好处。转码优化了具有不同网络速度和设备的观众的流媒体观看体验,
减少了带宽使用并节省了成本。我们介绍了设置 SRS Stack 和 FFmpeg、创建配置文件以及将转码流推送回 SRS Stack 的方法。
监控和调整设置对于实现最佳观众体验至关重要,转码还可以将高分辨率流转换为适用于移动设备的较低分辨率。

![](https://ossrs.net/gif/v1/sls.gif?site=ossrs.net&path=/lts/blog-zh/2023-10-21-Live-Transcoding)
2 changes: 2 additions & 0 deletions i18n/zh-cn/docusaurus-plugin-content-pages/faq-srs-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ SRS Stack的使用说明,请参考视频[SRS Stack:起步、购买和入门]
* VLive: Use TCP transport when pull RTSP stream. [v5.10.7](https://github.com/ossrs/srs-stack/releases/tag/v5.10.7)
* Refine statistic and report data. v5.10.8
* 改进文件上传按钮,支持多语言. [v5.10.9](https://github.com/ossrs/srs-stack/releases/tag/v5.10.9)
* Report language. v5.10.10
* Transcode: 支持直播转码功能. [v5.10.11](https://github.com/ossrs/srs-stack/releases/tag/v5.10.11)
* v5.9
* Update NGINX HLS CDN guide. v5.9.2
* Move DVR and VoD to others. v5.9.3
Expand Down
2 changes: 2 additions & 0 deletions src/pages/faq-srs-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ The following are the update records for the SRS Stack server.
* VLive: Use TCP transport when pull RTSP stream. [v5.10.7](https://github.com/ossrs/srs-stack/releases/tag/v5.10.7)
* Refine statistic and report data. v5.10.8
* Support file picker with language. [v5.10.9](https://github.com/ossrs/srs-stack/releases/tag/v5.10.9)
* Report language. v5.10.10
* Transcode: Support live stream transcoding. [v5.10.11](https://github.com/ossrs/srs-stack/releases/tag/v5.10.11)
* v5.9
* Update NGINX HLS CDN guide. v5.9.2
* Move DVR and VoD to others. v5.9.3
Expand Down
Binary file added static/img/blog-2023-10-21-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/blog-2023-10-21-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/blog-2023-10-21-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/blog-2023-10-21-04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/blog-2023-10-21-05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/blog-2023-10-21-06.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c5a6d25

Please sign in to comment.