diff --git a/i18n/zh-cn/docusaurus-plugin-content-pages/faq.md b/i18n/zh-cn/docusaurus-plugin-content-pages/faq.md index 2671bdc2..9b6bae8b 100644 --- a/i18n/zh-cn/docusaurus-plugin-content-pages/faq.md +++ b/i18n/zh-cn/docusaurus-plugin-content-pages/faq.md @@ -16,32 +16,33 @@ > Note: 这是关于SRS的FAQ,如果是云SRS的FAQ请参考[SRS Cloud FAQ](/faq-srs-cloud) - + -### [Video Guides](#video-guides) +### [CDN](#cdn) +* 关于RTMP/HTTP-FLV/WebRTC等直播? + > 1. SRS只支持流协议,比如直播或WebRTC,详细请参考WiKi中关于集群的部分。 +* 关于HLS/DASH等切片直播,或者点播/录制/VoD/DVR? + > 1. SRS可以录制为点播文件。参考 [DVR](/docs/v4/doc/dvr) + > 1. SRS可以生成HLS或DASH。参考 [HLS](/docs/v4/doc/delivery-hls) +* 关于HLS/DASH/VoD/DVR的分发集群? + > 1. 这些都是HTTP文件,HTTP文件分发集群建议使用NGINX,参考 [HLS Cluster](/docs/v4/doc/sample-hls-cluster) + > 1. 可以用NGINX结合SRS Edge分发HTTP-FLV,实现所有HTTP协议的分发,参考 [Nginx For HLS](/docs/v4/doc/nginx-for-hls#work-with-srs-edge-server) -下面是答疑的视频资料,详细讲解了某个话题,如果你的问题类似请直接看视频哈: + -* [FAQ:SRS有哪些文档和资料](https://www.bilibili.com/video/BV1QA4y1S7iU/) SRS有哪些文档资料?先看Usage,在看FAQ,接着是Wiki,还有Issues。如果GitHub访问慢怎么办呢?可以把资料Clone到本地,或者访问Gitee镜像。 -* [FAQ:SRS是否支持STUN和WebRTC的P2P](https://www.bilibili.com/video/BV13t4y1x7QV/) SRS是否支持STUN协议?如何支持WebRTC P2P打洞?SFU和P2P的区别? -* [FAQ:SRS导致WebRTC丢帧如何排查](https://www.bilibili.com/video/BV1LS4y187xU/) RTMP推流到SRS使用WebRTC播放是常见的用法,RTMP是30帧,WebRTC只有10帧,看起来就会卡顿不流畅,这个视频分享了如何排查这类问题。 -* [FAQ:SRS如何实现服务的高可靠和热备](https://www.bilibili.com/video/BV1U34y1776t/) SRS如果挂了,怎么能保障服务不受到影响?如何实现音视频服务的高可靠?如何做流的热备和恢复? -* [FAQ:SRS有哪些Docker镜像](https://www.bilibili.com/video/BV1BZ4y1a7Fg/) Docker是非常好用的技术,SRS提供了完善的Docker镜像,也可以自己打SRS的Docker镜像。 -* [FAQ:SRS如何提交Issue](https://www.bilibili.com/video/BV13v4y1A74N/) 如果碰到问题,怎么判断是否是Issue?怎么排查Issue?如何提交新的Issue?为何提交的Issue被删除? -* [FAQ:SRS为何不支持WebRTC的FEC等复杂算法](https://www.bilibili.com/video/BV1CA4y1f7JW/) 什么是WebRTC的拥塞控制算法?FEC和NACK有何不同、如何选择?为何SRS没有支持复杂的算法?为何说复杂牛逼的算法一般没什么鸟用? -* [FAQ:CDN支持WebRTC的完善度](https://www.bilibili.com/video/BV14r4y1b7cH/) CDN或云厂商是否都支持WebRTC了?为何说是差不多支持了?目前还有哪些问题或坑?都有哪些CDN的直播是支持WebRTC协议的? -* [FAQ:如何实现直播混流或WebRTC的MCU](https://www.bilibili.com/video/BV1L34y1E7D5/) 如何给直播添加LOGO?如何实现直播画中画?如何实现WebRTC转直播?如何实现WebRTC的MCU功能?为何RTC架构大多是SFU而不是MCU?什么时候必须用MCU? -* [FAQ:开源SFU如何选?Janus有哪些问题,何解?](https://www.bilibili.com/video/BV1bR4y1w7X1/) Janus是WebRTC领域使用最广泛也是最好的SFU之一,当然和所有SFU一样它也有一堆的问题,选择开源选的不仅是代码和架构,选择的更是活跃的社区和对方向的判断。 -* [FAQ:如何更低码率达到同等画质](https://www.bilibili.com/video/BV1qB4y197ov/) 在保证画质的前提下,如何降低码率?我们可以使用动态码率,还可以使用相对空闲的客户端CPU交换码率,还可以在业务上优化,特别多平台推流时需要避免上行码率过高。 +### [Console](#console) +* `Pagination`: 关于控制台流和客户端的分页问题,参考 [#3451](https://github.com/ossrs/srs/issues/3451) + > 1. API默认参数为`start=0`, `count=10`,而Console没有支持分页,计划在新的Console支持。 - + -### [RTSP](#rtsp) -* `RTSP`:RTSP推流,RTSP服务器,RTSP播放等 - > 1. SRS支持用Ingest拉RTSP,不支持推RTSP流到SRS,这不是正确的用法,详细原因请参考 [#2304](https://github.com/ossrs/srs/issues/2304) 。 - > 1. 当然RTSP服务器,RTSP播放,更加不会支持,参考 [#476](https://github.com/ossrs/srs/issues/476) - > 1. 如果你需要非常多比如1万路摄像头接入,那么用FFmpeg可能会比较费劲,这么大规模的业务,比较推荐的方案是自己用ST+SRS的代码,实现一个拉RTSP转发的服务器。 - +### [CORS](#cors) +* `CORS`: 关于HTTP API或流的跨域 + > 1. SRS 3.0支持了跨域(CORS),不需要额外的HTTP代理,已经内置支持了,默认就是打开的,参考 [#717](https://github.com/ossrs/srs/issues/717) [#798](https://github.com/ossrs/srs/issues/798) [#1002](https://github.com/ossrs/srs/issues/1002) + > 1. 当然使用Nginx代理服务器,也可以解决跨域问题,这样就不需要在SRS设置了。注意只需要代理API,不要代理流媒体,因为流的带宽消耗太高了,会把代理打挂,也没有必要。 + > 1. 使用Nginx或Caddy代理,提供统一的HTTP/HTTPS服务,参考 [#2881](https://github.com/ossrs/srs/issues/2881) + + ### [CPU and OS](#cpu-and-os) * `CPU and OS`:关于SRS支持的CPU架构和OS操作系统 @@ -53,6 +54,60 @@ > 1. 由于大家在Github下载比较困难,我们提供了gitee的镜像下载,具体请看 [Gitee: Releases](https://gitee.com/ossrs/srs/releases) 每个版本的附件。 > 1. 在Windows平台还有些问题未解决,也会继续完善支持,详细请参考[#2532](https://github.com/ossrs/srs/issues/2532) + + +### [Edge HLS/DVR/RTC](#edge-hls-dvr-rtc) +* `Edge HLS/DVR/RTC`: 关于边缘(Edge)支持HLS/DVR/RTC等 + > 1. 边缘(Edge)是直播的集群,只支持直播流协议比如RTMP和FLV,只有源站才能支持HLS/DVR/RTC,参考 [#1066](https://github.com/ossrs/srs/issues/1066) + > 1. 目前并没有在Edge禁用HLS/DVR/RTC等能力,但未来会禁用,所以请不要这么用,也用不起来。 + > 1. HLS的集群,请参考文档[HLS Edge Cluster](/docs/v5/doc/nginx-for-hls) + > 1. 正在开发WebRTC和SRT的集群能力,参考[#3138](ttps://github.com/ossrs/srs/issues/3138)。 + + + +### [FFmpeg](#ffmpeg) +* `FFmpeg`: 关于FFmpeg相关的问题 + > 1. 找不到FFmpeg,出现`terminate, please restart it`,编译失败`No FFmpeg found`,FFmpeg不支持h.265或其他Codec,这是需要自己编译或者下载FFmpeg,并放到指定的路径后SRS就会检测到,参考 [#1523](https://github.com/ossrs/srs/issues/1523) + > 1. 如果是FFmpeg的使用问题,请一律不要在SRS提Issue,请移步到FFmpeg的社区提交。在SRS提FFmpeg的问题,会被直接删除,不要偷懒。 + + + +### [Features](#features) +* 关于支持的功能,过时的功能,以及计划? + > 1. 每个版本支持的功能不一样,在Github首页会给出来支持的功能,比如[develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/Features.md#features), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/Features.md#features), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#features)。 + > 1. 每个版本的变更也不相同,在Github首页也会给出来具体的变更,比如[develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/CHANGELOG.md#changelog), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/CHANGELOG.md#changelog), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#v3-changes)。 + > 1. 除了新增功能,SRS还会删除不合适的功能,比如RTSP推流,比如srs-librtmp,比如GB的SIP信令等等,这些功能有可能是没有用,有可能是因为不合适,也有可能是以更加合适的方式提供,参考 [#1535](https://github.com/ossrs/srs/issues/1535) + + + +### [GB28181](#gb28181) +* `GB28181`: 关于GB的状态和路线图 + > 1. GB已经放到独立的仓库 [srs-gb28181](https://github.com/ossrs/srs-gb28181), 请参考 [#2845](https://github.com/ossrs/srs/issues/2845) + > 1. GB的使用请参考 [#1500](https://github.com/ossrs/srs/issues/1500) ,目前GB还是在[feature/gb28181](https://github.com/ossrs/srs-gb28181/tree/feature/gb28181)分支,稳定后才会合并到develop然后release,预计在SRS 5.0发布。 + > 1. SRS支持GB不会支持全,只会作为接入协议。关注度比较高的[对讲](https://github.com/ossrs/srs-gb28181/issues/1898)有计划支持。 + + + +### [Help](#help) +* 微信群问问题没人回答?社区提问的艺术? + > 1. 请先在社区的各种文档中搜索,不要问已经存在的答案的问题。 + > 1. 请详细描述问题的背景,请表现出自己已经做出的努力。 + > 1. 开源社区意味着需要你自己能解决问题,如果不行,请考虑付费咨询。 + + + +### [HLS Fragments](#hls-fragments) +* `HLS Fragment Duration`: 关于HLS切片时长 + > 1. HLS切片时长,和GOP长度、是否等待关键帧`hls_wait_keyframe`,切片时长`hls_fragment`,三个因素决定的。 + > 1. 举例来说,GOP若设置为`2s`,切片长度`hls_fragment:5`,等待关键帧`hls_wait_keyframe:on`,那么实际每个TS切片可能在5~6秒左右,因为需要等待一个完整的GOP才能关闭切片。 + > 1. 举例来说,GOP若设置为`10s`,切片长度`hls_fragment:5`,等待关键帧`hls_wait_keyframe:on`,那么实际每个TS切片也是10秒以上。 + > 1. 举例来说,GOP若设置为`10s`,切片长度`hls_fragment:5`,等待关键帧`hls_wait_keyframe:off`,那么实际每个TS切片是5秒左右。切片不是关键帧开头,所以有些播放器起播可能会花屏,或者出现画面比较慢。 + > 1. 举例来说,GOP若设置为`2s`,切片长度`hls_fragment:2`,等待关键帧`hls_wait_keyframe:on`,那么实际每个TS切片可能在2秒左右。这样HLS的延迟比较低,而且不会有花屏或解码问题,但是由于GOP比较小,所以编码质量会稍微有所损失。 + > 1. 虽然切片大小可以设置为小于1秒,比如`hls_fragment:0.5`,但是`#EXT-X-TARGETDURATION`还是1秒,因为它是个整数。而且切片太小,会导致切片数量过多,不利于CDN缓存,也不利于播放器缓存,所以不建议设置太小的切片。 + > 1. 若希望降低延迟,不要将切片设置为1秒以下,设置为1秒或2秒会比较合适。因为就算设置为1秒,由于播放器有取切片的策略,有缓存策略,并不代表延迟就能和RTMP或HTTP-FLV流一样。一般HLS的最小延迟都在5秒以上。 + > 1. GOP就是两个关键帧之间的帧数目,需要在编码器上设置,比如FFmpeg的参数`-r 25 -g 50`,就是帧率为25fps,GOP为50帧,也就是2秒。 + > 1. OBS上是有个`Keyframe Interval(0=auto)`,它最小是`1s`,如果设置为0实际上是代表自动,并不是最低延迟设置。低延迟建议设置为1s或2s。 + ### [HTTP API](#http-api) @@ -70,12 +125,6 @@ > 1. 可以参考[srs-cloud](https://github.com/ossrs/srs-cloud/tree/main/hooks)中DVR的实现。 > 1. SRS不会支持动态DVR,但给出了一些方案,也可以参考 [#1577](https://github.com/ossrs/srs/issues/1577) - - -### [Console](#console) -* `Pagination`: 关于控制台流和客户端的分页问题,参考 [#3451](https://github.com/ossrs/srs/issues/3451) - > 1. API默认参数为`start=0`, `count=10`,而Console没有支持分页,计划在新的Console支持。 - ### [HTTPS & HTTP2/3](#https-h2-3) @@ -88,7 +137,34 @@ * `HTTP2`: 关于HTTP2-FLV或HTTP2 HLS等。 > 1. SRS不会实现HTTP2或者HTTP3,而是推荐使用反向代理来转换协议,比如Nginx或者Go。 > 1. 由于HTTP是非常非常成熟的协议,现有的工具和反向代理能力非常完善,SRS没有必要实现完整的协议。 - > 1. SRS已经实现的是一个简单的HTTP 1.0的协议,主要提供API和Callback的能力。 + > 1. SRS已经实现的是一个简单的HTTP 1.0的协议,主要提供API和Callback的能力。 + + + +### [Latency](#latency) +* `Latency`: 关于如何降低延迟,如何做低延迟直播,WebRTC延迟多少。 + > 1. 直播延迟一般1到3秒,WebRTC延迟在100ms左右,为何自己搭出来的延迟很大? + > 1. 最常见的延迟大的原因,是用VLC播放器,这个播放器的延迟就是几十秒,请换成SRS的H5播放器。 + > 1. 延迟是和每个环节都相关,不仅仅是SRS降低延迟就可以,还有推流工具(FFmpeg/OBS)和播放器都相关,具体请参考 [Realtime](/docs/v4/doc/sample-realtime) 一步步操作,别上来就自己弄些骚操作操作,先按文档搭出来低延迟的环境。 + > 1. 如果一步步操作还是发现延迟高,怎么排查呢?可以参考 [#2742](https://github.com/ossrs/srs/issues/2742) + + + +### [Performance](#performance) and [Memory](#memory) +* `Performance`: 关于性能优化,并发,压测,内存泄漏,野指针 + > 1. 性能是一个综合话题,是项目的质量、支持的容量和并发、如何优化性能等比较笼统的叫法,甚至也包含内存问题,比如内存泄漏(导致性能降低)、越界和野指针问题。 + > 1. 如果是需要了解SRS的并发,必须分为直播和WebRTC单独的并发,直播可以用[srs-bench](https://github.com/ossrs/srs-bench),WebRTC可以用[feature/rtc](https://github.com/ossrs/srs-bench/tree/feature/rtc)分支压测,获取特定码率和延迟以及业务特点下,你的硬件和软件环境所能支持的并发数。 + > 1. SRS也提供了官方的并发数据,具体可以参考 [Performance](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/PERFORMANCE.md#performance) ,还给出了如何测量这些并发,以及什么条件下的数据,还有具体的优化代码。 + > 1. 如果是需要查性能问题,或者内存泄漏,或者野指针问题,必须使用系统的相关工具,比如perf、valgrind或者gperftools等工具,具体请参考 [SRS性能(CPU)、内存优化工具用法](https://www.jianshu.com/p/6d4a89359352) 或者 [Perf](/docs/v4/doc/perf) 。 + > 1. 特别强调,valgrid从SRS 3.0(含)开始已经支持,ST的patch已经打上了。 + + + +### [RTSP](#rtsp) +* `RTSP`:RTSP推流,RTSP服务器,RTSP播放等 + > 1. SRS支持用Ingest拉RTSP,不支持推RTSP流到SRS,这不是正确的用法,详细原因请参考 [#2304](https://github.com/ossrs/srs/issues/2304) 。 + > 1. 当然RTSP服务器,RTSP播放,更加不会支持,参考 [#476](https://github.com/ossrs/srs/issues/476) + > 1. 如果你需要非常多比如1万路摄像头接入,那么用FFmpeg可能会比较费劲,这么大规模的业务,比较推荐的方案是自己用ST+SRS的代码,实现一个拉RTSP转发的服务器。 @@ -97,21 +173,30 @@ > 1. 推流的Source对象没有清理,推流路数增多内存会增长,暂时可以使用[Gracefully Quit](https://github.com/ossrs/srs/issues/413#issuecomment-917771521)绕开,会在未来解决,参考 [#413](https://github.com/ossrs/srs/issues/413) > 1. 再次强调,可以用[Gracefully Quit](https://github.com/ossrs/srs/issues/413#issuecomment-917771521)绕开,就算未来解决了这个问题,这个方案也是最靠谱和最优的,重启大法好。 - + -### [Edge HLS/DVR/RTC](#edge-hls-dvr-rtc) -* `Edge HLS/DVR/RTC`: 关于边缘(Edge)支持HLS/DVR/RTC等 - > 1. 边缘(Edge)是直播的集群,只支持直播流协议比如RTMP和FLV,只有源站才能支持HLS/DVR/RTC,参考 [#1066](https://github.com/ossrs/srs/issues/1066) - > 1. 目前并没有在Edge禁用HLS/DVR/RTC等能力,但未来会禁用,所以请不要这么用,也用不起来。 - > 1. HLS的集群,请参考文档[HLS Edge Cluster](/docs/v5/doc/nginx-for-hls) - > 1. 正在开发WebRTC和SRT的集群能力,参考[#3138](ttps://github.com/ossrs/srs/issues/3138)。 +### [Video Guides](#video-guides) - +下面是答疑的视频资料,详细讲解了某个话题,如果你的问题类似请直接看视频哈: -### [FFmpeg](#ffmpeg) -* `FFmpeg`: 关于FFmpeg相关的问题 - > 1. 找不到FFmpeg,出现`terminate, please restart it`,编译失败`No FFmpeg found`,FFmpeg不支持h.265或其他Codec,这是需要自己编译或者下载FFmpeg,并放到指定的路径后SRS就会检测到,参考 [#1523](https://github.com/ossrs/srs/issues/1523) - > 1. 如果是FFmpeg的使用问题,请一律不要在SRS提Issue,请移步到FFmpeg的社区提交。在SRS提FFmpeg的问题,会被直接删除,不要偷懒。 +* [FAQ:SRS有哪些文档和资料](https://www.bilibili.com/video/BV1QA4y1S7iU/) SRS有哪些文档资料?先看Usage,在看FAQ,接着是Wiki,还有Issues。如果GitHub访问慢怎么办呢?可以把资料Clone到本地,或者访问Gitee镜像。 +* [FAQ:SRS是否支持STUN和WebRTC的P2P](https://www.bilibili.com/video/BV13t4y1x7QV/) SRS是否支持STUN协议?如何支持WebRTC P2P打洞?SFU和P2P的区别? +* [FAQ:SRS导致WebRTC丢帧如何排查](https://www.bilibili.com/video/BV1LS4y187xU/) RTMP推流到SRS使用WebRTC播放是常见的用法,RTMP是30帧,WebRTC只有10帧,看起来就会卡顿不流畅,这个视频分享了如何排查这类问题。 +* [FAQ:SRS如何实现服务的高可靠和热备](https://www.bilibili.com/video/BV1U34y1776t/) SRS如果挂了,怎么能保障服务不受到影响?如何实现音视频服务的高可靠?如何做流的热备和恢复? +* [FAQ:SRS有哪些Docker镜像](https://www.bilibili.com/video/BV1BZ4y1a7Fg/) Docker是非常好用的技术,SRS提供了完善的Docker镜像,也可以自己打SRS的Docker镜像。 +* [FAQ:SRS如何提交Issue](https://www.bilibili.com/video/BV13v4y1A74N/) 如果碰到问题,怎么判断是否是Issue?怎么排查Issue?如何提交新的Issue?为何提交的Issue被删除? +* [FAQ:SRS为何不支持WebRTC的FEC等复杂算法](https://www.bilibili.com/video/BV1CA4y1f7JW/) 什么是WebRTC的拥塞控制算法?FEC和NACK有何不同、如何选择?为何SRS没有支持复杂的算法?为何说复杂牛逼的算法一般没什么鸟用? +* [FAQ:CDN支持WebRTC的完善度](https://www.bilibili.com/video/BV14r4y1b7cH/) CDN或云厂商是否都支持WebRTC了?为何说是差不多支持了?目前还有哪些问题或坑?都有哪些CDN的直播是支持WebRTC协议的? +* [FAQ:如何实现直播混流或WebRTC的MCU](https://www.bilibili.com/video/BV1L34y1E7D5/) 如何给直播添加LOGO?如何实现直播画中画?如何实现WebRTC转直播?如何实现WebRTC的MCU功能?为何RTC架构大多是SFU而不是MCU?什么时候必须用MCU? +* [FAQ:开源SFU如何选?Janus有哪些问题,何解?](https://www.bilibili.com/video/BV1bR4y1w7X1/) Janus是WebRTC领域使用最广泛也是最好的SFU之一,当然和所有SFU一样它也有一堆的问题,选择开源选的不仅是代码和架构,选择的更是活跃的社区和对方向的判断。 +* [FAQ:如何更低码率达到同等画质](https://www.bilibili.com/video/BV1qB4y197ov/) 在保证画质的前提下,如何降低码率?我们可以使用动态码率,还可以使用相对空闲的客户端CPU交换码率,还可以在业务上优化,特别多平台推流时需要避免上行码率过高。 + + + +### [WebRTC Cluster](#webrtc-cluster) +* `WebRTC+Cluster`: 关于WebRTC集群的相关问题 + > 1. WebRTC集群并不是直播集群(Edge+Origin Cluster),而是叫WebRTC级联,参考[#2091](https://github.com/ossrs/srs/issues/2091) + > 1. 除了集群方案,SRS还会支持Proxy方案,比集群更简单,也会具备扩展性和容灾能力,参考[#3138](https://github.com/ossrs/srs/issues/3138) @@ -121,13 +206,6 @@ > 1. SRS 4.0.174之前可以,更新到之后就不工作了,是因为`rtc.conf`不默认开启RTMP转RTC,需要使用`rtmp2rtc.conf`或者`rtc2rtmp.conf`,参考 71ed6e5dc51df06eaa90637992731a7e75eabcd7 > 1. 未来也不会自动开启RTC和RTMP的转换,因为SRS必须要考虑到独立的RTMP和独立的RTC场景,转换的场景只是其中一个,但是由于转换的场景导致严重的性能问题,所以不能默认开启,会导致独立的场景出现大问题。 - - -### [WebRTC Cluster](#webrtc-cluster) -* `WebRTC+Cluster`: 关于WebRTC集群的相关问题 - > 1. WebRTC集群并不是直播集群(Edge+Origin Cluster),而是叫WebRTC级联,参考[#2091](https://github.com/ossrs/srs/issues/2091) - > 1. 除了集群方案,SRS还会支持Proxy方案,比集群更简单,也会具备扩展性和容灾能力,参考[#3138](https://github.com/ossrs/srs/issues/3138) - ### [WebRTC](#webrtc) @@ -140,89 +218,12 @@ > 1. 还有不太常见,用官网的播放器,是不能播放非HTTPS的SRS的流,这也是Chrome的安全策略问题,参考 [#2787](https://github.com/ossrs/srs/issues/2787) > 1. 在docker映射端口时,若改变了端口需要改配置文件,或者通过eip指定,参考 [#2907](https://github.com/ossrs/srs/issues/2907) - - -### [GB28181](#gb28181) -* `GB28181`: 关于GB的状态和路线图 - > 1. GB已经放到独立的仓库 [srs-gb28181](https://github.com/ossrs/srs-gb28181), 请参考 [#2845](https://github.com/ossrs/srs/issues/2845) - > 1. GB的使用请参考 [#1500](https://github.com/ossrs/srs/issues/1500) ,目前GB还是在[feature/gb28181](https://github.com/ossrs/srs-gb28181/tree/feature/gb28181)分支,稳定后才会合并到develop然后release,预计在SRS 5.0发布。 - > 1. SRS支持GB不会支持全,只会作为接入协议。关注度比较高的[对讲](https://github.com/ossrs/srs-gb28181/issues/1898)有计划支持。 - - - -### [CDN](#cdn) -* 关于RTMP/HTTP-FLV/WebRTC等直播? - > 1. SRS只支持流协议,比如直播或WebRTC,详细请参考WiKi中关于集群的部分。 -* 关于HLS/DASH等切片直播,或者点播/录制/VoD/DVR? - > 1. SRS可以录制为点播文件。参考 [DVR](/docs/v4/doc/dvr) - > 1. SRS可以生成HLS或DASH。参考 [HLS](/docs/v4/doc/delivery-hls) -* 关于HLS/DASH/VoD/DVR的分发集群? - > 1. 这些都是HTTP文件,HTTP文件分发集群建议使用NGINX,参考 [HLS Cluster](/docs/v4/doc/sample-hls-cluster) - > 1. 可以用NGINX结合SRS Edge分发HTTP-FLV,实现所有HTTP协议的分发,参考 [Nginx For HLS](/docs/v4/doc/nginx-for-hls#work-with-srs-edge-server) - - - -### [CORS](#cors) -* `CORS`: 关于HTTP API或流的跨域 - > 1. SRS 3.0支持了跨域(CORS),不需要额外的HTTP代理,已经内置支持了,默认就是打开的,参考 [#717](https://github.com/ossrs/srs/issues/717) [#798](https://github.com/ossrs/srs/issues/798) [#1002](https://github.com/ossrs/srs/issues/1002) - > 1. 当然使用Nginx代理服务器,也可以解决跨域问题,这样就不需要在SRS设置了。注意只需要代理API,不要代理流媒体,因为流的带宽消耗太高了,会把代理打挂,也没有必要。 - > 1. 使用Nginx或Caddy代理,提供统一的HTTP/HTTPS服务,参考 [#2881](https://github.com/ossrs/srs/issues/2881) - ### [Websocket](#websocket) * `WebSocket/WS`:如何支持WS-FLV或WS-TS? > 1. 可以用一个Go代理转一次,几行关键代码稳定又可靠,参考[mse.go](https://github.com/winlinvip/videojs-flow/blob/master/demo/mse.go) - - -### [Latency](#latency) -* `Latency`: 关于如何降低延迟,如何做低延迟直播,WebRTC延迟多少。 - > 1. 直播延迟一般1到3秒,WebRTC延迟在100ms左右,为何自己搭出来的延迟很大? - > 1. 最常见的延迟大的原因,是用VLC播放器,这个播放器的延迟就是几十秒,请换成SRS的H5播放器。 - > 1. 延迟是和每个环节都相关,不仅仅是SRS降低延迟就可以,还有推流工具(FFmpeg/OBS)和播放器都相关,具体请参考 [Realtime](/docs/v4/doc/sample-realtime) 一步步操作,别上来就自己弄些骚操作操作,先按文档搭出来低延迟的环境。 - > 1. 如果一步步操作还是发现延迟高,怎么排查呢?可以参考 [#2742](https://github.com/ossrs/srs/issues/2742) - - - -### [HLS Fragments](#hls-fragments) -* `HLS Fragment Duration`: 关于HLS切片时长 - > 1. HLS切片时长,和GOP长度、是否等待关键帧`hls_wait_keyframe`,切片时长`hls_fragment`,三个因素决定的。 - > 1. 举例来说,GOP若设置为`2s`,切片长度`hls_fragment:5`,等待关键帧`hls_wait_keyframe:on`,那么实际每个TS切片可能在5~6秒左右,因为需要等待一个完整的GOP才能关闭切片。 - > 1. 举例来说,GOP若设置为`10s`,切片长度`hls_fragment:5`,等待关键帧`hls_wait_keyframe:on`,那么实际每个TS切片也是10秒以上。 - > 1. 举例来说,GOP若设置为`10s`,切片长度`hls_fragment:5`,等待关键帧`hls_wait_keyframe:off`,那么实际每个TS切片是5秒左右。切片不是关键帧开头,所以有些播放器起播可能会花屏,或者出现画面比较慢。 - > 1. 举例来说,GOP若设置为`2s`,切片长度`hls_fragment:2`,等待关键帧`hls_wait_keyframe:on`,那么实际每个TS切片可能在2秒左右。这样HLS的延迟比较低,而且不会有花屏或解码问题,但是由于GOP比较小,所以编码质量会稍微有所损失。 - > 1. 虽然切片大小可以设置为小于1秒,比如`hls_fragment:0.5`,但是`#EXT-X-TARGETDURATION`还是1秒,因为它是个整数。而且切片太小,会导致切片数量过多,不利于CDN缓存,也不利于播放器缓存,所以不建议设置太小的切片。 - > 1. 若希望降低延迟,不要将切片设置为1秒以下,设置为1秒或2秒会比较合适。因为就算设置为1秒,由于播放器有取切片的策略,有缓存策略,并不代表延迟就能和RTMP或HTTP-FLV流一样。一般HLS的最小延迟都在5秒以上。 - > 1. GOP就是两个关键帧之间的帧数目,需要在编码器上设置,比如FFmpeg的参数`-r 25 -g 50`,就是帧率为25fps,GOP为50帧,也就是2秒。 - > 1. OBS上是有个`Keyframe Interval(0=auto)`,它最小是`1s`,如果设置为0实际上是代表自动,并不是最低延迟设置。低延迟建议设置为1s或2s。 - - - -### [Performance](#performance) and [Memory](#memory) -* `Performance`: 关于性能优化,并发,压测,内存泄漏,野指针 - > 1. 性能是一个综合话题,是项目的质量、支持的容量和并发、如何优化性能等比较笼统的叫法,甚至也包含内存问题,比如内存泄漏(导致性能降低)、越界和野指针问题。 - > 1. 如果是需要了解SRS的并发,必须分为直播和WebRTC单独的并发,直播可以用[srs-bench](https://github.com/ossrs/srs-bench),WebRTC可以用[feature/rtc](https://github.com/ossrs/srs-bench/tree/feature/rtc)分支压测,获取特定码率和延迟以及业务特点下,你的硬件和软件环境所能支持的并发数。 - > 1. SRS也提供了官方的并发数据,具体可以参考 [Performance](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/PERFORMANCE.md#performance) ,还给出了如何测量这些并发,以及什么条件下的数据,还有具体的优化代码。 - > 1. 如果是需要查性能问题,或者内存泄漏,或者野指针问题,必须使用系统的相关工具,比如perf、valgrind或者gperftools等工具,具体请参考 [SRS性能(CPU)、内存优化工具用法](https://www.jianshu.com/p/6d4a89359352) 或者 [Perf](/docs/v4/doc/perf) 。 - > 1. 特别强调,valgrid从SRS 3.0(含)开始已经支持,ST的patch已经打上了。 - - - -### [Features](#features) -* 关于支持的功能,过时的功能,以及计划? - > 1. 每个版本支持的功能不一样,在Github首页会给出来支持的功能,比如[develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/Features.md#features), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/Features.md#features), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#features)。 - > 1. 每个版本的变更也不相同,在Github首页也会给出来具体的变更,比如[develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/CHANGELOG.md#changelog), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/CHANGELOG.md#changelog), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#v3-changes)。 - > 1. 除了新增功能,SRS还会删除不合适的功能,比如RTSP推流,比如srs-librtmp,比如GB的SIP信令等等,这些功能有可能是没有用,有可能是因为不合适,也有可能是以更加合适的方式提供,参考 [#1535](https://github.com/ossrs/srs/issues/1535) - - - -### [Help](#help) -* 微信群问问题没人回答?社区提问的艺术? - > 1. 请先在社区的各种文档中搜索,不要问已经存在的答案的问题。 - > 1. 请详细描述问题的背景,请表现出自己已经做出的努力。 - > 1. 开源社区意味着需要你自己能解决问题,如果不行,请考虑付费咨询。 - ## Deleting 如果不符合要求的Issue,一般会打标为Deleting,会在一两周后删除,并回复: diff --git a/src/pages/faq.md b/src/pages/faq.md index 997a6992..6ee29422 100644 --- a/src/pages/faq.md +++ b/src/pages/faq.md @@ -19,23 +19,31 @@ Issue according to the requirements. > Note: This is FAQ about SRS, please see [SRS Cloud FAQ](/faq-srs-cloud) for SRS Cloud. - + -### [Video Guides](#video-guides) +### [CDN](#cdn) +* Questions about RTMP/HTTP-FLV/WebRTC live streaming? + > 1. SRS only supports streaming protocols, such as live streaming or WebRTC. For details, please refer to the cluster section in the WiKi. +* Questions about HLS/DASH segmented live streaming, or on-demand/recording/VoD/DVR? + > 1. SRS can record as on-demand files. Please refer to [DVR](/docs/v4/doc/dvr) + > 1. SRS can generate HLS or DASH. Please refer to [HLS](/docs/v4/doc/delivery-hls) +* Questions about HLS/DASH/VoD/DVR distribution clusters? + > 1. These are all HTTP files, and for HTTP file distribution clusters, it is recommended to use NGINX. Please refer to [HLS Cluster](/docs/v4/doc/sample-hls-cluster) + > 1. You can use NGINX in conjunction with SRS Edge to distribute HTTP-FLV, implementing the distribution of all HTTP protocols. Please refer to [Nginx For HLS](/docs/v4/doc/nginx-for-hls#work-with-srs-edge-server) -Here is the video material for the Q&A session, which provides a detailed explanation of a certain -topic. If your question is similar, please watch the video directly: + -* [Unlock the Power of SRS: Real-World Use Cases and Boosting Your Business with Simple Realtime Server.](https://youtu.be/WChYr6z7EpY) -* [Ultra Low Latency Streaming with OBS WHIP](https://youtu.be/SqrazCPWcV0) +### [Console](#console) +* `Pagination`: For pagination issues related to console streams and clients, refer to [#3451](https://github.com/ossrs/srs/issues/3451) + > 1. The default API parameters are `start=0`, `count=10`, and the Console does not support pagination. It is planned to be supported in the new Console. - + -### [RTSP](#rtsp) -* `RTSP`: RTSP streaming, RTSP server, RTSP playback, etc. - > 1. SRS supports pulling RTSP with Ingest, but does not support pushing RTSP stream to SRS, which is not the correct usage. For detailed reasons, please refer to [#2304](https://github.com/ossrs/srs/issues/2304). - > 1. Of course, RTSP server and RTSP playback will not be supported either, please refer to [#476](https://github.com/ossrs/srs/issues/476). - > 1. If you need a large number of camera connections, such as 10,000, using FFmpeg may be more difficult. For such large-scale businesses, the recommended solution is to use ST+SRS code to implement an RTSP forwarding server. +### [CORS](#cors) +* `CORS`: Questions about cross-domain access for HTTP APIs or streams + > 1. SRS 3.0 supports cross-domain (CORS) access, so there is no need for additional HTTP proxies, as it is built-in and enabled by default. Please refer to [#717](https://github.com/ossrs/srs/issues/717) [#798](https://github.com/ossrs/srs/issues/798) [#1002](https://github.com/ossrs/srs/issues/1002) + > 1. Of course, using an Nginx proxy server can also solve cross-domain issues, so there is no need to set it in SRS. Note that you only need to proxy the API, not the media stream, because the bandwidth consumption of the stream is too high, which will cause the proxy to crash and is not necessary. + > 1. Use Nginx or Caddy proxy to provide a unified HTTP/HTTPS service. Please refer to [#2881](https://github.com/ossrs/srs/issues/2881) @@ -49,6 +57,60 @@ topic. If your question is similar, please watch the video directly: > 1. Since it is difficult for everyone to download from Github, we provide a Gitee mirror download. Please see [Gitee: Releases](https://gitee.com/ossrs/srs/releases) for each version's attachments. > 1. There are still some issues on the Windows platform that have not been resolved, and we will continue to improve support. For details, please refer to [#2532](https://github.com/ossrs/srs/issues/2532). + + +### [Edge HLS/DVR/RTC](#edge-hls-dvr-rtc) +* `Edge HLS/DVR/RTC`: About Edge support for HLS/DVR/RTC, etc. + > 1. Edge is a live streaming cluster that only supports live streaming protocols such as RTMP and FLV. Only the origin server can support HLS/DVR/RTC. Refer to [#1066](https://github.com/ossrs/srs/issues/1066) + > 1. Currently, there is no restriction on using HLS/DVR/RTC capabilities in Edge, but they will be disabled in the future. So please do not use them this way, and they won't work. + > 1. For the HLS cluster, please refer to the documentation [HLS Edge Cluster](/docs/v5/doc/nginx-for-hls) + > 1. The development of WebRTC and SRT clustering capabilities is in progress. Refer to [#3138](ttps://github.com/ossrs/srs/issues/3138) + + + +### [FFmpeg](#ffmpeg) +* `FFmpeg`: Questions related to FFmpeg + > 1. If FFmpeg is not found, the error `terminate, please restart it` appears, compilation fails with `No FFmpeg found`, or FFmpeg does not support h.265 or other codecs, you need to compile or download FFmpeg yourself and place it in the specified path, then SRS will detect it. Please refer to [#1523](https://github.com/ossrs/srs/issues/1523) + > 1. If you have questions about using FFmpeg, please do not submit issues in SRS. Instead, go to the FFmpeg community. Issues about FFmpeg in SRS will be deleted directly. Don't be lazy. + + + +### [Features](#features) +* About supported features, outdated features, and plans? + > 1. Each version supports different features, which are listed on the Github homepage, such as [develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/Features.md#features), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/Features.md#features), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#features). + > 1. The changes in each version are also different and are listed on the Github homepage, such as [develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/CHANGELOG.md#changelog), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/CHANGELOG.md#changelog), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#v3-changes). + > 1. In addition to adding new features, SRS will also remove unsuitable features, such as RTSP push streaming, srs-librtmp, GB SIP signaling, etc. These features may be useless, inappropriate, or provided in a more suitable way. See [#1535](https://github.com/ossrs/srs/issues/1535) for more information. + + + +### [GB28181](#gb28181) +* `GB28181`: Questions about GB status and roadmap + > 1. GB has been moved to a separate repository [srs-gb28181](https://github.com/ossrs/srs-gb28181), please refer to [#2845](https://github.com/ossrs/srs/issues/2845) + > 1. For GB usage, please refer to [#1500](https://github.com/ossrs/srs/issues/1500). Currently, GB is still in the [feature/gb28181](https://github.com/ossrs/srs-gb28181/tree/feature/gb28181) branch. It will be merged into develop and then released after it is stable. It is expected to be released in SRS 5.0. + > 1. SRS support for GB will not be comprehensive, and will only be used as an access protocol. The highly concerned [intercom](https://github.com/ossrs/srs-gb28181/issues/1898) is planned to be supported. + + + +### [Help](#help) +* No one answers questions in the WeChat group? The art of asking questions in the community? + > 1. Please search in the various documents of the community first, and do not ask questions that already have answers. + > 1. Please describe the background of the problem in detail, and show the efforts you have made. + > 1. Open source community means you need to be able to solve problems yourself. If not, please consider paid consultation. + + + +### [HLS Fragments](#hls-fragments) +* `HLS Fragment Duration`: About HLS segment duration + > 1. HLS segment duration is determined by three factors: GOP length, whether to wait for a keyframe (`hls_wait_keyframe`), and segment duration (`hls_fragment`). + > 1. For example, if the GOP is set to 2s, the segment length is `hls_fragment:5`, and `hls_wait_keyframe:on`, then the actual duration of each TS segment may be around 5~6 seconds, as it needs to wait for a complete GOP before closing the segment. + > 1. For example, if the GOP is set to 10s, the segment length is `hls_fragment:5`, and `hls_wait_keyframe:on`, then the actual duration of each TS segment is also over 10 seconds. + > 1. For example, if the GOP is set to 10s, the segment length is `hls_fragment:5`, and `hls_wait_keyframe:off`, then the actual duration of each TS segment is around 5 seconds. The segment does not start with a keyframe, so some players may experience screen artifacts or slower video playback. + > 1. For example, if the GOP is set to 2s, the segment length is `hls_fragment:2`, and `hls_wait_keyframe:on`, then the actual duration of each TS segment may be around 2 seconds. This way, the HLS delay is relatively low, and there will be no screen artifacts or decoding issues, but the encoding quality may be slightly compromised due to the smaller GOP. + > 1. Although the segment size can be set to less than 1 second, such as `hls_fragment:0.5`, the `#EXT-X-TARGETDURATION` is still 1 second because it is an integer. Moreover, having too small segments can lead to an excessive number of segments, which is not conducive to CDN caching or player caching, so it is not recommended to set too small segments. + > 1. If you want to reduce latency, do not set the segment duration to less than 1 second; setting it to 1 or 2 seconds is more appropriate. Because even if it is set to 1 second, due to the player's segment fetching strategy and caching policy, the latency will not be the same as RTMP or HTTP-FLV streams. The minimum latency for HLS is generally over 5 seconds. + > 1. GOP refers to the number of frames between two keyframes, which needs to be set in the encoder. For example, the FFmpeg parameter `-r 25 -g 50` sets the frame rate to 25fps and the GOP to 50 frames, which is equivalent to 2 seconds. + > 1. In OBS, there is a `Keyframe Interval(0=auto)` setting. Its minimum value is 1s. If set to 0, it actually means automatic, not the lowest latency setting. For low latency, it is recommended to set it to 1s or 2s. + ### [HTTP API](#http-api) @@ -66,12 +128,6 @@ topic. If your question is similar, please watch the video directly: > 1. You can refer to the DVR implementation in [srs-cloud](https://github.com/ossrs/srs-cloud/tree/main/hooks). > 1. SRS will not support dynamic DVR, but some solutions are provided. You can also refer to [#1577](https://github.com/ossrs/srs/issues/1577). - - -### [Console](#console) -* `Pagination`: For pagination issues related to console streams and clients, refer to [#3451](https://github.com/ossrs/srs/issues/3451) - > 1. The default API parameters are `start=0`, `count=10`, and the Console does not support pagination. It is planned to be supported in the new Console. - ### [HTTPS & HTTP2/3](#https-h2-3) @@ -86,6 +142,33 @@ topic. If your question is similar, please watch the video directly: > 1. Since HTTP is a very mature protocol, existing tools and reverse proxy capabilities are very comprehensive, and SRS does not need to implement a complete protocol. > 1. SRS has implemented a simple HTTP 1.0 protocol, mainly providing API and Callback capabilities. + + +### [Latency](#latency) +* `Latency`: Questions about how to reduce latency, how to do low-latency live streaming, and how much latency WebRTC has. + > 1. Live streaming latency is generally 1 to 3 seconds, WebRTC latency is around 100ms, why is the latency of the self-built environment so high? + > 1. The most common reason for high latency is using the VLC player, which has a latency of tens of seconds. Please switch to the SRS H5 player. + > 1. Latency is related to each link, not just SRS reducing latency. It is also related to the push tool (FFmpeg/OBS) and the player. Please refer to [Realtime](/docs/v4/doc/sample-realtime) and follow the steps to set up a low-latency environment. Don't start with your own fancy operations, just follow the documentation. + > 1. If you still find high latency after following the steps, how to troubleshoot? Please refer to [#2742](https://github.com/ossrs/srs/issues/2742) + + + +### [Performance](#performance) and [Memory](#memory) +* `Performance`: About performance optimization, concurrency, stress testing, memory leaks, and wild pointers + > 1. Performance is a comprehensive topic, including the quality of the project, the capacity and concurrency it supports, how to optimize performance, and even memory issues, such as memory leaks (leading to reduced performance), out-of-bounds and wild pointer problems. + > 1. If you need to understand the concurrency of SRS, you must divide it into separate concurrency for live streaming and WebRTC. Live streaming can use [srs-bench](https://github.com/ossrs/srs-bench), and WebRTC can use the [feature/rtc](https://github.com/ossrs/srs-bench/tree/feature/rtc) branch for stress testing to obtain the concurrency supported by your hardware and software environment under specific bitrates, latency, and business characteristics. + > 1. SRS also provides official concurrency data, which can be found in [Performance](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/PERFORMANCE.md#performance). It also explains how to measure this concurrency, the conditions under which the data is obtained, and specific optimization code. + > 1. If you need to investigate performance issues, memory leaks, or wild pointer problems, you must use system-related tools such as perf, valgrind, or gperftools. For more information, please refer to [SRS Performance (CPU), Memory Optimization Tool Usage](https://www.jianshu.com/p/6d4a89359352) or [Perf](/docs/v4/doc/perf). + > 1. It is important to note that valgrind has been supported since SRS 3.0 (inclusive), and the ST patch has been applied. + + + +### [RTSP](#rtsp) +* `RTSP`: RTSP streaming, RTSP server, RTSP playback, etc. + > 1. SRS supports pulling RTSP with Ingest, but does not support pushing RTSP stream to SRS, which is not the correct usage. For detailed reasons, please refer to [#2304](https://github.com/ossrs/srs/issues/2304). + > 1. Of course, RTSP server and RTSP playback will not be supported either, please refer to [#476](https://github.com/ossrs/srs/issues/476). + > 1. If you need a large number of camera connections, such as 10,000, using FFmpeg may be more difficult. For such large-scale businesses, the recommended solution is to use ST+SRS code to implement an RTSP forwarding server. + ### [Source Cleanup](#source-cleanup) @@ -93,21 +176,22 @@ topic. If your question is similar, please watch the video directly: > 1. The Source object for push streaming is not cleaned up, and memory will increase as the number of push streams increases. For now, you can use [Gracefully Quit](https://github.com/ossrs/srs/issues/413#issuecomment-917771521) as a workaround, and this issue will be addressed in the future. See [#413](https://github.com/ossrs/srs/issues/413) > 1. To reiterate, you can use [Gracefully Quit](https://github.com/ossrs/srs/issues/413#issuecomment-917771521) as a workaround. Even if this issue is resolved in the future, this solution is the most reliable and optimal one. Restarting is always a good option. - + -### [Edge HLS/DVR/RTC](#edge-hls-dvr-rtc) -* `Edge HLS/DVR/RTC`: About Edge support for HLS/DVR/RTC, etc. - > 1. Edge is a live streaming cluster that only supports live streaming protocols such as RTMP and FLV. Only the origin server can support HLS/DVR/RTC. Refer to [#1066](https://github.com/ossrs/srs/issues/1066) - > 1. Currently, there is no restriction on using HLS/DVR/RTC capabilities in Edge, but they will be disabled in the future. So please do not use them this way, and they won't work. - > 1. For the HLS cluster, please refer to the documentation [HLS Edge Cluster](/docs/v5/doc/nginx-for-hls) - > 1. The development of WebRTC and SRT clustering capabilities is in progress. Refer to [#3138](ttps://github.com/ossrs/srs/issues/3138) +### [Video Guides](#video-guides) - +Here is the video material for the Q&A session, which provides a detailed explanation of a certain +topic. If your question is similar, please watch the video directly: -### [FFmpeg](#ffmpeg) -* `FFmpeg`: Questions related to FFmpeg - > 1. If FFmpeg is not found, the error `terminate, please restart it` appears, compilation fails with `No FFmpeg found`, or FFmpeg does not support h.265 or other codecs, you need to compile or download FFmpeg yourself and place it in the specified path, then SRS will detect it. Please refer to [#1523](https://github.com/ossrs/srs/issues/1523) - > 1. If you have questions about using FFmpeg, please do not submit issues in SRS. Instead, go to the FFmpeg community. Issues about FFmpeg in SRS will be deleted directly. Don't be lazy. +* [Unlock the Power of SRS: Real-World Use Cases and Boosting Your Business with Simple Realtime Server.](https://youtu.be/WChYr6z7EpY) +* [Ultra Low Latency Streaming with OBS WHIP](https://youtu.be/SqrazCPWcV0) + + + +### [WebRTC Cluster](#webrtc-cluster) +* `WebRTC+Cluster`: Questions related to WebRTC clustering + > 1. WebRTC clustering is not the same as live streaming clustering (Edge+Origin Cluster), but it is called WebRTC cascading. Please refer to [#2091](https://github.com/ossrs/srs/issues/2091) + > 1. In addition to the clustering solution, SRS will also support the Proxy solution, which is simpler than clustering and will have scalability and disaster recovery capabilities. Please refer to [#3138](https://github.com/ossrs/srs/issues/3138) @@ -117,13 +201,6 @@ topic. If your question is similar, please watch the video directly: > 1. If SRS 4.0.174 or earlier works, but it does not work after updating, it is because `rtc.conf` does not enable RTMP to RTC by default. You need to use `rtmp2rtc.conf` or `rtc2rtmp.conf`. Please refer to 71ed6e5dc51df06eaa90637992731a7e75eabcd7 > 1. In the future, the conversion between RTC and RTMP will not be enabled automatically, because SRS must consider the independent RTMP and independent RTC scenarios. The conversion scenario is just one of them, but due to the serious performance problems caused by the conversion scenario, it cannot be enabled by default, which will cause major problems in independent scenarios. - - -### [WebRTC Cluster](#webrtc-cluster) -* `WebRTC+Cluster`: Questions related to WebRTC clustering - > 1. WebRTC clustering is not the same as live streaming clustering (Edge+Origin Cluster), but it is called WebRTC cascading. Please refer to [#2091](https://github.com/ossrs/srs/issues/2091) - > 1. In addition to the clustering solution, SRS will also support the Proxy solution, which is simpler than clustering and will have scalability and disaster recovery capabilities. Please refer to [#3138](https://github.com/ossrs/srs/issues/3138) - ### [WebRTC](#webrtc) @@ -136,89 +213,12 @@ topic. If your question is similar, please watch the video directly: > 1. There are also less common issues, such as not being able to play non-HTTPS SRS streams with the official player. This is also a Chrome security policy issue. Please refer to [#2787](https://github.com/ossrs/srs/issues/2787) > 1. When mapping ports in docker, if you change the port, you need to modify the configuration file or specify it through eip. Please refer to [#2907](https://github.com/ossrs/srs/issues/2907) - - -### [GB28181](#gb28181) -* `GB28181`: Questions about GB status and roadmap - > 1. GB has been moved to a separate repository [srs-gb28181](https://github.com/ossrs/srs-gb28181), please refer to [#2845](https://github.com/ossrs/srs/issues/2845) - > 1. For GB usage, please refer to [#1500](https://github.com/ossrs/srs/issues/1500). Currently, GB is still in the [feature/gb28181](https://github.com/ossrs/srs-gb28181/tree/feature/gb28181) branch. It will be merged into develop and then released after it is stable. It is expected to be released in SRS 5.0. - > 1. SRS support for GB will not be comprehensive, and will only be used as an access protocol. The highly concerned [intercom](https://github.com/ossrs/srs-gb28181/issues/1898) is planned to be supported. - - - -### [CDN](#cdn) -* Questions about RTMP/HTTP-FLV/WebRTC live streaming? - > 1. SRS only supports streaming protocols, such as live streaming or WebRTC. For details, please refer to the cluster section in the WiKi. -* Questions about HLS/DASH segmented live streaming, or on-demand/recording/VoD/DVR? - > 1. SRS can record as on-demand files. Please refer to [DVR](/docs/v4/doc/dvr) - > 1. SRS can generate HLS or DASH. Please refer to [HLS](/docs/v4/doc/delivery-hls) -* Questions about HLS/DASH/VoD/DVR distribution clusters? - > 1. These are all HTTP files, and for HTTP file distribution clusters, it is recommended to use NGINX. Please refer to [HLS Cluster](/docs/v4/doc/sample-hls-cluster) - > 1. You can use NGINX in conjunction with SRS Edge to distribute HTTP-FLV, implementing the distribution of all HTTP protocols. Please refer to [Nginx For HLS](/docs/v4/doc/nginx-for-hls#work-with-srs-edge-server) - - - -### [CORS](#cors) -* `CORS`: Questions about cross-domain access for HTTP APIs or streams - > 1. SRS 3.0 supports cross-domain (CORS) access, so there is no need for additional HTTP proxies, as it is built-in and enabled by default. Please refer to [#717](https://github.com/ossrs/srs/issues/717) [#798](https://github.com/ossrs/srs/issues/798) [#1002](https://github.com/ossrs/srs/issues/1002) - > 1. Of course, using an Nginx proxy server can also solve cross-domain issues, so there is no need to set it in SRS. Note that you only need to proxy the API, not the media stream, because the bandwidth consumption of the stream is too high, which will cause the proxy to crash and is not necessary. - > 1. Use Nginx or Caddy proxy to provide a unified HTTP/HTTPS service. Please refer to [#2881](https://github.com/ossrs/srs/issues/2881) - ### [Websocket](#websocket) * `WebSocket/WS`: How to support WS-FLV or WS-TS? > 1. You can use a Go proxy to convert it once, with a few lines of key code for stability and reliability. Please refer to [mse.go](https://github.com/winlinvip/videojs-flow/blob/master/demo/mse.go) - - -### [Latency](#latency) -* `Latency`: Questions about how to reduce latency, how to do low-latency live streaming, and how much latency WebRTC has. - > 1. Live streaming latency is generally 1 to 3 seconds, WebRTC latency is around 100ms, why is the latency of the self-built environment so high? - > 1. The most common reason for high latency is using the VLC player, which has a latency of tens of seconds. Please switch to the SRS H5 player. - > 1. Latency is related to each link, not just SRS reducing latency. It is also related to the push tool (FFmpeg/OBS) and the player. Please refer to [Realtime](/docs/v4/doc/sample-realtime) and follow the steps to set up a low-latency environment. Don't start with your own fancy operations, just follow the documentation. - > 1. If you still find high latency after following the steps, how to troubleshoot? Please refer to [#2742](https://github.com/ossrs/srs/issues/2742) - - - -### [HLS Fragments](#hls-fragments) -* `HLS Fragment Duration`: About HLS segment duration - > 1. HLS segment duration is determined by three factors: GOP length, whether to wait for a keyframe (`hls_wait_keyframe`), and segment duration (`hls_fragment`). - > 1. For example, if the GOP is set to 2s, the segment length is `hls_fragment:5`, and `hls_wait_keyframe:on`, then the actual duration of each TS segment may be around 5~6 seconds, as it needs to wait for a complete GOP before closing the segment. - > 1. For example, if the GOP is set to 10s, the segment length is `hls_fragment:5`, and `hls_wait_keyframe:on`, then the actual duration of each TS segment is also over 10 seconds. - > 1. For example, if the GOP is set to 10s, the segment length is `hls_fragment:5`, and `hls_wait_keyframe:off`, then the actual duration of each TS segment is around 5 seconds. The segment does not start with a keyframe, so some players may experience screen artifacts or slower video playback. - > 1. For example, if the GOP is set to 2s, the segment length is `hls_fragment:2`, and `hls_wait_keyframe:on`, then the actual duration of each TS segment may be around 2 seconds. This way, the HLS delay is relatively low, and there will be no screen artifacts or decoding issues, but the encoding quality may be slightly compromised due to the smaller GOP. - > 1. Although the segment size can be set to less than 1 second, such as `hls_fragment:0.5`, the `#EXT-X-TARGETDURATION` is still 1 second because it is an integer. Moreover, having too small segments can lead to an excessive number of segments, which is not conducive to CDN caching or player caching, so it is not recommended to set too small segments. - > 1. If you want to reduce latency, do not set the segment duration to less than 1 second; setting it to 1 or 2 seconds is more appropriate. Because even if it is set to 1 second, due to the player's segment fetching strategy and caching policy, the latency will not be the same as RTMP or HTTP-FLV streams. The minimum latency for HLS is generally over 5 seconds. - > 1. GOP refers to the number of frames between two keyframes, which needs to be set in the encoder. For example, the FFmpeg parameter `-r 25 -g 50` sets the frame rate to 25fps and the GOP to 50 frames, which is equivalent to 2 seconds. - > 1. In OBS, there is a `Keyframe Interval(0=auto)` setting. Its minimum value is 1s. If set to 0, it actually means automatic, not the lowest latency setting. For low latency, it is recommended to set it to 1s or 2s. - - - -### [Performance](#performance) and [Memory](#memory) -* `Performance`: About performance optimization, concurrency, stress testing, memory leaks, and wild pointers - > 1. Performance is a comprehensive topic, including the quality of the project, the capacity and concurrency it supports, how to optimize performance, and even memory issues, such as memory leaks (leading to reduced performance), out-of-bounds and wild pointer problems. - > 1. If you need to understand the concurrency of SRS, you must divide it into separate concurrency for live streaming and WebRTC. Live streaming can use [srs-bench](https://github.com/ossrs/srs-bench), and WebRTC can use the [feature/rtc](https://github.com/ossrs/srs-bench/tree/feature/rtc) branch for stress testing to obtain the concurrency supported by your hardware and software environment under specific bitrates, latency, and business characteristics. - > 1. SRS also provides official concurrency data, which can be found in [Performance](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/PERFORMANCE.md#performance). It also explains how to measure this concurrency, the conditions under which the data is obtained, and specific optimization code. - > 1. If you need to investigate performance issues, memory leaks, or wild pointer problems, you must use system-related tools such as perf, valgrind, or gperftools. For more information, please refer to [SRS Performance (CPU), Memory Optimization Tool Usage](https://www.jianshu.com/p/6d4a89359352) or [Perf](/docs/v4/doc/perf). - > 1. It is important to note that valgrind has been supported since SRS 3.0 (inclusive), and the ST patch has been applied. - - - -### [Features](#features) -* About supported features, outdated features, and plans? - > 1. Each version supports different features, which are listed on the Github homepage, such as [develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/Features.md#features), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/Features.md#features), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#features). - > 1. The changes in each version are also different and are listed on the Github homepage, such as [develop/5.0](https://github.com/ossrs/srs/blob/develop/trunk/doc/CHANGELOG.md#changelog), [release/4.0](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/CHANGELOG.md#changelog), [release/3.0](https://github.com/ossrs/srs/tree/3.0release#v3-changes). - > 1. In addition to adding new features, SRS will also remove unsuitable features, such as RTSP push streaming, srs-librtmp, GB SIP signaling, etc. These features may be useless, inappropriate, or provided in a more suitable way. See [#1535](https://github.com/ossrs/srs/issues/1535) for more information. - - - -### [Help](#help) -* No one answers questions in the WeChat group? The art of asking questions in the community? - > 1. Please search in the various documents of the community first, and do not ask questions that already have answers. - > 1. Please describe the background of the problem in detail, and show the efforts you have made. - > 1. Open source community means you need to be able to solve problems yourself. If not, please consider paid consultation. - ## Deleting Refer this FAQ by: