AI-generated Key Takeaways
-
A
liveStreamresource represents a video feed being sent to YouTube for live broadcasts, which can be associated with one or moreliveBroadcastresources to provide content to viewers. -
The
liveStreamresource can be managed through several methods, includinglistto retrieve streams,insertto create new streams,updateto modify existing ones, anddeleteto remove streams. -
The
cdnproperty defines critical streaming details such asingestionType(e.g., RTMP, HLS), primary and backup stream URLs, resolution, and frame rate, and it is essential for configuring how the video stream is delivered to YouTube. -
The
statusproperty of aliveStreamprovides information on the current status of the stream, including whether it is active, created, or in error, as well as its overall health status and any detected issues. -
Configuration issues such as
videoBitrateLow,framerateMismatchornoAudioStreammight affect the quality or delivery of the broadcast, and can be checked in thehealthStatuspart of thestatusproperty.
A liveStream resource contains information about the video stream that you are transmitting to YouTube. The stream provides the content that will be broadcast to YouTube users. Once created, a liveStream resource can be bound to one or more liveBroadcast resources.
Methods
The API supports the following methods for liveStreams resources:
- list
- Returns a list of video streams that match the API request parameters. Try it now.
- insert
- Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience. Try it now.
- update
- Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings. Try it now.
- delete
- Deletes a video stream. Try it now.
Resource representation
The following JSON structure shows the format of a liveStreams resource:
{
"kind": "youtube#liveStream",
"etag": etag,
"id": string,
"snippet": {
"publishedAt": datetime,
"channelId": string,
"title": string,
"description": string,
"isDefaultStream": boolean
},
"cdn": {
"ingestionType": string,
"ingestionInfo": {
"streamName": string,
"ingestionAddress": string,
"backupIngestionAddress": string
},
"resolution": string,
"frameRate": string
},
"status": {
"streamStatus": string,
"healthStatus": {
"status": string,
"lastUpdateTimeSeconds": unsigned long,
"configurationIssues": [
{
"type": string,
"severity": string,
"reason": string,
"description": string
}
]
}
},
"contentDetails": {
"closedCaptionsIngestionUrl": string,
"isReusable": boolean
}
}Properties
The following table defines the properties that appear in this resource:
| Properties | |
|---|---|
kind |
stringIdentifies the API resource's type. The value will be youtube#liveStream. |
etag |
etagThe Etag of this resource. |
id |
stringThe ID that YouTube assigns to uniquely identify the stream. |
snippet |
objectThe snippet object contains basic details about the stream, including its channel, title, and description. |
snippet.publishedAt |
datetimeThe date and time that the stream was created. The value is specified in ISO 8601 ( YYYY-MM-DDThh:mm:ss.sZ) format. |
snippet.channelId |
stringThe ID that YouTube uses to uniquely identify the channel that is transmitting the stream. |
snippet.title |
stringThe stream's title. The value must be between 1 and 128 characters long. |
snippet.description |
stringThe stream's description. The value cannot be longer than 10000 characters. |
snippet.isDefaultStream |
boolean
This property will be deprecated on or after September 1, 2020. At that time, YouTube will
stop creating a default stream and default broadcast when a channel is enabled for live
streaming. Please see the deprecation
announcement for more details.
This property indicates whether this stream is the default stream for the channel.How default streams work When a YouTube channel is enabled for live streaming, YouTube creates a default stream and a default broadcast for the channel. The stream defines how the channel owner sends live video to YouTube, and the broadcast is how viewers can see the default stream. A channel owner can use the liveStreams.list
and liveBroadcasts.list
methods to identify these resources.A channel's default stream exists indefinitely, does not have a start or end time associated with it, and cannot be deleted. The channel owner needs only to start sending video bits and the stream goes on automatically. When a stream ends, YouTube converts the completed broadcast to a YouTube video and assigns the video a YouTube video ID. After the conversion is complete, the video is included in the channel's list of uploaded videos. The video is not available immediately after the broadcast concludes, and the length of the delay is related to the actual length of the broadcast. |
cdn |
objectThe cdn object defines the live stream's content delivery network (CDN) settings. These settings provide details about the manner in which you stream your content to YouTube. |
cdn.format |
stringThis property has been deprecated since April 18, 2016, and will no longer be supported as of August 17, 2020. Requests that still use this property as of that date will fail. Instead, use the cdn.frameRate and
cdn.resolution properties to specify the frame
rate and resolution separately.
|
cdn.ingestionType |
stringThe method or protocol used to transmit the video stream. Valid values for this property are:
|
cdn.ingestionInfo |
objectThe ingestionInfo object contains information that YouTube provides that you need to transmit your stream to YouTube. |
cdn.ingestionInfo.streamName |
stringThe stream name that YouTube assigns to the video stream. |
cdn.ingestionInfo.ingestionAddress |
stringThe primary ingestion URL that you should use to stream video to YouTube if you use RTMP, DASH, or HLS. You must stream video to this URL. Depending on which application or tool you use to encode your video stream, you may need to enter the stream URL and stream name separately or you may need to concatenate them in the following format: STREAM_URL/STREAM_NAME |
cdn.ingestionInfo.backupIngestionAddress |
stringThe backup ingestion URL that you should use to stream video to YouTube if you use RTMP, DASH, or HLS. You have the option of simultaneously streaming the content that you are sending to the ingestionAddress to this URL. |
cdn.ingestionInfo.rtmpsIngestionAddress |
stringThe primary ingestion URL that you should use to stream video to YouTube if you use RTMPS. You must stream video to this URL. Depending on which application or tool you use to encode your video stream, you may need to enter the stream URL and stream name separately or you may need to concatenate them in the following format: STREAM_URL/STREAM_NAME |
cdn.ingestionInfo.rtmpsBackupIngestionAddress |
stringThe backup ingestion URL that you should use to stream video to YouTube if you use RTMPS. |
cdn.resolution |
stringThe resolution of the inbound video data. Valid values for this property are:
|
cdn.frameRate |
stringThe frame rate of the inbound video data. Valid values for this property are:
|
status |
objectThe status object contains information about live stream's status. |
status.streamStatus |
stringThe stream's status. Valid values for this property are:
|
status.healthStatus |
objectThis object contains information about the live stream's health status, which could be used to identify, diagnose, and resolve streaming problems. |
status.healthStatus.status |
stringThe status code of this stream. Valid values for this property are:
|
status.healthStatus.lastUpdateTimeSeconds |
unsigned longThe last time that the stream's health status was updated. The value reflects a UNIX timestamp in seconds. |
status.healthStatus.configurationIssues[] |
listThis object contains a list of configuration issues affecting the stream. |
status.healthStatus.configurationIssues[].type |
stringIdentifies the type of error affecting the stream. |
status.healthStatus.configurationIssues[].severity |
stringIndicates how severe the issue is to the stream. Valid values for this property are:
|
status.healthStatus.configurationIssues[].reason |
stringA short description of the issue. The Configuration Issues for LiveStream Resources document identifies the reason associated with each configuration issue type. |
status.healthStatus.configurationIssues[].description |
stringA detailed description of the issue. When possible, the description provides information about how to resolve the issue. The Configuration Issues for LiveStream Resources document lists all of the configuration issue types and their associated descriptions. |
contentDetails |
objectThe content_details object contains information about the stream, including the closed captions ingestion URL. |
contentDetails.closedCaptionsIngestionUrl |
stringThe ingestion URL where the closed captions of this stream are sent. |
contentDetails.isReusable |
booleanIndicates whether the stream is reusable, which means that it can be bound to multiple broadcasts. It is common for broadcasters to reuse the same stream for many different broadcasts if those broadcasts occur at different times. If you set this value to false, then the stream will not be reusable, which means that it can only be bound to one broadcast. Non-reusable streams differ from reusable streams in the following ways:
|