Stay organized with collections
Save and categorize content based on your preferences.
This page shows how to create a Google Cloud project, enable the
Live Stream API, create
authentication credentials, and grant
your account one or more
IAM roles. This page also shows how
to create a Cloud Storage bucket to hold the live stream output files and
how to install an encoder to generate input streams that the API processes.
Create a project
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.
USER_IDENTIFIER: the identifier for your user
account—for example, myemail@example.com.
ROLE: the IAM role that you grant to your user account.
Create a Cloud Storage bucket
Create a Cloud Storage bucket to hold the live stream manifest and segment
files.
Create a Cloud Storage bucket and configure it as follows:
Set the storage class to
S (Standard).
Set the storage location to the following:
US (United States).
Replace BUCKET_NAME with
a unique bucket name. Don't include sensitive information in the
bucket name because the bucket namespace is global and publicly visible.
gcloudstoragebucketscreategs://BUCKET_NAME--default-storage-class STANDARD --locationUS
Install an encoder
To use the API, you need an encoder to generate input streams
that the API processes.
Install ffmpeg as this page
covers how to use ffmpeg to generate input streams. You can install this in
Cloud Shell using the following command.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Before you begin\n\nThis page shows how to create a Google Cloud project, enable the\nLive Stream API, create\n[authentication credentials](/livestream/docs/authentication), and grant\nyour account one or more\n[IAM roles](/livestream/docs/access-control#roles). This page also shows how\nto create a Cloud Storage bucket to hold the live stream output files and\nhow to install an encoder to generate input streams that the API processes.\n\nCreate a project\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n- [Create or select a Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n - Create a Google Cloud project:\n\n ```\n gcloud projects create PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with a name for the Google Cloud project you are creating.\n - Select the Google Cloud project that you created:\n\n ```\n gcloud config set project PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your Google Cloud project name.\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Live Stream API:\n\n\n ```bash\n gcloud services enable livestream.googleapis.com\n ```\n-\n\n If you're using a local shell, then create local authentication credentials for your user\n account:\n\n ```bash\n gcloud auth application-default login\n ```\n\n You don't need to do this if you're using Cloud Shell.\n\n\n If an authentication error is returned, and you are using an external identity provider\n (IdP), confirm that you have\n [signed in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n-\n Grant roles to your user account. Run the following command once for each of the following\n IAM roles:\n `roles/livestream.editor`\n\n ```bash\n gcloud projects add-iam-policy-binding PROJECT_ID --member=\"user:\u003cvar translate=\"no\"\u003eUSER_IDENTIFIER\u003c/var\u003e\" --role=ROLE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID.\n - \u003cvar translate=\"no\"\u003eUSER_IDENTIFIER\u003c/var\u003e: the identifier for your user account---for example, `myemail@example.com`.\n - \u003cvar translate=\"no\"\u003eROLE\u003c/var\u003e: the IAM role that you grant to your user account.\n\n-\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n- If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n-\n To [initialize](/sdk/docs/initializing) the gcloud CLI, run the following command:\n\n ```bash\n gcloud init\n ```\n- [Create or select a Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects).\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n - Create a Google Cloud project:\n\n ```\n gcloud projects create PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with a name for the Google Cloud project you are creating.\n - Select the Google Cloud project that you created:\n\n ```\n gcloud config set project PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with your Google Cloud project name.\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Live Stream API:\n\n\n ```bash\n gcloud services enable livestream.googleapis.com\n ```\n-\n\n If you're using a local shell, then create local authentication credentials for your user\n account:\n\n ```bash\n gcloud auth application-default login\n ```\n\n You don't need to do this if you're using Cloud Shell.\n\n\n If an authentication error is returned, and you are using an external identity provider\n (IdP), confirm that you have\n [signed in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n-\n Grant roles to your user account. Run the following command once for each of the following\n IAM roles:\n `roles/livestream.editor`\n\n ```bash\n gcloud projects add-iam-policy-binding PROJECT_ID --member=\"user:\u003cvar translate=\"no\"\u003eUSER_IDENTIFIER\u003c/var\u003e\" --role=ROLE\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID.\n - \u003cvar translate=\"no\"\u003eUSER_IDENTIFIER\u003c/var\u003e: the identifier for your user account---for example, `myemail@example.com`.\n - \u003cvar translate=\"no\"\u003eROLE\u003c/var\u003e: the IAM role that you grant to your user account.\n\n\u003cbr /\u003e\n\n| **Note:** Add the IAM role `roles/storage.admin` to your Google Account for more control over your project's Cloud Storage buckets.\n\nCreate a Cloud Storage bucket\n-----------------------------\n\nCreate a Cloud Storage bucket to hold the live stream manifest and segment\nfiles.\n- Create a Cloud Storage bucket and configure it as follows:\n - Set the storage class to `S` (Standard).\n - Set the storage location to the following: `US` (United States).\n - Replace \u003cvar translate=\"no\"\u003eBUCKET_NAME\u003c/var\u003e with a unique bucket name. Don't include sensitive information in the bucket name because the bucket namespace is global and publicly visible.\n\n ```bash\n gcloud storage buckets create gs://BUCKET_NAME --default-storage-class STANDARD --location US\n ```\n\nInstall an encoder\n------------------\n\n- To use the API, you need an encoder to generate input streams that the API processes.\n- Install [`ffmpeg`](https://ffmpeg.org/download.html) as this page covers how to use `ffmpeg` to generate input streams. You can install this in Cloud Shell using the following command. \n\n sudo apt install ffmpeg"]]