Quickstart for HLS live stream
This page shows you how to create a basic HLS live stream job
using the default settings of the Live Stream API and curl
or Windows PowerShell.
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.
-
Enable the Live Stream API.
-
Create a service account:
-
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart
. - Click Create and continue.
-
To provide access to your project, grant the following role(s) to your service account: Live Stream > Live Stream Editor .
In the Select a role list, select a role.
For additional roles, click
Add another role and add each additional role. - Click Continue.
-
Click Done to finish creating the service account.
Do not close your browser window. You will use it in the next step.
-
-
Create a service account key:
- In the Google Cloud console, click the email address for the service account that you created.
- Click Keys.
- Click Add key, and then click Create new key.
- Click Create. A JSON key file is downloaded to your computer.
- Click Close.
-
Set the environment variable
GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.
-
Enable the Live Stream API.
-
Create a service account:
-
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart
. - Click Create and continue.
-
To provide access to your project, grant the following role(s) to your service account: Live Stream > Live Stream Editor .
In the Select a role list, select a role.
For additional roles, click
Add another role and add each additional role. - Click Continue.
-
Click Done to finish creating the service account.
Do not close your browser window. You will use it in the next step.
-
-
Create a service account key:
- In the Google Cloud console, click the email address for the service account that you created.
- Click Keys.
- Click Add key, and then click Create new key.
- Click Create. A JSON key file is downloaded to your computer.
- Click Close.
-
Set the environment variable
GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again. - Install and initialize the Google Cloud CLI.
- In the same terminal you used to set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable, use thegcloud
tool to test your authentication environment. Check that the following command outputs a text string without errors:gcloud auth application-default print-access-token
Create a Cloud Storage bucket
Create a Cloud Storage bucket to hold the live stream manifest and segment files.
Google Cloud console
- In the Google Cloud console, go to the Cloud Storage Browser page.
- Click Create bucket.
- On the Create a bucket page, enter your bucket information. To go to the next
step, click Continue.
- For Name your bucket, enter a name that meets the bucket naming requirements.
-
For Choose where to store your data, do the following:
- Select a Location type option.
- Select a Location option.
- For Choose a default storage class for your data, select the following: Standard.
- For Choose how to control access to objects, select an Access control option.
- For Advanced settings (optional), specify an encryption method, a retention policy, or bucket labels.
- Click Create.
Command line
-
Create a Cloud Storage bucket:
gsutil mb gs://BUCKET_NAMEReplace BUCKET_NAME with a bucket name that meets the bucket naming requirements.
Install an encoder
To use the API, you need an encoder to generate input streams that the API processes.
Install ffmpeg
as this guide
covers how to use ffmpeg
to generate input streams. For your production jobs,
you may want to use a different encoder instead.
Create an input endpoint
To start a live stream, you first must use the
projects.locations.inputs.create
method to create an input endpoint. You send the input stream to this endpoint.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location in which to create the input
endpoint; use one of the supported regions:
us-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
- INPUT_ID: a user-defined identifier for the new input
endpoint to create (to which you send your input stream). This value must be 1-63 characters, begin and end with
[a-z0-9]
, and can contain dashes (-) between characters. For example,my-input
.
Request JSON body:
{ "type": "RTMP_PUSH" }
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/inputs/INPUT_ID", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Copy the returned OPERATION_ID to use in the next section.
Check for the result
Use the projects.locations.operations.get
method to check if the input endpoint has been created. If the response contains
"done: false"
, repeat the command until the response contains "done: true"
.
Creating the first input endpoint in a region may take up to 10 minutes.
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your input endpoint is
located; use one of the supported regions:
us-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
- OPERATION_ID: the identifier for the operation
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, "endTime": END_TIME, "target": "projects/PROJECT_NUMBER/locations/LOCATION/inputs/INPUT_ID", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": true, "response": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.Input", "name": "projects/PROJECT_ID/locations/LOCATION/inputs/INPUT_ID", "createTime": CREATE_TIME, "updateTime": UPDATE_TIME, "type": "RTMP_PUSH", "uri": INPUT_STREAM_URI, # For example, "rtmp://1.2.3.4/live/b8ebdd94-c8d9-4d88-a16e-b963c43a953b", "tier": "HD" } }
Find the uri
field and copy the returned INPUT_STREAM_URI to use later in the Send the
input stream section.
Create a channel
To transcode the input stream into an output stream, you need to create a channel resource.
To create a channel, use the
projects.locations.channels.create
method. The following example creates a channel generating an HLS
live stream that consists of a single, high-definition (1280x720) rendition.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location in which to create the
channel; use one of the supported regions:
us-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 characters - INPUT_ID: the user-defined identifier for the input endpoint
- BUCKET_NAME: the name of the Cloud Storage bucket you created to hold the live stream manifest and segment files
Request JSON body:
{ "inputAttachments": [ { "key": "my-input", "input": "projects/PROJECT_NUMBER/locations/LOCATION/inputs/INPUT_ID" } ], "output": { "uri": "gs://BUCKET_NAME" }, "elementaryStreams": [ { "key": "es_video", "videoStream": { "h264": { "profile": "high", "widthPixels": 1280, "heightPixels": 720, "bitrateBps": 3000000, "frameRate": 30 } } }, { "key": "es_audio", "audioStream": { "codec": "aac", "channelCount": 2, "bitrateBps": 160000 } } ], "muxStreams": [ { "key": "mux_video_ts", "container": "ts", "elementaryStreams": ["es_video", "es_audio"], "segmentSettings": { "segmentDuration": "2s" } } ], "manifests": [ { "fileName": "main.m3u8", "type": "HLS", "muxStreams": [ "mux_video_ts" ], "maxSegmentCount": 5 } ] }
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 }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Get the channel
You can check for the result of the channel creation operation using the new operation ID.
Once the channel has been created, use the
projects.locations.channels.get
method to query the channel state.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your channel is
located; use one of the supported regions:
us-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": [ { "fileName": "main.m3u8", "type": "HLS", "muxStreams": [ "mux_video_ts", ], "maxSegmentCount": 5, "segmentKeepDuration": "60s" } ], "streamingState": "STOPPED" }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
The response should contain the following:
{
...
"streamingState": "STOPPED"
...
}
This response indicates that you can now start the channel.
Start the channel
Use the
projects.locations.channels.start
method to start the channel. A channel must be started before it can accept
input streams or generate an output stream.
Starting the first channel in a region takes about 10 minutes.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your channel is
located; use one of the supported regions:
us-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 }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Send the input stream
To determine if the channel has started, get the channel information as done previously. The response should contain the following:
{
...
"streamingState": "AWAITING_INPUT"
...
}
Now that the channel is ready, send a test input stream to the input endpoint to generate the live stream.
Open a new terminal window. Run the following command, using the INPUT_STREAM_URI from the Check for the result section:
ffmpeg -re -f lavfi -i "testsrc=size=1280x720 [out0]; sine=frequency=500 [out1]" \
-acodec aac -vcodec h264 -f flv INPUT_STREAM_URI
Check that the channel is streaming
To check the status of the live streaming operation, get the channel information as done previously. The response should contain the following:
{
...
"streamingState": "STREAMING"
...
}
Verify the contents in the Cloud Storage bucket
Open the Cloud Storage bucket. Verify that it contains the following files and directories:
main.m3u8
mux_video_ts/
- Multiple
segment-segment-number.ts
files - A single
index-1.m3u8
file
- Multiple
Play the generated live stream
To play the generated media file in Shaka Player, complete the following steps:
- Make the Cloud Storage bucket you created publicly readable.
- To enable cross-origin resource
sharing (CORS) on a Cloud Storage bucket, do the following:
- Create a JSON file that contains the following:
[ { "origin": ["https://shaka-player-demo.appspot.com/"], "responseHeader": ["Content-Type", "Range"], "method": ["GET", "HEAD"], "maxAgeSeconds": 3600 } ]
-
Run the following command after replacing JSON_FILE_NAME with
the name of the JSON file you created in the previous step:
gsutil cors set JSON_FILE_NAME.json gs://BUCKET_NAME
- Create a JSON file that contains the following:
- In the Cloud Storage bucket, find the generated
main.m3u8
file. Click Copy URL in the file's Public access column. - Navigate to Shaka Player, an online live stream player.
- Click Custom Content in the top navigation bar.
- Click the + button.
Paste the public URL of the file into the Manifest URL box.
Type a name in the Name box.
Click Save.
Click Play.
You should see a test pattern play as the live stream.
Add an ad break marker to the live stream
Use the
projects.locations.channels.events.create
method to add an ad break marker to the live stream.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your channel is
located; use one of the supported regions:
us-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
- EVENT_ID: a user-defined identifier for the event
Request JSON body:
{ "adBreak": { "duration": "100s" }, "executeNow": true }
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/events/EVENT_ID", "createTime": CREATE_TIME, "updateTime": UPDATE_TIME, "adBreak": { "duration": "100s" }, "executeNow": true, "state": "SCHEDULED" }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Verify the ad break marker exists
When the ad marker is inserted in the live stream, an event labeledCUE-OUT
appears in the HLS manifest for the specified ad
duration (100s).
Run the following command to see the contents of the generated HLS manifest:
gsutil cat gs://BUCKET_NAME/mux_video_ts/index-1.m3u8
You may have to run the gsutil cat
command multiple times until the
CUE-OUT
section appears:
...
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:40
#EXT-X-DISCONTINUITY-SEQUENCE:0
#EXT-X-CUE-OUT:100.000000
#EXT-X-PROGRAM-DATE-TIME:2021-07-13T19:11:49.956Z
#EXTINF:2.000000
segment-0000000040.ts
#EXT-X-CUE-OUT-CONT:ElapsedTime=2.000000,Duration=100.000000
#EXT-X-PROGRAM-DATE-TIME:2021-07-13T19:11:51.956Z
#EXTINF:2.000000
segment-0000000041.ts
#EXT-X-CUE-OUT-CONT:ElapsedTime=4.000000,Duration=100.000000
#EXT-X-PROGRAM-DATE-TIME:2021-07-13T19:11:53.956Z
#EXTINF:2.000000
segment-0000000042.ts
#EXT-X-CUE-OUT-CONT:ElapsedTime=6.000000,Duration=100.000000
#EXT-X-PROGRAM-DATE-TIME:2021-07-13T19:11:55.956Z
#EXTINF:2.000000
segment-0000000043.ts
#EXT-X-CUE-OUT-CONT:ElapsedTime=8.000000,Duration=100.000000
...
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
Stop the channel
Use the
projects.locations.channels.stop
method to stop the channel. You must stop the channel before you can delete it.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your channel is
located; use one of the supported regions:
us-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 }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Use the OPERATION_ID to check for the operation
status until you get "done":true
in the result.
Stop the input stream
If you used ffmpeg
to send the input stream, the connection is automatically
broken after you stop the channel.
If you used other encoders with retry mechanisms, you may need to manually stop the input stream.
Delete the event
Use the
projects.locations.channels.events.delete
method to delete the ad break event. You must delete channel events before you
can delete the channel.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your channel is
located; use one of the supported regions:
us-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
- EVENT_ID: a user-defined identifier for the event
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{}
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Delete the channel
Use the
projects.locations.channels.delete
method to delete the channel. You must delete the channel before you can delete
the input endpoint that is used by the channel.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your channel is
located; use one of the supported regions:
us-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 }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Use the OPERATION_ID to check for the operation
status until you get "done":true
in the result.
Delete the input endpoint
Use the
projects.locations.inputs.delete
method to delete the input endpoint.
REST & CMD LINE
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER: your Google Cloud project number; this is listed below the Project ID on the IAM Settings page
- LOCATION: the location where your input endpoint is
located; use one of the supported regions:
us-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
- INPUT_ID: the user-defined identifier for the input endpoint
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/inputs/INPUT_ID", "verb": "delete", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
Go
Before trying this sample, follow the Go setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Go API reference documentation.
Java
Before trying this sample, follow the Java setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Java API reference documentation.
Node.js
Before trying this sample, follow the Node.js setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Node.js API reference documentation.
Python
Before trying this sample, follow the Python setup instructions in the Live Stream API quickstart using client libraries. For more information, see the Live Stream API Python API reference documentation.
Delete the Cloud Storage bucket
Note that all files and folders in the bucket generated by the Live Stream API are deleted once you stop the channel.
In the Google Cloud console, go to the Cloud Storage Browser page.
Select the checkbox next to the bucket that you created.
Click Delete.
In the pop-up window that appears, click Delete to permanently delete the bucket and its contents.
What's next
- Try the quickstart instructions for an MPEG-DASH live stream.
- Learn how to configure a backup input stream.