This page shows you how to create and manage Live Stream API channels. A channel resource represents the processor that does a user-defined "streaming" operation. The streaming operation includes getting an input stream through an input endpoint, transcoding the input stream into multiple renditions, and publishing output live streams in certain formats in the specified location.
Set up your Google Cloud project and authentication
If you have not created a Google Cloud project and credentials, see Before you begin.Prerequisites
Create a channel
To create a channel, use the
projects.locations.channels.create
method. The following samples create a channel that generates an HLS live stream.
The live stream consists of a single, high-definition (1280x720) rendition.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pageLOCATION
: the location in which to create the channel; use one of the supported regionsShow locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: a user-defined identifier for the channel to create; this value must be 1-63 characters, begin and end with[a-z0-9]
, and can contain dashes (-) between charactersINPUT_ID
: the user-defined identifier for the input endpointBUCKET_NAME
: the name of the Cloud Storage bucket you created to hold the live stream manifest and segment files
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/channels/CHANNEL_ID", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Get channel details
To get the details of the channel, use the
projects.locations.channels.get
method.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pageLOCATION
: the location where your channel is located; use one of the supported regionsShow locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: a user-defined identifier for the channel
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/channels/CHANNEL_ID", "createTime": CREATE_TIME, "updateTime": UPDATE_TIME, "inputAttachments": [ { "key": "INPUT_ID", "input": "projects/PROJECT_NUMBER/locations/LOCATION/inputs/INPUT_ID" } ], "activeInput": "INPUT_ID", "output": { "uri": "gs://BUCKET_NAME" }, "elementaryStreams": [ { "videoStream": { "h264": { "widthPixels": 1280, "heightPixels": 720, "frameRate": 30, "bitrateBps": 3000000, "gopDuration": "2s", "vbvSizeBits": 3000000, "vbvFullnessBits": 2700000, "entropyCoder": "cabac", "profile": "high" } }, "key": "es_video" }, { "audioStream": { "codec": "aac", "bitrateBps": 160000, "channelCount": 2, "channelLayout": ["fl", "fr"], "sampleRateHertz": 48000 }, "key": "es_audio" } ], "muxStreams": [ { "key": "mux_video_ts", "container": "ts", "elementaryStreams": ["es_video", "es_audio"], "segmentSettings": { "segmentDuration": "2s" } } ], "manifests": [ { "key": "manifest_hls", "fileName": "main.m3u8", "type": "HLS", "muxStreams": [ "mux_video_ts", ], "maxSegmentCount": 5, "segmentKeepDuration": "60s" } ], "streamingState": "STOPPED" }
C#
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Update a channel
To update a channel, use the
projects.locations.channels.patch
method.
The following example updates the input endpoint used by the channel. Not all fields can be updated; see the list of supported fields.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pageLOCATION
: the location of the channel; use one of the supported regionsShow locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: the user-defined identifier for the channel to updateINPUT_ID
: the user-defined identifier for the new input endpoint to use
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/channels/CHANNEL_ID", "verb": "update", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Start or stop a channel
Use the following methods to start or stop a channel. The server creates a part
of the video pipeline when the channels.start
request is received. The server
releases a part of the video pipeline when the channels.stop
request is
received.
Start a channel
To start a channel, use the
projects.locations.channels.start
method.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pageLOCATION
: the location where your channel is located; use one of the supported regionsShow locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: a user-defined identifier for the channel
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/channels/CHANNEL_ID", "verb": "start", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Stop a channel
To stop a channel, use the
projects.locations.channels.stop
method.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pageLOCATION
: the location where your channel is located; use one of the supported regionsShow locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: a user-defined identifier for the channel
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/channels/CHANNEL_ID", "verb": "stop", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
List channels
To list all of the channels you created in a location, use the
projects.locations.channels.list
method.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pageLOCATION
: the location where your channel is located; use one of the supported regionsShow locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "channels": [ { "name": "projects/PROJECT_NUMBER/locations/LOCATION/channels/my-channel", "createTime": CREATE_TIME, "updateTime": UPDATE_TIME, "activeInput": "INPUT_ID", "output": { "uri": "gs://BUCKET_NAME" }, ... }, { "name": "projects/PROJECT_NUMBER/locations/LOCATION/channels/my-channel2", "createTime": CREATE_TIME, "updateTime": UPDATE_TIME, "activeInput": "my-other-input", "output": { "uri": "gs://BUCKET_NAME" }, ... } ] }
C#
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Delete a channel
To delete a channel, use the
projects.locations.channels.delete
method. You must stop the channel and
delete all channel events
before you can delete the channel.
REST
Before using any of the request data, make the following replacements:
PROJECT_NUMBER
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pageLOCATION
: the location where your channel is located; use one of the supported regionsShow locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-northeast1
asia-southeast1
australia-southeast1
europe-west1
europe-west2
europe-west3
europe-west4
CHANNEL_ID
: a user-defined identifier for the channel
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime": CREATE_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/channels/CHANNEL_ID", "verb": "delete", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
C#
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Ruby
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
What's next
Learn how to create and manage channel events.