Halaman ini menunjukkan cara membuat project Google Cloud , mengaktifkan Transcoder API, membuat kredensial autentikasi, dan memberikan satu atau beberapa peran IAM ke akun Anda. Halaman ini juga menunjukkan cara menyiapkan bucket Cloud Storage untuk menyimpan file output tugas transkoder.
Membuat project
-
Install the Google Cloud CLI.
-
Konfigurasi gcloud CLI untuk menggunakan identitas gabungan Anda.
Untuk mengetahui informasi selengkapnya, lihat Login ke gcloud CLI dengan identitas gabungan Anda.
-
Untuk melakukan inisialisasi gcloud CLI, jalankan perintah berikut:
gcloud init
-
Create or select a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_ID
with a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_ID
with your Google Cloud project name.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Transcoder API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles.gcloud services enable transcoder.googleapis.com
-
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
-
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/transcoder.admin
gcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID
: Your project ID.USER_IDENTIFIER
: The identifier for your user account. For examples, see Represent workforce pool users in IAM policies.ROLE
: The IAM role that you grant to your user account.
-
Create a Cloud Storage bucket and configure it as follows:
-
Set the storage class to
S
(Standard). -
Tetapkan lokasi penyimpanan sebagai berikut:
US
(Amerika Serikat). -
Ganti
BUCKET_NAME
dengan nama bucket yang unik. Jangan sertakan informasi sensitif pada nama bucket karena namespace bucket bersifat global dan dapat dilihat publik. - Klik Buat Folder dan masukkan nama untuk membuat folder tempat menyimpan output video yang dienkode.
gcloud storage buckets create gs://BUCKET_NAME --default-storage-class STANDARD --location US
-
Set the storage class to
Membuat bucket Cloud Storage
Untuk menyimpan file output tugas transkoder, buat bucket Cloud Storage di lokasi yang sama dengan tugas Transcoder API Anda. Untuk mengetahui informasi selengkapnya, lihat bagian Aset media di halaman Lokasi.
Informasi selengkapnya
Menerima notifikasi Pub/Sub untuk update tugas dari Transcoder API.