Avant de commencer

Cette page explique comment créer un projet Google Cloud , activer l'API Transcoder, créer des identifiants d'authentification et accorder un ou plusieurs rôles IAM à votre compte. Cette page explique également comment configurer un bucket Cloud Storage pour enregistrer les fichiers de sortie du job de transcodage.

Créer un projet

  1. 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.
  2. Install the Google Cloud CLI.

  3. Si vous utilisez un fournisseur d'identité (IdP) externe, vous devez d'abord vous connecter à gcloud CLI avec votre identité fédérée.

  4. Pour initialiser gcloudCLI, exécutez la commande suivante :

    gcloud init
  5. Create or select a Google Cloud project.

    • 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.

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Transcoder API:

    gcloud services enable transcoder.googleapis.com
  8. 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.

  9. 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 example, myemail@example.com.
    • ROLE: the IAM role that you grant to your user account.
  10. Install the Google Cloud CLI.

  11. Si vous utilisez un fournisseur d'identité (IdP) externe, vous devez d'abord vous connecter à gcloud CLI avec votre identité fédérée.

  12. Pour initialiser gcloudCLI, exécutez la commande suivante :

    gcloud init
  13. Create or select a Google Cloud project.

    • 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.

  14. Verify that billing is enabled for your Google Cloud project.

  15. Enable the Transcoder API:

    gcloud services enable transcoder.googleapis.com
  16. 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.

  17. 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 example, myemail@example.com.
    • ROLE: the IAM role that you grant to your user account.
  18. Créer un bucket Cloud Storage

    Pour enregistrer les fichiers de sortie du job de transcodeur, créez un bucket Cloud Storage au même emplacement que vos jobs de l'API Transcoder. Pour en savoir plus, consultez la section Composants multimédias de la page "Emplacements".

    1. Create a Cloud Storage bucket and configure it as follows:
      • Set the storage class to S (Standard).
      • Définissez l'emplacement de stockage sur : US (États-Unis).
      • Remplacez BUCKET_NAME par un nom de bucket unique. N'incluez aucune information sensible dans le nom des buckets, car leur espace de noms est global et visible par tous.
      • gcloud storage buckets create gs://BUCKET_NAME --default-storage-class STANDARD --location US
      • Cliquez sur Créer un dossier et saisissez un nom pour créer un dossier dans lequel enregistrer les sorties vidéo encodées.

    En savoir plus

    Recevez des notifications Pub/Sub pour les mises à jour de tâches depuis l'API Transcoder.