YouTube Live Streaming API - 방송 및 스트림 이해
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 가이드에서는 방송 및 스트림에 관해 간략하게 설명합니다. 또한 방송사가 YouTube Live Streaming API를 사용해 리소스를 만들고 관리하는 사용 사례를 살펴봅니다.
-
방송은 YouTube에서 실시간으로 시청할 수 있는 이벤트를 의미합니다. 각 방송은 별개의 YouTube 동영상입니다. 브로드캐스트는 정확히 하나의 스트림에 결합되어야 합니다.
-
스트림은 오디오-동영상 콘텐츠를 YouTube에 전송할 수 있게 해주며 콘텐츠를 YouTube에 스트리밍하는 방법의 설정을 정의합니다. 동일한 스트림을 최대 3개의 라이브 방송에 결합할 수 있습니다. 또한 방송사가 서로 다른 시간에 발생하는 경우 방송사는 서로 다른 여러 방송에 동일한 스트림을 재사용하는 것이 일반적입니다.
나머지 섹션에는 API 사용자가 일반적으로 브로드캐스트와 스트림을 사용하는 방법을 설명하는 세 가지 사용 사례가 나와 있습니다.
단일 인코더 구성
가장 일반적인 API 사용 사례의 경우 YouTube 채널에 일련의 예약되거나 반복되는 실시간 이벤트가 있는 경우입니다. 채널 소유자가 단일 인코더를 사용하고 있으며 인코더는 한 번만 구성하려고 합니다. 따라서 다음 단계를 수행합니다.
- API에서
liveStream
리소스를 한 개 만듭니다.
- 해당 리소스의 콘텐츠 전송 설정을 사용하여 채널의 인코더를 구성합니다.
채널이 여러 개인 경우 채널마다 다른 스트림을 만들어야 합니다.
- API에서
liveBroadcast
리소스를 만들고 이러한 모든 리소스를 liveStream
리소스에 바인딩합니다. 이 시나리오에서는 채널에 예약한 모든 실시간 이벤트가 동일한 스트리밍 설정을 사용합니다. 하지만 항상 한 이벤트만 라이브 스트리밍되며 각 방송의 동영상 콘텐츠는 고유합니다.
- 이벤트가 발생할 때마다 방송 상태를
testing
또는 live
로 업데이트하고 YouTube에서 이벤트 방송을 진행합니다.
방송당 하나의 스트림 만들기
또 다른 일반적인 접근 방식은 방송마다 별도의 스트림을 만드는 것입니다. 이 시나리오에서는 각 liveBroadcast
리소스에 고유한 liveStream
리소스를 만든 다음 각 방송에 적절한 설정을 사용하도록 스트리밍 인코더를 구성합니다.
이 접근 방식은 채널에 반복 방송이 여러 개 있어서 두 방송이 동시에 발생할 수 있으므로 두 방송에서 동일한 스트리밍 설정을 사용하는 것이 불가능할 수 있습니다. 실제로 채널에서는 반복되는 방송을 각각 프로그램처럼 취급하고 프로그램당 하나의 liveStream
리소스만 만들 수 있습니다. 그러면 동일한 프로그램의 각 에피소드가 하나의 방송을 나타내며 동일한 프로그램의 모든 방송이 동일한 스트림에 연결될 수 있습니다.
하나의 스트림을 사용하여 동시 방송 만들기
이 시나리오에서는 라이브 스트림을 여러 개의 동시 방송으로 분할하려고 합니다. 따라서 동시에 live
상태를 가진 두 개 이상의 liveBroadcast
리소스에 바인딩되는 하나의 liveStream
리소스가 있습니다.
예를 들어 채널에서 연중무휴 실시간 피드를 방송하지만 방송 중에 진행되는 인터뷰를 위한 별도의 동영상도 만들고 싶다고 가정해 보겠습니다. 이 경우 인터뷰 콘텐츠는 연중무휴 방송 콘텐츠의 하위 집합입니다.
이 경우를 처리하려면 liveBroadcast
리소스를 두 개 만들고 두 브로드캐스트를 동일한 스트림에 바인딩합니다. 연중무휴 방송이 진행 중이며 인터뷰가 시작되기 훨씬 전에 리소스가 live
상태입니다. 인터뷰가 시작되면 연중무휴 방송의 리소스를 변경하지 않고 인터뷰와 관련된 리소스의 상태를 live
로 업데이트합니다. 즉, 동일한 콘텐츠를 서로 다른 두 개의 동영상에 동시에 스트리밍하는 것입니다.
인터뷰가 끝나면 인터뷰 브로드캐스트의 리소스를 다시 업데이트하고, 이번에는 상태를 complete
로 설정합니다. 하지만 연속 방송은 계속되므로 동영상 스트리밍을 중지하지는 않습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-08-15(UTC)
[null,null,["최종 업데이트: 2024-08-15(UTC)"],[[["\u003cp\u003eA broadcast represents a live event on YouTube, functioning as a distinct video, and it must be linked to one stream.\u003c/p\u003e\n"],["\u003cp\u003eA stream is used to send audio-video content to YouTube, defining the settings for that stream, and one stream can be connected to up to three live broadcasts.\u003c/p\u003e\n"],["\u003cp\u003eBroadcasters often use the same stream for numerous broadcasts that occur at different times, reusing stream settings and reducing redundant setup.\u003c/p\u003e\n"],["\u003cp\u003eThe API can be used in multiple ways, whether it be one stream for multiple broadcasts, one stream per broadcast, or a single stream being split into multiple simultaneous broadcasts.\u003c/p\u003e\n"],["\u003cp\u003eChannels can use the API to schedule recurring live events with a single encoder, configuring it just once for multiple broadcasts.\u003c/p\u003e\n"]]],["Broadcasts represent distinct YouTube live events, each bound to one stream. Streams transmit audio-video content to YouTube and define streaming settings. Broadcasters often reuse streams for multiple broadcasts at different times. Common use cases include: configuring one stream for multiple scheduled broadcasts, creating a unique stream per broadcast, or using a single stream for simultaneous broadcasts. For the last case, one stream can be used to have up to 3 simultaneous live broadcasts. API users create and bind these resources.\n"],null,["# YouTube Live Streaming API - Understanding Broadcasts and Streams\n\nThis guide provides a brief overview of **broadcasts** and **streams**. It also discusses use cases that show how broadcasters use the YouTube Live Streaming API to create and manage those resources.\n\n- A **broadcast** represents an event that can be watched on YouTube as it happens. Each broadcast is a distinct YouTube video. A broadcast can be and needs to be bound to exactly one stream.\n\n- A **stream** enables you to transmit audio-video content to YouTube, and it defines the settings for how you stream your content to YouTube. The same stream can be bound to up to three live broadcasts. It is also common for broadcasters to reuse the same stream for many different broadcasts if those broadcasts occur at different times.\n\nThe remaining sections present three use cases that explain how API users typically use broadcasts and streams.\n\nConfigure a single encoder\n--------------------------\n\nIn the most common API use case, your YouTube channel has a series of scheduled or recurring live events. As the channel owner, you have a single encoder and only want to configure the encoder one time. So, you perform the following steps:\n\n1. Create one [liveStream](/youtube/v3/live/docs/liveStreams) resource in the API.\n2. Use the content delivery settings from that resource to configure the encoder for the channel.\n3. Note that, if you have multiple channels, you must create a different stream for each channel.\n4. Create [liveBroadcast](/youtube/v3/live/docs/liveBroadcasts) resources in the API and [bind](/youtube/v3/live/docs/liveBroadcasts/bind) all of those resources to the [liveStream](/youtube/v3/live/docs/liveStreams) resource. In this scenario, every live event that you schedule for your channel uses the same streaming settings. However, only one event is live at any given time, and the video content for each broadcast is unique.\n5. Any time an event occurs, update the broadcast's status to either `testing` or `live` and proceed to broadcast that event on YouTube.\n\nCreate one stream per broadcast\n-------------------------------\n\nAnother common approach is to create a separate stream for each broadcast. In this scenario, you would create a distinct [liveStream](/youtube/v3/live/docs/liveStreams) resource for each [liveBroadcast](/youtube/v3/live/docs/liveBroadcasts) resource and then configure your streaming encoder to use the appropriate settings for each broadcast.\n\nThis approach might make sense if your channel has multiple recurring broadcasts such that two broadcasts might occur simultaneously, making it infeasible for both broadcasts to use the same streaming settings. In fact, your channel might treat each recurring broadcast as a show and just create one [liveStream](/youtube/v3/live/docs/liveStreams) resource per show. Then, each episode of the same show would represent a broadcast, and all broadcasts of the same show could be bound to the same stream.\n\nUse one stream to create simultaneous broadcasts\n------------------------------------------------\n\nIn this scenario, you want to split a live stream into multiple, simultaneous broadcasts. As such, you have one [liveStream](/youtube/v3/live/docs/liveStreams) resource that is bound to two (or more) [liveBroadcast](/youtube/v3/live/docs/liveBroadcasts) resources that have a `live` status at the same time.\n\nFor example, suppose your channel broadcasts a 24/7 live feed, but you also want to create a separate video for an interview that occurs during that broadcast. In this case, the interview content is a subset of the 24/7 broadcast's content.\n\nTo handle this case, you create two `liveBroadcast` resources and bind both broadcasts to the same stream. The 24/7 broadcast is ongoing and its resource has a `live` status long before the interview begins. When the interview begins, you update the status of the resource associated with the interview to `live` without changing the 24/7 broadcast's resource. Thus, you are streaming the same content to two separate videos at the same time.\n\nWhen the interview ends, you update the interview broadcast's resource again, this time setting its status to `complete`. However, you don't stop streaming video since the 24/7 broadcast continues."]]