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 即時串流 (HLS) 和基於 HTTP 的動態自動調整串流 (DASH) 擷取通訊協定也會加密,就像 RTMPS 一樣。此外,這類編碼器也支援 RTMP 和 RTMPS 不支援的轉碼器。VP9 和高效能視訊編碼 (HEVC) 等新一代視訊轉碼器可提供比 H.264 更優異的壓縮效果,讓使用者在特定位元率下串流播放更高畫質的影片,或在位元率較低的情況下串流播放相同畫質的影片,進而減少緩衝。因此,如果需要較高的品質和解析度,但可接受相對較高的延遲,HLS 或 DASH 擷取就是優質內容的理想選擇。請注意,由於 HLS 和 DASH 是以片段為基礎,因此這兩種格式的擷取作業通常會比 RTMP 產生更多延遲。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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."]]