Antes de comenzar

En esta página, se muestra cómo crear un proyecto Google Cloud , habilitar la API de Transcoder, crear credenciales de autenticación y otorgar a tu cuenta uno o más roles de IAM. En esta página, también se muestra cómo configurar un bucket de Cloud Storage para guardar los archivos de salida del trabajo del transcodificador.

Crea un proyecto

  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 usas un proveedor de identidad externo (IdP), primero debes acceder a gcloud CLI con tu identidad federada.

  4. Para inicializar la CLI de gcloud, ejecuta el siguiente comando:

    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 usas un proveedor de identidad externo (IdP), primero debes acceder a gcloud CLI con tu identidad federada.

  12. Para inicializar la CLI de gcloud, ejecuta el siguiente comando:

    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. Cree un bucket de Cloud Storage

    Para guardar los archivos de salida del trabajo de Transcoder, crea un bucket de Cloud Storage en la misma ubicación que tus trabajos de la API de Transcoder. Para obtener más información, consulta la sección Recursos multimedia de la página Ubicaciones.

    1. Create a Cloud Storage bucket and configure it as follows:
      • Set the storage class to S (Estándar).
      • Configura la ubicación de almacenamiento de la siguiente manera: US (Estados Unidos).
      • Reemplaza BUCKET_NAME por un nombre de bucket único. No incluyas información sensible en el nombre del bucket porque su espacio de nombres es global y públicamente visible.
      • gcloud storage buckets create gs://BUCKET_NAME --default-storage-class STANDARD --location US
      • Haz clic en Crear carpeta y, luego, ingresa un nombre para crear una carpeta en la que se guarden los resultados del video codificado.

    Más información

    Recibe notificaciones de Pub/Sub para actualizaciones de trabajos de la API de Transcoder.