Hinweis

Auf dieser Seite erfahren Sie, wie Sie ein Google Cloud -Projekt einrichten und Dienstkonten für den Zugriff auf das Projekt konfigurieren.

Google Cloud -Projekt einrichten

So richten Sie ein Google Cloud Projekt ein:

  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. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

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

  4. Enable the Video Stitcher API.

    Enable the API

  5. Create a service account:

    1. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    2. Select your project.
    3. 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.

    4. Click Create and continue.
    5. Grant the Video Stitcher Admin role to the service account.

      To grant the role, find the Select a role list, then select Video Stitcher Admin.

    6. Click Continue.
    7. Click Done to finish creating the service account.

      Do not close your browser window. You will use it in the next step.

  6. Create a service account key:

    1. In the Google Cloud console, click the email address for the service account that you created.
    2. Click Keys.
    3. Click Add key, and then click Create new key.
    4. Click Create. A JSON key file is downloaded to your computer.
    5. Click Close.
  7. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your credentials. This variable applies only to your current shell session, so if you open a new session, set the variable again.

  8. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

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

  10. Enable the Video Stitcher API.

    Enable the API

  11. Create a service account:

    1. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    2. Select your project.
    3. 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.

    4. Click Create and continue.
    5. Grant the Video Stitcher Admin role to the service account.

      To grant the role, find the Select a role list, then select Video Stitcher Admin.

    6. Click Continue.
    7. Click Done to finish creating the service account.

      Do not close your browser window. You will use it in the next step.

  12. Create a service account key:

    1. In the Google Cloud console, click the email address for the service account that you created.
    2. Click Keys.
    3. Click Add key, and then click Create new key.
    4. Click Create. A JSON key file is downloaded to your computer.
    5. Click Close.
  13. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your credentials. This variable applies only to your current shell session, so if you open a new session, set the variable again.

  14. Install the Google Cloud CLI.

  15. Wenn Sie einen externen Identitätsanbieter (IdP) verwenden, müssen Sie sich zuerst mit Ihrer föderierten Identität in der gcloud CLI anmelden.

  16. Führen Sie folgenden Befehl aus, um die gcloud CLI zu initialisieren:

    gcloud init
  17. Testen Sie die Authentifizierungsumgebung mit der gcloud CLI. Prüfen Sie, ob der folgende Befehl einen Textstring ohne Fehler ausgibt:
    gcloud auth application-default print-access-token
  18. Dienstkonto aktivieren

    1. Legen Sie im Terminal das aktive Projekt für gcloud-Befehle fest. Ersetzen Sie YOUR_PROJECT_ID durch Ihre Projekt-ID.
      gcloud config set project YOUR_PROJECT_ID
    2. Aktivieren Sie das Dienstkonto. Ersetzen Sie PATH_TO_YOUR_SERVICE_KEY durch den Pfad zur JSON-Datei, die Sie auf Ihren lokalen Computer heruntergeladen haben.
      gcloud auth activate-service-account --key-file PATH_TO_YOUR_SERVICE_KEY

    Mit diesem Dienstkonto autorisieren Sie den Zugriff und rufen die Video Stitcher API auf.

    Dienstkonto nur mit Berechtigungen zum Erstellen von Sitzungen erstellen

    Da ein OAuth-Token an eine Clientanwendung übergeben wird, sollten Sie ein separates Dienstkonto mit Berechtigungen nur zum Erstellen einer Sitzung erstellen. So kann ein geleaktes OAuth-Token Ihre Ressourcen wie VOD-/Live-Konfigurationen oder CDN-Schlüssel nicht gefährden.

    Create a service account:

    1. In the Google Cloud console, go to the Create service account page.

      Go to Create service account
    2. Select your project.
    3. 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.

    4. Click Create and continue.
    5. Grant the Video Stitcher User role to the service account.

      To grant the role, find the Select a role list, then select Video Stitcher User.

    6. Click Continue.
    7. 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:

    1. In the Google Cloud console, click the email address for the service account that you created.
    2. Click Keys.
    3. Click Add key, and then click Create new key.
    4. Click Create. A JSON key file is downloaded to your computer.
    5. Click Close.

    Livestream einrichten

    Wenn du Anzeigen in einen Livestream einfügst, folge der Anleitung in diesem Abschnitt (oder der Anleitung für VOD).

    Nachdem Sie das Dienstkonto erstellt haben, müssen Sie es mit Ihrem Ad Manager-Konto verknüpfen. Dadurch kann die Video Stitcher API Livestream-Ereignisse in Ihrem Namen erstellen. Folgen Sie dieser Anleitung, um Ihrem Dienstkonto Zugriff zu gewähren:

    1. Melden Sie sich in Google Ad Manager an.
    2. Klicken Sie auf Admin > Globale Einstellungen.
    3. Prüfen Sie, ob API-Zugriff aktiviert ist.
    4. Klicken Sie auf Dienstkontonutzer hinzufügen.
    5. Füllen Sie das Formular aus, einschließlich der E-Mail-Adresse des zuvor erstellten Dienstkontos.
    6. Wählen Sie eine Rolle aus, die die Berechtigung Videocontent mit der dynamischen Anzeigenbereitstellung des Video-Stitching-Tools von Google Cloud verwalten enthält. Es wird empfohlen, speziell für die Verwaltung dieses Dienstkontos eine benutzerdefinierte Rolle mit dem Namen Live Stream Manager zu erstellen. Die benutzerdefinierte Rolle sollte mindestens die folgenden Berechtigungen haben:
      • Videocontent mit der dynamischen Anzeigenbereitstellung des Video-Stitching-Tools von Google Cloud verwalten
      • Creatives ansehen (erforderlich für die vorherige Berechtigung)
      • Videocontent, Gruppen und Metadaten aufrufen
      • Contentquellen ansehen
    7. Wenn in Ihrem Ad Manager-Netzwerk Teams verwendet werden, müssen Sie dem Dienstkontonutzer das Team „Alle Entitäten“ zuweisen.
    8. Klicken Sie auf Speichern und bestätigen Sie, dass das Dienstkonto hinzugefügt werden soll.

    Livestream erstellen

    Du kannst einen der Live Stream API-Schnellstarts verwenden, um einen Livestream einzurichten. Sowohl HLS- als auch MPEG-DASH-Livestreams werden unterstützt (siehe Anforderungen an Quellmanifeste). Dieses Verfahren ist optional. Sie können auch Ihren eigenen Livestream verwenden.

    In den Kurzanleitungen zur Live Stream API werden Standardanmeldedaten für Anwendungen für die Authentifizierung verwendet. Sie können aber das Dienstkonto verwenden, das Sie bereits eingerichtet haben. Bei dieser Option muss das Dienstkonto die Rolle Livestream-Bearbeiter haben.

    Lassen Sie den Livestream aktiv. Führen Sie die Schritte im Abschnitt Bereinigen erst aus, wenn Sie den Livestream beendet haben.

    Anforderungen an Quellmanifeste

    Mit der Video Stitcher API wird die Konfiguration in Ad Manager registriert, indem das Quellmanifest geparst wird. Das Quellmanifest muss je nach Format bestimmte Merkmale aufweisen.

    HLS

    • Das Containerformat kann eines der folgenden sein:
      • gemuxter MPEG-TS
      • demultiplextes MPEG-TS
      • nicht gemultiplextes FMP4
    • Mindestens eine Darstellung im Manifest mit den folgenden (korrekt ausgefüllten) Feldern:
      • Codecs
      • Bandbreite

    MPEG-DASH

    • MPD@type auf „dynamisch“ festgelegt (@type="dynamic")
    • MPD@profiles enthält das ISO Live-Profil urn:mpeg:dash:profile:isoff-live:2011
    • Sollte mehrere Zeiträume umfassen, wobei jeder Zeitraum einen oder mehrere Anpassungssätze enthält.
    • Jeder Anpassungssatz enthält eine oder mehrere Darstellungen.
    • Die Darstellungen enthalten oder erben ein SegmentTemplate mit der Kennung $Number$ oder $Time$.
    • @segmentAlignment ist für alle Anpassungssätze auf „true“ gesetzt.
    • Darstellungen dürfen nicht leer sein

    VOD-Stream einrichten

    Wenn Sie Anzeigen in einen VOD-Stream einfügen, folgen Sie der Anleitung in diesem Abschnitt (oder der Anleitung für einen Livestream).

    VOD-Quelldateien erstellen

    Für diesen Workflow sind eine MPEG-DASH-Manifestdatei (MPD) oder eine HTTP Live Streaming-Manifestdatei (HLS) (M3U8) sowie die zugehörigen Segmentdateien erforderlich. Sie können Ihre eigenen vorhandenen VOD-Dateien verwenden oder mit der Transcoder API VOD-Quelldateien erstellen.