YouTube 直播视频流提取协议比较
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
YouTube 直播支持以下适用于第三方客户端的提取协议:
注入协议 |
已加密 |
支持的视频编解码器 |
评论 |
RTMP |
否 |
H.264 |
适合正常、低或超低延迟时间的直播。 |
RTMPS |
是 |
H.264 |
适合正常、低或超低延迟时间的直播。 |
HLS |
是 |
H.264、H.265 (HEVC) |
由于支持 HEVC,因此更适合 4K 分辨率。支持 HDR。不适合超低延迟。 |
DASH |
是 |
H.264、VP9 |
由于支持 VP9,因此更适合 4K 分辨率。不适合超低延迟。 |
实时消息传递协议 (RTMPS) 是一种广泛使用的视频流式传输协议,YouTube 直播自推出以来就一直支持该协议。
实时消息传递协议安全版 (RTMPS) 是 RTMP 的安全扩展版本。RTMPS 可防止直播的提取端遭受中间人攻击,从而使内容创作者和观看者都能受益。这样可确保创作者的所有直播数据(包括视频、音频和控制信号)都安全地传输到 YouTube 的服务器,从而防止这些数据在传输过程中遭到篡改或拦截。
HTTP Live Streaming (HLS) 和基于 HTTP 的动态自适应流式传输 (DASH) 提取协议也像 RTMPS 一样经过加密。它们还支持 RTMP 和 RTMPS 不支持的编解码器。VP9 和高效率视频编码 (HEVC) 等新一代视频编解码器可提供比 H.264 好得多的压缩效果,让用户能够以给定的比特率获得更高质量的流式传输体验,或者以更低的比特率获得相同质量的流式传输体验,从而减少缓冲。因此,HLS 或 DASH 提取非常适合需要更高质量和更高分辨率的优质内容,尽管延迟时间相对较长。请注意,由于 HLS 和 DASH 基于分段,因此与 RTMP 相比,HLS 和 DASH 提取通常会产生更长的延迟时间。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):2025-08-21。"],[[["\u003cp\u003eYouTube Live Streaming supports four ingestion protocols: RTMP, RTMPS, HLS, and DASH, each with different features and capabilities.\u003c/p\u003e\n"],["\u003cp\u003eRTMP and RTMPS are suitable for normal, low, or ultra-low latency live streaming, with RTMPS providing secure, encrypted transmission.\u003c/p\u003e\n"],["\u003cp\u003eHLS and DASH are encrypted, support advanced codecs like HEVC and VP9, and are better suited for 4K and high-resolution streaming but have higher latency.\u003c/p\u003e\n"],["\u003cp\u003eHLS and DASH offer improved video compression compared to H.264, allowing for higher quality at the same bitrate or equivalent quality with a lower bitrate.\u003c/p\u003e\n"]]],["YouTube Live Streaming uses RTMP, RTMPS, HLS, and DASH protocols. RTMP and RTMPS, the latter being a secure extension, support H.264 and are suitable for low-latency streams. Encrypted HLS supports H.264 and H.265 (HEVC), while encrypted DASH supports H.264 and VP9, both being ideal for 4K and HDR content. HLS and DASH are segment based and offer better compression, but are not suitable for ultra-low latency.\n"],null,["# YouTube Live Streaming Ingestion Protocol Comparison\n\nYouTube Live Streaming supports the following ingestion protocols for\nthird-party clients:\n\n| Ingestion Protocol | Encrypted | Video Codecs Supported | Comment |\n|----------------------------------------------------|-----------|------------------------|-----------------------------------------------------------------------------------------------------|\n| RTMP | No | H.264 | Suitable for normal, low, or ultra-low latency live streaming. |\n| [RTMPS](/youtube/v3/live/guides/rtmps-ingestion) | Yes | H.264 | Suitable for normal, low, or ultra-low latency live streaming. |\n| [HLS](/youtube/v3/live/guides/hls-ingestion) | Yes | H.264, H.265 (HEVC) | Better for 4K resolution because of HEVC support. Supports HDR. Not suitable for ultra-low latency. |\n| [DASH](/youtube/v3/live/guides/encoding-with-dash) | Yes | H.264, VP9 | Better for 4K resolution because of VP9 support. Not suitable for ultra-low latency. |\n\n*Real Time Messaging Protocol (RTMPS)* is a widely-used protocol for video\nstreaming that YouTube Live has accepted since the service began.\n\n*Real Time Messaging Protocol Secure (RTMPS)* is a secure extension to RTMP.\nRTMPS benefits both content creators and viewers by preventing man-in-the-middle\nattacks on the ingestion side of livestreams. This ensures that all of a\ncreator's live streaming data---including video, audio, and control signals---is\nsecurely transmitted to YouTube's servers, protecting it from tampering or\ninterception in transit.\n\nThe *HTTP Live Streaming (HLS)* and *Dynamic Adaptive Streaming over HTTP\n(DASH)* ingestion protocols are also encrypted, like RTMPS. They also support\ncodecs that RTMP and RTMPS don't. Next-generation video codecs such as VP9 and\n*High Efficiency Video Coding (HEVC)* can offer much better compression relative\nto H.264, allowing users to either stream with higher quality for a given\nbitrate or stream with the same quality while using a lower bitrate, which could\ndecrease buffering. This makes HLS or DASH ingestion a good choice for premium\ncontent that requires higher quality and higher resolution, albeit at a\nrelatively higher latency. Note that HLS and DASH ingestion typically incur\ngreater latency than RTMP because HLS and DASH are segment-based."]]