-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
217 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
i18n/en-us/docusaurus-plugin-content-blog/2023-10-21-Live-Transcoding.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
77 changes: 77 additions & 0 deletions
77
i18n/zh-cn/docusaurus-plugin-content-blog/2023-10-21-Live-Transcoding.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.