{"id":581,"date":"2026-04-14T14:54:38","date_gmt":"2026-04-14T14:54:38","guid":{"rendered":"https:\/\/www.devopsschool.com\/tutorials\/google-cloud-video-stitcher-api-tutorial-architecture-pricing-use-cases-and-hands-on-guide-for-ai-and-ml\/"},"modified":"2026-04-14T14:54:38","modified_gmt":"2026-04-14T14:54:38","slug":"google-cloud-video-stitcher-api-tutorial-architecture-pricing-use-cases-and-hands-on-guide-for-ai-and-ml","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/tutorials\/google-cloud-video-stitcher-api-tutorial-architecture-pricing-use-cases-and-hands-on-guide-for-ai-and-ml\/","title":{"rendered":"Google Cloud Video Stitcher API Tutorial: Architecture, Pricing, Use Cases, and Hands-On Guide for AI and ML"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Category<\/h2>\n\n\n\n<p>AI and ML<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Introduction<\/h2>\n\n\n\n<p>Video Stitcher API is a managed Google Cloud service for <strong>server-side ad insertion (SSAI)<\/strong>: it dynamically <strong>stitches ads into video streams<\/strong> (VOD or live) by generating a playback manifest that includes both the original content and ad media.<\/p>\n\n\n\n<p>In simple terms: you provide a video stream (HLS\/DASH) and an ad decision source (such as an ad tag), and Video Stitcher API returns a <strong>new playback URL<\/strong>. When a player loads that URL, it plays the same content but with ads inserted at the right points\u2014without the player needing to run a client-side ad SDK.<\/p>\n\n\n\n<p>Technically, Video Stitcher API sits between your player and your origins\/ad systems. It <strong>creates per-viewer sessions<\/strong>, calls out to an ad server for ad decisions, and produces manifests (and supporting tracking) designed for SSAI workflows. It integrates naturally with Google Cloud components such as <strong>Cloud Storage<\/strong>, <strong>Media CDN \/ Cloud CDN<\/strong>, <strong>Cloud Logging<\/strong>, and <strong>Cloud Monitoring<\/strong>. While it is not an \u201cAI model\u201d service, it is often deployed alongside <strong>AI and ML<\/strong> pipelines (for example, using ML-driven ad decisioning, churn prediction, or audience segmentation) where ads or content variants are selected based on predictions.<\/p>\n\n\n\n<p>The core problem it solves is reliable, scalable ad insertion for modern streaming\u2014reducing ad blockers\u2019 effectiveness, improving playback consistency across devices, and simplifying player integrations by shifting ad logic to the server side.<\/p>\n\n\n\n<blockquote>\n<p>Service naming note (verify in official docs): Google Cloud has historically used \u201cCloud Video Stitcher\u201d phrasing in some materials. The current API and product name in Google Cloud documentation is <strong>Video Stitcher API<\/strong>. Always confirm the latest naming and feature scope on the official docs before designing production architecture.<br\/>\nOfficial docs landing page: https:\/\/cloud.google.com\/video-stitcher\/docs<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">2. What is Video Stitcher API?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Official purpose<\/h3>\n\n\n\n<p>Video Stitcher API is a Google Cloud managed API that enables <strong>server-side ad insertion<\/strong> by generating <strong>ad-stitched playback manifests<\/strong> for <strong>video-on-demand (VOD)<\/strong> and\/or <strong>live streaming<\/strong> workflows (availability depends on your configuration and supported features\u2014verify your exact use case in official docs).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Core capabilities (what it does)<\/h3>\n\n\n\n<p>At a practical level, Video Stitcher API helps you:\n&#8211; Define <strong>stitching configurations<\/strong> (where to fetch content, how to request ads, and how to handle slate\/fallback content).\n&#8211; Create <strong>playback sessions<\/strong> per viewer\/device\/play request.\n&#8211; Produce <strong>playback manifests<\/strong> (for example HLS <code>.m3u8<\/code> or DASH <code>.mpd<\/code>, depending on supported formats) that include ads inserted into the timeline.\n&#8211; Support ad tracking workflows typically required for monetization reporting (exact tracking mechanisms and supported ad standards should be verified against the current API reference).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Major components (conceptual model)<\/h3>\n\n\n\n<p>Most SSAI implementations using Video Stitcher API include these building blocks (resource names vary\u2014confirm in the REST reference):\n&#8211; <strong>VOD config \/ Live config<\/strong>: Configuration objects defining the content source and ad decisioning parameters.\n&#8211; <strong>Session<\/strong>: A per-play request object created from a config; sessions often produce a unique playback URI.\n&#8211; <strong>Slate<\/strong>: A fallback asset that can be inserted when an ad is unavailable or fails (feature and configuration options vary).\n&#8211; <strong>CDN key \/ signing<\/strong> (optional): Integrations to secure and authorize playback URLs via a CDN, depending on your distribution design.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Service type<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Managed Google Cloud API service<\/strong> (control plane via REST\/gRPC; playback is served via URLs returned by the API).<\/li>\n<li>You integrate it into applications, backend services, video platforms, or playback gateways.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Scope: regional\/global\/project<\/h3>\n\n\n\n<p>Video Stitcher API resources are typically <strong>project-scoped<\/strong> and organized under <strong>locations (regions)<\/strong> in the API path (for example <code>projects\/{project}\/locations\/{location}\/...<\/code>). In practice:\n&#8211; You choose a <strong>location<\/strong> supported by the service.\n&#8211; You create configs and sessions in that location.\n&#8211; Playback URLs returned by the API may be tied to that location and your distribution setup.<\/p>\n\n\n\n<p>Always validate available locations and quotas for your project:\n&#8211; REST reference (locations): https:\/\/cloud.google.com\/video-stitcher\/docs\/reference\/rest<br\/>\n&#8211; Service availability by region can change; verify in official docs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How it fits into the Google Cloud ecosystem<\/h3>\n\n\n\n<p>Video Stitcher API typically sits in a broader media delivery stack:\n&#8211; <strong>Content origin<\/strong>: Cloud Storage, third-party origin, or a media origin server.\n&#8211; <strong>Transcoding\/packaging<\/strong> (often separate): Transcoder API or external packagers create HLS\/DASH renditions.\n&#8211; <strong>Distribution<\/strong>: Media CDN or Cloud CDN in front of your origin for performance and egress cost control.\n&#8211; <strong>Analytics\/ML<\/strong> (adjacent): BigQuery, Looker, Vertex AI can be used to optimize ad strategy, forecast revenue, or personalize experiences\u2014Video Stitcher API provides the SSAI layer, not the ML itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Why use Video Stitcher API?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Business reasons<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Better monetization reliability<\/strong>: SSAI reduces client-side ad failures and makes ad blocking harder than purely client-side ad SDK approaches.<\/li>\n<li><strong>Consistent ad experience across devices<\/strong>: Ad insertion happens server-side, which reduces player fragmentation across mobile\/TV\/web.<\/li>\n<li><strong>Faster time-to-market<\/strong>: A managed service reduces the engineering burden of building and scaling SSAI infrastructure.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Technical reasons<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Centralized ad insertion logic<\/strong>: You manage configurations server-side instead of shipping many variants in player apps.<\/li>\n<li><strong>Scalable session creation<\/strong>: The service is designed for high-scale streaming patterns (verify your required concurrency\/quota).<\/li>\n<li><strong>Cloud-native integration<\/strong>: Works naturally with IAM, Cloud Logging, and typical Google Cloud deployment models.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Operational reasons<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Managed control plane<\/strong>: Google handles much of the reliability\/scaling of the stitching control plane.<\/li>\n<li><strong>Observability alignment<\/strong>: You can integrate logs\/metrics into Cloud Monitoring and SRE workflows (verify exact metric\/log availability).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Security\/compliance reasons<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>IAM-based access control<\/strong>: Fine-grained access to configs and session creation.<\/li>\n<li><strong>Playback security patterns<\/strong>: Can be integrated with signed URLs and CDN authorization patterns (depending on your CDN and keys).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Scalability\/performance reasons<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Edge-friendly distribution<\/strong>: You can pair Video Stitcher API with Media CDN\/Cloud CDN to reduce latency and origin load.<\/li>\n<li><strong>Reduced client complexity<\/strong>: Less code running on devices can reduce playback failures and improve performance consistency.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">When teams should choose it<\/h3>\n\n\n\n<p>Choose Video Stitcher API when you:\n&#8211; Need SSAI for <strong>OTT\/CTV<\/strong>, broadcaster streaming, or large-scale VOD\/live streaming monetization.\n&#8211; Want a managed approach instead of building a stitching service from scratch.\n&#8211; Need to standardize ad insertion across multiple apps\/platforms.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">When teams should not choose it<\/h3>\n\n\n\n<p>Consider alternatives when:\n&#8211; You only need <strong>basic video encoding<\/strong> (use Transcoder API) or <strong>live encoding<\/strong> (use Live Stream API).\n&#8211; Your monetization strategy requires deep, player-specific ad SDK features (interactive ads, certain measurement SDKs) that are not compatible with SSAI-only approaches.\n&#8211; Your compliance or content constraints require a self-hosted stitching system with full control of every hop (though this increases operational burden).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Where is Video Stitcher API used?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Industries<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Streaming media and OTT platforms<\/li>\n<li>Broadcasting and digital TV<\/li>\n<li>Sports streaming<\/li>\n<li>News and live events<\/li>\n<li>Education media platforms (ad-supported tiers)<\/li>\n<li>Fitness and lifestyle streaming (freemium + ads)<\/li>\n<li>Retail media and shoppable video (often combined with external systems)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Team types<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Video platform engineering teams<\/li>\n<li>DevOps\/SRE teams supporting streaming platforms<\/li>\n<li>AdOps and monetization engineering<\/li>\n<li>Media supply chain architects<\/li>\n<li>Security and compliance teams (reviewing playback authorization and data handling)<\/li>\n<li>Data\/ML teams (adjacent) optimizing ad yield and user engagement<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Workloads and architectures<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>VOD libraries with mid-roll insertion<\/li>\n<li>Live channels with ad breaks<\/li>\n<li>FAST (Free Ad-Supported Streaming TV) channels<\/li>\n<li>Hybrid architectures with multi-CDN delivery<\/li>\n<li>Multi-region designs for global audiences<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Real-world deployment contexts<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Production<\/strong>: High-volume playback with strict latency and error budgets; integrated with CDN and monitoring; uses least-privilege IAM and controlled ad tags.<\/li>\n<li><strong>Dev\/Test<\/strong>: Small-scale tests with sample streams and test ad tags; focus on validating manifest output and player behavior; more verbose logging.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. Top Use Cases and Scenarios<\/h2>\n\n\n\n<p>Below are realistic ways teams deploy Video Stitcher API. Each use case includes the problem, why the service fits, and a concrete scenario.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\n<p><strong>SSAI for VOD mid-roll ads<\/strong>\n   &#8211; <strong>Problem<\/strong>: Client-side ads fail across devices; ad blockers reduce fill.\n   &#8211; <strong>Why Video Stitcher API fits<\/strong>: Server-side stitching reduces client variability and ad blocking.\n   &#8211; <strong>Scenario<\/strong>: A video library inserts mid-roll ads every 10 minutes for free-tier viewers.<\/p>\n<\/li>\n<li>\n<p><strong>SSAI for live linear channels (FAST)<\/strong>\n   &#8211; <strong>Problem<\/strong>: Live ad breaks must be inserted consistently with minimal player-side logic.\n   &#8211; <strong>Why it fits<\/strong>: Live session stitching supports consistent break insertion patterns (verify live workflow requirements).\n   &#8211; <strong>Scenario<\/strong>: A FAST channel replaces broadcast ad breaks with targeted digital ads.<\/p>\n<\/li>\n<li>\n<p><strong>Device-agnostic ad experience (CTV focus)<\/strong>\n   &#8211; <strong>Problem<\/strong>: Maintaining ad SDKs across Roku\/Fire TV\/Smart TVs is costly.\n   &#8211; <strong>Why it fits<\/strong>: SSAI reduces player dependencies and simplifies certification cycles.\n   &#8211; <strong>Scenario<\/strong>: A CTV app uses a single HLS playback path and centralizes ad logic server-side.<\/p>\n<\/li>\n<li>\n<p><strong>Regional ad targeting and compliance<\/strong>\n   &#8211; <strong>Problem<\/strong>: Ads must vary by country\/region and comply with policies.\n   &#8211; <strong>Why it fits<\/strong>: Session creation can attach region\/device parameters to ad decisioning (implementation depends on your ad server\/ad tags\u2014verify).\n   &#8211; <strong>Scenario<\/strong>: EU viewers receive GDPR-compliant ads; US viewers get different campaigns.<\/p>\n<\/li>\n<li>\n<p><strong>Ad failover with slate insertion<\/strong>\n   &#8211; <strong>Problem<\/strong>: Empty ad breaks create poor UX and measurement gaps.\n   &#8211; <strong>Why it fits<\/strong>: Slate\/fallback assets can fill when ads can\u2019t be served (verify slate behavior).\n   &#8211; <strong>Scenario<\/strong>: When the ad server times out, a short \u201cWe\u2019ll be right back\u201d slate plays.<\/p>\n<\/li>\n<li>\n<p><strong>Scaling for event spikes<\/strong>\n   &#8211; <strong>Problem<\/strong>: High concurrency during sports finals overwhelms self-managed stitching.\n   &#8211; <strong>Why it fits<\/strong>: Managed control plane + CDN pairing reduces operational risk.\n   &#8211; <strong>Scenario<\/strong>: A sports platform prepares for 10\u00d7 peak traffic with pre-tested quotas and CDN.<\/p>\n<\/li>\n<li>\n<p><strong>Centralized policy enforcement for ad insertion<\/strong>\n   &#8211; <strong>Problem<\/strong>: Business rules for ad frequency and categories drift across apps.\n   &#8211; <strong>Why it fits<\/strong>: Config-driven stitching keeps policies centralized (where supported).\n   &#8211; <strong>Scenario<\/strong>: A single VOD config enforces consistent ad tag usage for all web\/mobile clients.<\/p>\n<\/li>\n<li>\n<p><strong>Multi-tenant streaming platform<\/strong>\n   &#8211; <strong>Problem<\/strong>: A platform hosts many channels\/brands, each with different ad settings.\n   &#8211; <strong>Why it fits<\/strong>: Separate configs per tenant; IAM controls who can manage which configs (design carefully).\n   &#8211; <strong>Scenario<\/strong>: A SaaS video provider creates per-tenant configs and sessions.<\/p>\n<\/li>\n<li>\n<p><strong>Experimentation (A\/B testing ad strategies)<\/strong>\n   &#8211; <strong>Problem<\/strong>: Need to test ad frequency and revenue impact safely.\n   &#8211; <strong>Why it fits<\/strong>: Create different configs and route a percentage of sessions to each.\n   &#8211; <strong>Scenario<\/strong>: 20% of viewers use a config with fewer ad pods; compare retention and revenue.<\/p>\n<\/li>\n<li>\n<p><strong>ML-assisted ad decisioning (adjacent AI and ML use)<\/strong>\n   &#8211; <strong>Problem<\/strong>: Maximize yield while reducing churn from excessive ads.\n   &#8211; <strong>Why it fits<\/strong>: Video Stitcher API executes SSAI; Vertex AI\/BigQuery can drive decision inputs upstream.\n   &#8211; <strong>Scenario<\/strong>: An ML model predicts churn risk and selects ad pod length via parameters passed to the ad server (implementation varies\u2014verify ad server capabilities).<\/p>\n<\/li>\n<li>\n<p><strong>Ad insertion for catch-up TV<\/strong>\n   &#8211; <strong>Problem<\/strong>: Same content must monetize differently over time and geography.\n   &#8211; <strong>Why it fits<\/strong>: Session-based stitching supports dynamic ad decisions per playback.\n   &#8211; <strong>Scenario<\/strong>: Yesterday\u2019s news replay includes fresh ads relevant today.<\/p>\n<\/li>\n<li>\n<p><strong>Controlled playback gateway<\/strong>\n   &#8211; <strong>Problem<\/strong>: Need to restrict who can create sessions and track usage.\n   &#8211; <strong>Why it fits<\/strong>: Backend service creates sessions via IAM; clients only receive playback URIs.\n   &#8211; <strong>Scenario<\/strong>: A \u201cplayback API\u201d microservice authenticates users, then creates a stitching session.<\/p>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">6. Core Features<\/h2>\n\n\n\n<p>This section focuses on commonly documented capabilities of Video Stitcher API. Confirm exact behavior and supported formats in the official documentation and REST reference: https:\/\/cloud.google.com\/video-stitcher\/docs\/reference\/rest<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6.1 Server-side ad insertion (SSAI) session creation<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it does<\/strong>: Creates per-viewer playback sessions that generate ad-stitched manifests.<\/li>\n<li><strong>Why it matters<\/strong>: SSAI improves consistency and reduces client-side dependencies.<\/li>\n<li><strong>Practical benefit<\/strong>: Player requests a single manifest URL; ads appear as part of the stream timeline.<\/li>\n<li><strong>Caveats<\/strong>: You must design for cacheability, session lifetimes, and privacy; sessions can reduce CDN cache hit ratio if every viewer gets a fully unique manifest.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6.2 VOD stitching configurations<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it does<\/strong>: Defines how VOD content is stitched with ads (content source + ad decisioning inputs).<\/li>\n<li><strong>Why it matters<\/strong>: Reusable configuration reduces operational errors.<\/li>\n<li><strong>Practical benefit<\/strong>: Centralized control over how VOD playback is monetized.<\/li>\n<li><strong>Caveats<\/strong>: Your VOD source must be accessible to the service; format requirements apply (verify HLS\/DASH specifics).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6.3 Live stitching configurations (where supported)<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it does<\/strong>: Defines live content sources and ad insertion behavior for live sessions.<\/li>\n<li><strong>Why it matters<\/strong>: Live SSAI is operationally sensitive; config-driven behavior helps stability.<\/li>\n<li><strong>Practical benefit<\/strong>: Standardized handling of live ad breaks.<\/li>\n<li><strong>Caveats<\/strong>: Live SSAI often involves additional timing\/marker requirements. Validate that your live pipeline emits the required markers or manifests.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6.4 Slate (fallback) handling (where supported)<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it does<\/strong>: Provides fallback video content when ads cannot be served or during specific insertion windows.<\/li>\n<li><strong>Why it matters<\/strong>: Avoids dead air\/black frames; keeps playback continuous.<\/li>\n<li><strong>Practical benefit<\/strong>: Better UX and more predictable playback.<\/li>\n<li><strong>Caveats<\/strong>: Slate assets must meet packaging\/codec requirements. Confirm supported formats and how slate is referenced in configs.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6.5 Integration with CDN authorization (CDN keys \/ signed requests)<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it does<\/strong>: Supports secure delivery patterns when pairing with a CDN (for example, signed URL\/token mechanisms).<\/li>\n<li><strong>Why it matters<\/strong>: Monetized playback URLs should not be easily shareable or replayable without authorization.<\/li>\n<li><strong>Practical benefit<\/strong>: Reduced content leakage; better control over who can play.<\/li>\n<li><strong>Caveats<\/strong>: Implementation depends on your CDN (Media CDN, Cloud CDN, or third-party). Confirm supported signing schemes and operational rotation of keys.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6.6 API-first automation (IaC-friendly workflows)<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it does<\/strong>: Everything is an API resource (configs, sessions, slates, keys), which can be automated.<\/li>\n<li><strong>Why it matters<\/strong>: Enables CI\/CD, environment promotion, and repeatable deployments.<\/li>\n<li><strong>Practical benefit<\/strong>: Treat stitching configuration as code.<\/li>\n<li><strong>Caveats<\/strong>: Be careful with secrets (ad server tokens, signing keys). Prefer Secret Manager and short-lived credentials.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6.7 Observability hooks via Google Cloud operations tools<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>What it does<\/strong>: Integrates with Cloud Logging\/Monitoring at the platform level (exact logs\/metrics vary).<\/li>\n<li><strong>Why it matters<\/strong>: SSAI failures directly impact revenue; you need fast detection and diagnosis.<\/li>\n<li><strong>Practical benefit<\/strong>: Alerting on error rates and latency; troubleshooting failed ad decisions.<\/li>\n<li><strong>Caveats<\/strong>: Confirm which logs\/metrics are emitted and what fields are included to avoid relying on assumptions.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">7. Architecture and How It Works<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">High-level architecture<\/h3>\n\n\n\n<p>Video Stitcher API typically works like this:\n1. A client (player app or your backend) requests playback.\n2. Your backend (recommended) creates a Video Stitcher <strong>session<\/strong> from a predefined <strong>config<\/strong>.\n3. Video Stitcher fetches\/uses the content manifest and requests ads from an ad server (directly or via ad tags).\n4. The service returns a <strong>session-specific playback URI<\/strong>.\n5. The player loads that URI and streams content+ads, usually via your CDN\/origin setup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Request\/data\/control flow<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Control plane<\/strong>: API calls to create\/read configs and sessions (authenticated by IAM).<\/li>\n<li><strong>Data plane<\/strong>: Playback manifests and segment delivery via HTTP(S) paths (typically delivered by a CDN\/origin; exact topology depends on your setup).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Integrations with related Google Cloud services<\/h3>\n\n\n\n<p>Common integrations include:\n&#8211; <strong>Cloud Storage<\/strong> for storing VOD assets, slates, and manifests in an origin-like bucket (depending on workflow).\n&#8211; <strong>Transcoder API<\/strong> to generate HLS\/DASH renditions from mezzanine files.\n&#8211; <strong>Media CDN \/ Cloud CDN<\/strong> for distribution, caching, and egress optimization.\n&#8211; <strong>Cloud Logging \/ Cloud Monitoring<\/strong> for visibility and alerting.\n&#8211; <strong>Secret Manager<\/strong> for storing ad server credentials, signing keys, or integration secrets.\n&#8211; <strong>BigQuery<\/strong> for ad and playback analytics (often through your own event pipelines).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Dependency services (typical)<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>packager\/origin<\/strong> that serves HLS\/DASH content.<\/li>\n<li>An <strong>ad decision server<\/strong> (for example, Google Ad Manager or a third-party ad server).<\/li>\n<li>A <strong>CDN<\/strong> for scalable delivery to viewers.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Security\/authentication model<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>API calls use <strong>Google Cloud IAM<\/strong> (OAuth 2.0 access tokens, service accounts).<\/li>\n<li>Playback URL authorization is typically separate (CDN signed URLs\/tokens, app-level gating, etc.), depending on how you distribute the stream.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Networking model<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Video Stitcher API is accessed over the public Google API endpoint.<\/li>\n<li>Content origins and ad servers must be reachable according to your design (public internet endpoints are common; private origins require careful design\u2014verify supported private connectivity patterns).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Monitoring\/logging\/governance considerations<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Track:<\/li>\n<li>Session creation success\/failure rates<\/li>\n<li>Ad decision latency\/timeouts<\/li>\n<li>Playback manifest errors<\/li>\n<li>CDN cache hit ratio impacts from session uniqueness<\/li>\n<li>Governance:<\/li>\n<li>Separate projects for dev\/stage\/prod<\/li>\n<li>Restrict who can update configs<\/li>\n<li>Use labels\/tags and naming conventions to keep many configs manageable<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Simple architecture diagram<\/h3>\n\n\n\n<pre><code class=\"language-mermaid\">flowchart LR\n  U[Viewer Player] --&gt;|1. Request playback| APP[Playback Backend]\n  APP --&gt;|2. Create session (IAM)| VS[Video Stitcher API]\n  VS --&gt;|3. Fetch content manifest| ORIGIN[Origin: HLS\/DASH]\n  VS --&gt;|4. Request ads| ADS[Ad Server \/ Ad Tag Endpoint]\n  VS --&gt;|5. Return playback URI| APP\n  APP --&gt;|6. Provide playback URI| U\n  U --&gt;|7. Stream via playback URI| CDN[CDN \/ Edge Cache]\n  CDN --&gt; ORIGIN\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Production-style architecture diagram<\/h3>\n\n\n\n<pre><code class=\"language-mermaid\">flowchart TB\n  subgraph Clients\n    CTV[CTV Apps]\n    WEB[Web Player]\n    MOB[Mobile Apps]\n  end\n\n  subgraph GoogleCloud[Google Cloud Project - Prod]\n    APIGW[API Gateway \/ Cloud Load Balancer\\n(Playback API)]\n    RUN[Cloud Run \/ GKE\\nSession Service]\n    VS[Video Stitcher API]\n    LOG[Cloud Logging]\n    MON[Cloud Monitoring]\n    SM[Secret Manager]\n    BQ[BigQuery\\n(analytics)]\n    ORIG[Origin Storage\/Servers\\nCloud Storage + Origin Service]\n    CDN[Media CDN \/ Cloud CDN]\n  end\n\n  subgraph External\n    ADS[Ad Server (e.g., GAM)\\nDecisioning &amp; Tracking]\n    DRM[DRM\/License Server\\n(if used)]\n  end\n\n  CTV --&gt; APIGW\n  WEB --&gt; APIGW\n  MOB --&gt; APIGW\n\n  APIGW --&gt; RUN\n  RUN --&gt;|OAuth\/IAM| VS\n  RUN --&gt; SM\n\n  VS --&gt; ORIG\n  VS --&gt; ADS\n\n  VS --&gt; LOG\n  RUN --&gt; LOG\n  LOG --&gt; MON\n  RUN --&gt; BQ\n\n  CTV --&gt;|Playback URL| CDN\n  WEB --&gt;|Playback URL| CDN\n  MOB --&gt;|Playback URL| CDN\n  CDN --&gt; ORIG\n\n  WEB -. license .-&gt; DRM\n  MOB -. license .-&gt; DRM\n  CTV -. license .-&gt; DRM\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">8. Prerequisites<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Google Cloud requirements<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>Google Cloud project<\/strong> with <strong>billing enabled<\/strong>.<\/li>\n<li>The <strong>Video Stitcher API enabled<\/strong> in your project.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Permissions \/ IAM roles<\/h3>\n\n\n\n<p>You need IAM permissions to:\n&#8211; Enable services\n&#8211; Create and manage Video Stitcher resources (configs, sessions, and any optional resources like slates\/CDN keys)<\/p>\n\n\n\n<p>Common patterns (role names may change; verify in IAM docs for Video Stitcher):\n&#8211; Admin\/operator: <code>roles\/videostitcher.admin<\/code> (or equivalent)\n&#8211; Limited session creator: <code>roles\/videostitcher.user<\/code> (or equivalent)<\/p>\n\n\n\n<p>Verify official IAM roles and permissions here:\n&#8211; Video Stitcher docs: https:\/\/cloud.google.com\/video-stitcher\/docs\n&#8211; IAM roles reference (search within Google Cloud docs for \u201cVideo Stitcher roles\u201d)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Tools<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cloud Shell<\/strong> (recommended) or local terminal with:<\/li>\n<li><code>gcloud<\/code> CLI<\/li>\n<li><code>curl<\/code><\/li>\n<li><code>jq<\/code> (for JSON parsing)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Region availability<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Video Stitcher API uses <code>locations<\/code>. You must select a supported location.<\/li>\n<li>Verify available locations in your project via the API (shown in the lab), and confirm any data residency requirements.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Quotas and limits<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Expect quotas around:<\/li>\n<li>Requests per minute<\/li>\n<li>Concurrent sessions<\/li>\n<li>Resource counts per location (configs, slates, keys)<\/li>\n<li>Quotas vary; check the <strong>Quotas<\/strong> page in Google Cloud Console for Video Stitcher API and verify in docs.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisite services (common in real systems)<\/h3>\n\n\n\n<p>Not strictly required for the lab, but typical for production:\n&#8211; Cloud Storage (origin assets, slate assets)\n&#8211; Media CDN \/ Cloud CDN\n&#8211; Secret Manager\n&#8211; Cloud Logging \/ Monitoring\n&#8211; (Optional) Transcoder API to generate HLS\/DASH<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">9. Pricing \/ Cost<\/h2>\n\n\n\n<p>Video Stitcher API pricing is <strong>usage-based<\/strong>. Exact SKUs, units, and rates can vary by region and may change over time, so do not rely on third-party summaries.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Official pricing page (start here): https:\/\/cloud.google.com\/video-stitcher\/pricing  <\/li>\n<li>Google Cloud Pricing Calculator: https:\/\/cloud.google.com\/products\/calculator<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Pricing dimensions (typical for SSAI services)<\/h3>\n\n\n\n<p>Verify the exact billable units on the pricing page, but common pricing dimensions in SSAI include:\n&#8211; <strong>Stitched streaming time<\/strong> (for example, minutes of video processed\/stiched)\n&#8211; <strong>Session counts<\/strong> or <strong>manifest requests<\/strong>\n&#8211; <strong>Ad insertion events<\/strong> (sometimes a factor in some products)\n&#8211; <strong>Data transfer\/egress<\/strong> (usually billed separately via CDN\/egress SKUs)\n&#8211; <strong>CDN usage<\/strong> if you front content with Media CDN\/Cloud CDN<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Free tier<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If a free tier exists (or limited free usage), it will be described on the official pricing page. Many media services have either no free tier or limited promotional tiers\u2014<strong>verify in official docs<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Cost drivers (direct and indirect)<\/h3>\n\n\n\n<p><strong>Direct Video Stitcher API drivers<\/strong> (verify exact billing metric):\n&#8211; Number of sessions created\n&#8211; Playback minutes stitched\n&#8211; Volume of manifest generation activity<\/p>\n\n\n\n<p><strong>Indirect but significant costs<\/strong>:\n&#8211; <strong>CDN egress<\/strong>: Often the largest cost in streaming.\n&#8211; <strong>Origin egress\/load<\/strong>: If CDN cache hit ratio is poor, origin costs rise.\n&#8211; <strong>Storage<\/strong>: VOD assets and multiple renditions can be large.\n&#8211; <strong>Logging\/monitoring<\/strong>: High-volume logs for per-session debugging can become expensive.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Network and data transfer implications<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Session-based manifests can be more unique per viewer, which can reduce manifest caching at the CDN edge.<\/li>\n<li>Segment caching can still be effective if content segments are shared across viewers; ads can reduce cacheability depending on how ad segments are delivered and how varied they are.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How to optimize cost<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Put <strong>Media CDN\/Cloud CDN<\/strong> in front of your origins for caching and egress optimization.<\/li>\n<li>Limit session uniqueness when possible (while respecting targeting needs).<\/li>\n<li>Use slates\/fallbacks to reduce repeated timeouts and retries.<\/li>\n<li>Control log verbosity; sample logs in production and use metrics\/alerts for high-level signals.<\/li>\n<li>Consider multi-CDN only if required; it adds operational and cost complexity.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Example low-cost starter estimate (no fabricated numbers)<\/h3>\n\n\n\n<p>A low-cost lab\/testing footprint typically includes:\n&#8211; A handful of sessions created per day\n&#8211; Short VOD test clips\n&#8211; Minimal logging retention\n&#8211; No large-scale egress (testing from a small team)<\/p>\n\n\n\n<p>Use the Pricing Calculator and the Video Stitcher pricing page to estimate:\n&#8211; Expected stitched minutes\/day\n&#8211; Session count\/day\n&#8211; CDN egress (GB\/month)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example production cost considerations<\/h3>\n\n\n\n<p>For production, build a model around:\n&#8211; Average concurrent viewers (and peak events)\n&#8211; Average watch time per session\n&#8211; Ad load (how many ads per hour)\n&#8211; CDN egress by geography\n&#8211; Cache hit ratios for manifests vs segments\n&#8211; Logging volume (errors vs debug)<\/p>\n\n\n\n<p>A practical approach is to run a <strong>two-week pilot<\/strong> with representative traffic, then extrapolate with peak multipliers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">10. Step-by-Step Hands-On Tutorial<\/h2>\n\n\n\n<p>This lab shows how to enable Video Stitcher API, discover the API schema from Google\u2019s Discovery document (to avoid guessing request fields), create a basic VOD stitching configuration, create a VOD session, and fetch the resulting playback manifest.<\/p>\n\n\n\n<p>Because ad-tech environments differ (ad tags, measurement, geo rules, fill rates), the \u201csuccessful ad insertion\u201d outcome depends on having a working ad tag and a reachable source manifest. The lab is still valuable even if ads don\u2019t fill\u2014you\u2019ll validate API access, config\/session creation, and manifest retrieval.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Objective<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enable <strong>Video Stitcher API<\/strong> in a Google Cloud project.<\/li>\n<li>Identify a supported <strong>location<\/strong>.<\/li>\n<li>Create a <strong>VOD config<\/strong>.<\/li>\n<li>Create a <strong>VOD session<\/strong> and retrieve the <strong>playback manifest URL<\/strong>.<\/li>\n<li>Download the stitched manifest and inspect it.<\/li>\n<li>Clean up created resources.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Lab Overview<\/h3>\n\n\n\n<p>You will use:\n&#8211; Cloud Shell\n&#8211; <code>gcloud<\/code> for auth and project setup\n&#8211; <code>curl<\/code> + <code>jq<\/code> for REST calls<\/p>\n\n\n\n<p>You will need:\n&#8211; A publicly reachable <strong>HLS or DASH source manifest URL<\/strong> for testing.\n&#8211; A test <strong>ad tag URL<\/strong> from your ad system (or a known test tag). If you don\u2019t have one, you can still create the config and session, but ad insertion may fail or return slate\/empty ad behavior depending on settings.<\/p>\n\n\n\n<blockquote>\n<p>Important: Do not use production ad tags or keys in a shared environment. Treat ad URLs and any signing keys as sensitive.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Set project, enable API, and prepare tools<\/h3>\n\n\n\n<p>1) Open <strong>Cloud Shell<\/strong> in the Google Cloud Console.<\/p>\n\n\n\n<p>2) Set environment variables:<\/p>\n\n\n\n<pre><code class=\"language-bash\">export PROJECT_ID=\"$(gcloud config get-value project)\"\nexport LOCATION=\"us-central1\"   # change later if needed\n<\/code><\/pre>\n\n\n\n<p>3) Enable the API:<\/p>\n\n\n\n<pre><code class=\"language-bash\">gcloud services enable videostitcher.googleapis.com\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; The API enables successfully without errors.<\/p>\n\n\n\n<p>4) Verify you can obtain an access token:<\/p>\n\n\n\n<pre><code class=\"language-bash\">gcloud auth print-access-token &gt;\/dev\/null &amp;&amp; echo \"Token OK\"\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; You see <code>Token OK<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Confirm the REST surface (avoid guessing) using the Discovery document<\/h3>\n\n\n\n<p>Google APIs commonly publish a Discovery document. If available, it lets you inspect schema and method names used by the REST API.<\/p>\n\n\n\n<p>1) Fetch the Discovery document:<\/p>\n\n\n\n<pre><code class=\"language-bash\">curl -s \"https:\/\/videostitcher.googleapis.com\/\\$discovery\/rest?version=v1\" &gt; videostitcher_v1_discovery.json\n<\/code><\/pre>\n\n\n\n<p>2) Confirm it downloaded and contains schemas:<\/p>\n\n\n\n<pre><code class=\"language-bash\">jq '.name, .version, (.schemas | keys | length)' videostitcher_v1_discovery.json\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; Output includes the API name\/version and a non-zero schema count.<\/p>\n\n\n\n<p>3) Inspect key schemas to find the exact JSON field names for VOD config and VOD session:<\/p>\n\n\n\n<pre><code class=\"language-bash\">jq '.schemas | keys[]' videostitcher_v1_discovery.json | grep -i \"vod\" | head\n<\/code><\/pre>\n\n\n\n<p>Then inspect the schema details (names may differ; adjust to what you see):<\/p>\n\n\n\n<pre><code class=\"language-bash\">jq '.schemas.VodConfig.properties | keys' videostitcher_v1_discovery.json\njq '.schemas.VodSession.properties | keys' videostitcher_v1_discovery.json\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; You can see the property names (for example, you may see <code>sourceUri<\/code>, <code>adTagUri<\/code>, <code>vodConfig<\/code>, etc.). Use these exact names in later steps.<\/p>\n\n\n\n<blockquote>\n<p>If the Discovery document endpoint is unavailable or blocked, use the REST reference instead: https:\/\/cloud.google.com\/video-stitcher\/docs\/reference\/rest<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: List supported locations for your project<\/h3>\n\n\n\n<p>1) Call the locations endpoint:<\/p>\n\n\n\n<pre><code class=\"language-bash\">ACCESS_TOKEN=\"$(gcloud auth print-access-token)\"\n\ncurl -s -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  \"https:\/\/videostitcher.googleapis.com\/v1\/projects\/${PROJECT_ID}\/locations\" | jq\n<\/code><\/pre>\n\n\n\n<p>2) If the response includes locations, pick one and set <code>LOCATION<\/code> accordingly:<\/p>\n\n\n\n<pre><code class=\"language-bash\">export LOCATION=\"YOUR_SUPPORTED_LOCATION\"\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; You see a list of location resources (names like <code>projects\/PROJECT\/locations\/REGION<\/code>).<\/p>\n\n\n\n<p><strong>If you get PERMISSION_DENIED<\/strong>\n&#8211; Ensure your user has permission to call the API and that billing is enabled.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Choose a test source manifest and ad tag<\/h3>\n\n\n\n<p>You need:\n&#8211; A <strong>source manifest<\/strong> URL (HLS <code>.m3u8<\/code> or DASH <code>.mpd<\/code>) reachable from the public internet.\n&#8211; An <strong>ad tag<\/strong> URL that returns ads (VAST\/VMAP or your ad server\u2019s expected format), depending on what Video Stitcher supports in your chosen mode.<\/p>\n\n\n\n<p>Set these variables:<\/p>\n\n\n\n<pre><code class=\"language-bash\"># Example source: use your own stable HLS\/DASH manifest in production.\n# For lab use, choose a public test manifest you control or trust.\nexport SOURCE_MANIFEST_URL=\"https:\/\/storage.googleapis.com\/shaka-demo-assets\/angel-one-hls\/hls.m3u8\"\n\n# Ad tag: replace with your own test tag from your ad system.\n# If you don't have one, you can still proceed, but ads may not fill.\nexport AD_TAG_URL=\"REPLACE_WITH_YOUR_TEST_AD_TAG\"\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; Variables set; no API calls yet.<\/p>\n\n\n\n<blockquote>\n<p>If you need a test ad tag, use one provided by your ad platform\u2019s official documentation. Public test tags can change or be rate-limited. Always verify with your AdOps team.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Create a VOD config (stitching configuration)<\/h3>\n\n\n\n<p>In this step you create a VOD configuration resource in your chosen location.<\/p>\n\n\n\n<p>1) Choose an ID for the config:<\/p>\n\n\n\n<pre><code class=\"language-bash\">export VOD_CONFIG_ID=\"vod-config-lab-1\"\n<\/code><\/pre>\n\n\n\n<p>2) Build the request body using the schema you inspected in Step 2.<\/p>\n\n\n\n<p><strong>Important:<\/strong> The exact field names must match the API schema (from Discovery or REST reference). The example below uses commonly seen field names; if your schema differs, adjust accordingly.<\/p>\n\n\n\n<p>Create <code>vod_config.json<\/code>:<\/p>\n\n\n\n<pre><code class=\"language-bash\">cat &gt; vod_config.json &lt;&lt;EOF\n{\n  \"sourceUri\": \"${SOURCE_MANIFEST_URL}\",\n  \"adTagUri\": \"${AD_TAG_URL}\"\n}\nEOF\n<\/code><\/pre>\n\n\n\n<p>3) Call the create endpoint:<\/p>\n\n\n\n<pre><code class=\"language-bash\">curl -s -X POST \\\n  -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  -H \"Content-Type: application\/json\" \\\n  \"https:\/\/videostitcher.googleapis.com\/v1\/projects\/${PROJECT_ID}\/locations\/${LOCATION}\/vodConfigs?vodConfigId=${VOD_CONFIG_ID}\" \\\n  --data-binary @vod_config.json | jq\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; A JSON response describing the created VOD config, including a <code>name<\/code> field like:\n  &#8211; <code>projects\/PROJECT\/locations\/LOCATION\/vodConfigs\/vod-config-lab-1<\/code><\/p>\n\n\n\n<p>Capture the config name:<\/p>\n\n\n\n<pre><code class=\"language-bash\">export VOD_CONFIG_NAME=\"projects\/${PROJECT_ID}\/locations\/${LOCATION}\/vodConfigs\/${VOD_CONFIG_ID}\"\necho \"${VOD_CONFIG_NAME}\"\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Create a VOD session and obtain a playback URI<\/h3>\n\n\n\n<p>Now you create a session from the config. The API should return a playback URL (field name varies by API version\u2014inspect the response).<\/p>\n\n\n\n<p>1) Choose a session ID:<\/p>\n\n\n\n<pre><code class=\"language-bash\">export VOD_SESSION_ID=\"vod-session-lab-1\"\n<\/code><\/pre>\n\n\n\n<p>2) Create a <code>vod_session.json<\/code> request body. Again, confirm property names from Discovery doc. A common pattern is referencing the config by name:<\/p>\n\n\n\n<pre><code class=\"language-bash\">cat &gt; vod_session.json &lt;&lt;EOF\n{\n  \"vodConfig\": \"${VOD_CONFIG_NAME}\"\n}\nEOF\n<\/code><\/pre>\n\n\n\n<p>3) Create the session:<\/p>\n\n\n\n<pre><code class=\"language-bash\">curl -s -X POST \\\n  -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  -H \"Content-Type: application\/json\" \\\n  \"https:\/\/videostitcher.googleapis.com\/v1\/projects\/${PROJECT_ID}\/locations\/${LOCATION}\/vodSessions?vodSessionId=${VOD_SESSION_ID}\" \\\n  --data-binary @vod_session.json | tee vod_session_response.json | jq\n<\/code><\/pre>\n\n\n\n<p>4) Extract the playback URI from the response (field names differ; try a few common ones and inspect):<\/p>\n\n\n\n<pre><code class=\"language-bash\">jq -r '.playUri \/\/ .playbackUri \/\/ .manifestUri \/\/ .responseUri \/\/ empty' vod_session_response.json\n<\/code><\/pre>\n\n\n\n<p>If this prints nothing, inspect the response keys:<\/p>\n\n\n\n<pre><code class=\"language-bash\">jq 'keys' vod_session_response.json\n<\/code><\/pre>\n\n\n\n<p>Then set:<\/p>\n\n\n\n<pre><code class=\"language-bash\">export PLAYBACK_URI=\"$(jq -r '.playUri \/\/ .playbackUri \/\/ .manifestUri \/\/ empty' vod_session_response.json)\"\necho \"Playback URI: ${PLAYBACK_URI}\"\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; You obtain a non-empty playback URI.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Fetch and inspect the stitched manifest<\/h3>\n\n\n\n<p>1) Download the manifest:<\/p>\n\n\n\n<pre><code class=\"language-bash\">curl -s \"${PLAYBACK_URI}\" | head -n 50\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; You see an HLS or DASH manifest header rather than an error page.<\/p>\n\n\n\n<p>2) Save it for inspection:<\/p>\n\n\n\n<pre><code class=\"language-bash\">curl -s \"${PLAYBACK_URI}\" -o stitched_manifest.txt\nwc -l stitched_manifest.txt\n<\/code><\/pre>\n\n\n\n<p>3) Look for signs of ad insertion:\n&#8211; In HLS, you might see <code>#EXT-X-DISCONTINUITY<\/code> tags or ad segment URIs.\n&#8211; In DASH, you might see additional periods\/representations.<\/p>\n\n\n\n<p>Search for common indicators (not guaranteed):<\/p>\n\n\n\n<pre><code class=\"language-bash\">grep -nE \"DISCONTINUITY|EXT-X-CUE|ad|vast|gampad|doubleclick\" stitched_manifest.txt | head\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; If the ad tag returns ads and the workflow is supported, you should see some evidence of ad-related stitching.\n&#8211; If not, you may still get a valid manifest that resembles the source (ads not filled) or you may see errors depending on how the service reports failures.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h3 class=\"wp-block-heading\">Validation<\/h3>\n\n\n\n<p>Use this checklist:\n&#8211; [ ] API enabled and locations list succeeds.\n&#8211; [ ] VOD config created successfully and has a resource name.\n&#8211; [ ] VOD session created successfully.\n&#8211; [ ] Playback URI downloads a manifest file.\n&#8211; [ ] Player test (optional): paste the playback URI into a test player that supports the format (for example, an internal HLS\/DASH test player your team uses). If you use public tools, avoid sharing URLs that could grant access to content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<p>Common issues and practical fixes:<\/p>\n\n\n\n<p>1) <strong><code>PERMISSION_DENIED<\/code><\/strong>\n&#8211; Ensure your user\/service account has Video Stitcher permissions.\n&#8211; Confirm billing is enabled.\n&#8211; Confirm you\u2019re using the correct project.<\/p>\n\n\n\n<p>2) <strong><code>INVALID_ARGUMENT<\/code> when creating config\/session<\/strong>\n&#8211; Most commonly caused by incorrect JSON property names.\n&#8211; Fix: Use Step 2 Discovery doc to confirm exact schema field names.\n&#8211; Also validate that your source manifest URL is reachable and properly formatted.<\/p>\n\n\n\n<p>3) <strong>Playback URI returns 403\/404<\/strong>\n&#8211; If your distribution requires signed URLs or a CDN key setup, the returned URL may require additional authorization.\n&#8211; Fix: Verify whether your config expects CDN signing and whether you must create CDN keys. Confirm the official \u201csecure playback\u201d guidance.<\/p>\n\n\n\n<p>4) <strong>Ads not appearing<\/strong>\n&#8211; Your ad tag may return no fill, be geo-restricted, blocked by policy, or require headers\/macros not provided.\n&#8211; Fix: Use a known-good test tag from your ad platform documentation; verify ad server logs.<\/p>\n\n\n\n<p>5) <strong>Latency\/timeouts<\/strong>\n&#8211; Ad decision calls can time out.\n&#8211; Fix: Ensure ad server endpoints are fast and reliable; use slates\/fallback if supported; monitor ad decision latency.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cleanup<\/h2>\n\n\n\n<p>Delete the resources you created to avoid ongoing charges and configuration clutter.<\/p>\n\n\n\n<p>1) Delete the VOD session:<\/p>\n\n\n\n<pre><code class=\"language-bash\">curl -s -X DELETE \\\n  -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  \"https:\/\/videostitcher.googleapis.com\/v1\/projects\/${PROJECT_ID}\/locations\/${LOCATION}\/vodSessions\/${VOD_SESSION_ID}\" | jq\n<\/code><\/pre>\n\n\n\n<p>2) Delete the VOD config:<\/p>\n\n\n\n<pre><code class=\"language-bash\">curl -s -X DELETE \\\n  -H \"Authorization: Bearer ${ACCESS_TOKEN}\" \\\n  \"https:\/\/videostitcher.googleapis.com\/v1\/projects\/${PROJECT_ID}\/locations\/${LOCATION}\/vodConfigs\/${VOD_CONFIG_ID}\" | jq\n<\/code><\/pre>\n\n\n\n<p>3) (Optional) Disable the API if you are done experimenting:<\/p>\n\n\n\n<pre><code class=\"language-bash\">gcloud services disable videostitcher.googleapis.com\n<\/code><\/pre>\n\n\n\n<p><strong>Expected outcome<\/strong>\n&#8211; Resources are removed and API optionally disabled.<\/p>\n\n\n\n<hr class=\"wp-block-separator\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">11. Best Practices<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Architecture best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Put a backend in front of session creation<\/strong>: Do not let untrusted clients create sessions directly; enforce auth, rate limits, entitlement, and geo rules.<\/li>\n<li><strong>Separate control plane and data plane concerns<\/strong>:<\/li>\n<li>Control plane: configs, sessions, keys, permissions.<\/li>\n<li>Data plane: CDN\/origin delivery, caching, segment URLs, DRM\/license.<\/li>\n<li><strong>Design for CDN caching<\/strong>:<\/li>\n<li>Session-unique manifests reduce cache hits; keep segment URLs cacheable where possible.<\/li>\n<li>Consider standard ad pod segment reuse patterns (where your ad system supports it).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">IAM \/ security best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Least privilege<\/strong>:<\/li>\n<li>CI\/CD pipeline: config admin role in non-prod only; gated in prod.<\/li>\n<li>Runtime session service: permission only to create sessions and read configs, not modify them.<\/li>\n<li><strong>Use dedicated service accounts<\/strong> for session services and automation.<\/li>\n<li><strong>Audit changes<\/strong>: restrict who can edit configs; require change control for prod.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Cost best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Measure cache hit ratio<\/strong> and origin egress before optimizing stitching logic.<\/li>\n<li><strong>Control logging volume<\/strong> in production; keep debug logs on-demand.<\/li>\n<li><strong>Right-size ad decisioning<\/strong>: excessive per-session unique targeting can reduce cacheability and increase cost.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Performance best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keep <strong>ad decision endpoints low latency<\/strong>; use regional endpoints where possible.<\/li>\n<li>Pre-warm and validate CDN configuration before major events.<\/li>\n<li>Use timeouts and fallback strategies (slate) to avoid playback stalls (verify behavior and configuration options).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Reliability best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Test with realistic concurrency; request quota increases early for large launches.<\/li>\n<li>Implement safe rollout:<\/li>\n<li>Stage configs in non-prod<\/li>\n<li>Canary percentage of sessions in prod<\/li>\n<li>Rollback strategy (switch routing to old config)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Operations best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create dashboards for:<\/li>\n<li>Session creation error rate<\/li>\n<li>Ad decision error\/timeout rates<\/li>\n<li>Manifest fetch errors<\/li>\n<li>Playback failures (from your player telemetry)<\/li>\n<li>Establish on-call runbooks:<\/li>\n<li>\u201cAds not filling\u201d<\/li>\n<li>\u201cPlayback 403\/404\u201d<\/li>\n<li>\u201cSpikes in session creation failures\u201d<\/li>\n<li>Keep a known-good \u201cbaseline config\u201d for emergency fallback.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Governance \/ tagging \/ naming best practices<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use consistent naming:<\/li>\n<li><code>vodcfg-{env}-{brand}-{region}-{purpose}<\/code><\/li>\n<li><code>livecfg-{env}-{channel}-{region}<\/code><\/li>\n<li>Use labels\/tags (where supported) to map resources to:<\/li>\n<li>environment (dev\/stage\/prod)<\/li>\n<li>owner team<\/li>\n<li>cost center<\/li>\n<li>Keep configs in <strong>separate projects<\/strong> per environment whenever possible.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">12. Security Considerations<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Identity and access model<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Video Stitcher API uses <strong>IAM<\/strong> for API access.<\/li>\n<li>Production best practice: session creation happens in a <strong>trusted backend<\/strong> (Cloud Run\/GKE) using a dedicated service account.<\/li>\n<li>Avoid embedding Google credentials or API access in client apps.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Encryption<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google Cloud APIs use TLS in transit.<\/li>\n<li>At rest encryption depends on your origin storage and logs:<\/li>\n<li>Cloud Storage encrypts by default; consider CMEK if required.<\/li>\n<li>Logs in Cloud Logging have their own retention and security model.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Network exposure<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>API endpoints are public (Google APIs).<\/li>\n<li>Origins\/ad servers must be reachable. If your origin is private, validate supported private access patterns (verify in official docs).<\/li>\n<li>Use CDN and signed URL\/token controls to prevent playback URL sharing.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Secrets handling<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Store ad tech secrets (tokens, signing keys) in <strong>Secret Manager<\/strong>.<\/li>\n<li>Rotate keys regularly and automate rotation.<\/li>\n<li>Do not store secrets in configs if avoidable; prefer referencing secrets in your backend service.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Audit\/logging<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use <strong>Cloud Audit Logs<\/strong> to track who changed configs and keys (verify which operations are audited).<\/li>\n<li>Export logs to BigQuery\/SIEM if required by compliance.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Compliance considerations<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SSAI can involve user identifiers and targeting parameters.<\/li>\n<li>Treat ad request parameters and session identifiers as potentially sensitive.<\/li>\n<li>Ensure GDPR\/CCPA policies are enforced in your session service and ad decisioning.<\/li>\n<li>Validate data residency requirements for your selected location.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Common security mistakes<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Allowing clients to create sessions directly (abuse, cost blowout).<\/li>\n<li>Using long-lived playback URLs without signing or TTL.<\/li>\n<li>Over-permissioned service accounts (admin roles in runtime).<\/li>\n<li>Storing ad tags or keys in source code or client apps.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Secure deployment recommendations<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Put a <strong>Playback Session Service<\/strong> behind an authenticated endpoint (API Gateway \/ Load Balancer + OAuth\/JWT).<\/li>\n<li>Implement per-user entitlements and rate limits.<\/li>\n<li>Use signed CDN URLs\/tokens with short TTL.<\/li>\n<li>Separate prod and non-prod projects, and use strict IAM boundaries.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">13. Limitations and Gotchas<\/h2>\n\n\n\n<p>The exact limitations depend on current product behavior\u2014verify in official docs. Common SSAI gotchas to plan for:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Regional availability<\/strong>: Not all locations may be supported.<\/li>\n<li><strong>Quota constraints<\/strong>: Session creation and request rates may be limited by default.<\/li>\n<li><strong>Manifest cacheability<\/strong>: Per-viewer manifests reduce CDN cache hit ratio.<\/li>\n<li><strong>Ad fill variability<\/strong>: Empty fill, geo restrictions, frequency capping, and policy rules can lead to no-ads outcomes that look like \u201cstitching is broken.\u201d<\/li>\n<li><strong>Ad server latency<\/strong>: Slow ad decisioning can delay manifest generation and harm startup time.<\/li>\n<li><strong>Format\/codec constraints<\/strong>: Your source packaging must match what the service supports (HLS\/DASH variants, segment formats). Packaging mismatches are a frequent cause of errors.<\/li>\n<li><strong>DRM complexity<\/strong>: DRM is not \u201cautomatic\u201d; DRM licensing\/packaging needs to be designed end-to-end (verify recommended patterns).<\/li>\n<li><strong>Troubleshooting difficulty<\/strong>: You often need visibility across player telemetry, CDN logs, origin logs, and ad server logs to fully debug issues.<\/li>\n<li><strong>Multi-CDN considerations<\/strong>: If you use multiple CDNs, ensure consistent token\/signing and URL patterns.<\/li>\n<li><strong>Cost surprises<\/strong>:<\/li>\n<li>High log volume during incidents<\/li>\n<li>High egress during spikes<\/li>\n<li>Low cache hit ratio due to excessive personalization in session manifests<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">14. Comparison with Alternatives<\/h2>\n\n\n\n<p>Video Stitcher API is specialized for SSAI. It is not a transcoder, not a live encoder, and not a full video platform.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Options to consider<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Google Cloud Transcoder API<\/strong>: Encoding and packaging; does not perform SSAI stitching.<\/li>\n<li><strong>Google Cloud Live Stream API<\/strong>: Live encoding\/packaging; SSAI still needs a separate approach.<\/li>\n<li><strong>Media CDN \/ Cloud CDN + custom SSAI<\/strong>: Build your own stitching control plane; high flexibility, high ops burden.<\/li>\n<li><strong>AWS Elemental MediaTailor<\/strong>: AWS-managed SSAI service.<\/li>\n<li><strong>Third-party SSAI platforms<\/strong>: Vendor-managed ad insertion integrated with specific ad ecosystems.<\/li>\n<li><strong>Open-source\/self-managed<\/strong>: Custom origin manipulations, packagers, and ad insertion logic (high engineering\/ops).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Comparison table<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>Option<\/th>\n<th>Best For<\/th>\n<th>Strengths<\/th>\n<th>Weaknesses<\/th>\n<th>When to Choose<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Google Cloud Video Stitcher API<\/strong><\/td>\n<td>SSAI on Google Cloud<\/td>\n<td>Managed SSAI control plane; integrates with IAM\/Cloud ops; fits Google Cloud media stacks<\/td>\n<td>Requires correct packaging\/ad setup; session-based manifests can reduce caching; feature scope must be verified<\/td>\n<td>You want Google Cloud-native SSAI and managed stitching<\/td>\n<\/tr>\n<tr>\n<td><strong>Google Cloud Transcoder API<\/strong><\/td>\n<td>VOD encoding\/packaging<\/td>\n<td>Managed transcoding; scalable; integrates with Cloud Storage<\/td>\n<td>Not SSAI<\/td>\n<td>You need HLS\/DASH outputs; pair with Stitcher for monetization<\/td>\n<\/tr>\n<tr>\n<td><strong>Google Cloud Live Stream API<\/strong><\/td>\n<td>Live encoding\/packaging<\/td>\n<td>Managed live pipeline<\/td>\n<td>Not SSAI<\/td>\n<td>You need live channel creation; add SSAI separately<\/td>\n<\/tr>\n<tr>\n<td><strong>Media CDN \/ Cloud CDN + custom SSAI<\/strong><\/td>\n<td>Highly custom SSAI logic<\/td>\n<td>Maximum control; can tune caching and targeting deeply<\/td>\n<td>Significant engineering and ops burden<\/td>\n<td>You have unique needs and the team to run it<\/td>\n<\/tr>\n<tr>\n<td><strong>AWS Elemental MediaTailor<\/strong><\/td>\n<td>SSAI on AWS<\/td>\n<td>Mature SSAI ecosystem on AWS<\/td>\n<td>Cloud coupling; migration overhead<\/td>\n<td>You are primarily on AWS or already use AWS media stack<\/td>\n<\/tr>\n<tr>\n<td><strong>Third-party SSAI vendors<\/strong><\/td>\n<td>Full-service monetization platforms<\/td>\n<td>Often includes measurement, ad ops tooling, managed support<\/td>\n<td>Vendor lock-in; cost; integration complexity<\/td>\n<td>You want turnkey SSAI with dedicated vendor features<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">15. Real-World Example<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Enterprise example: Global broadcaster launching FAST channels<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Problem<\/strong>: A broadcaster is launching multiple FAST channels globally. They need SSAI for consistent ad insertion on CTV devices, with strict uptime during live events.<\/li>\n<li><strong>Proposed architecture<\/strong>:<\/li>\n<li>Live pipeline (encoding\/packaging) \u2192 origin<\/li>\n<li>Video Stitcher API creates live sessions per viewer region\/device<\/li>\n<li>Media CDN for global distribution<\/li>\n<li>Backend entitlement + geo policy service creates sessions and passes targeting parameters (as allowed by the ad system)<\/li>\n<li>Cloud Monitoring dashboards + alerting for ad decision latency, session failures, and manifest errors<\/li>\n<li><strong>Why Video Stitcher API was chosen<\/strong>:<\/li>\n<li>Managed SSAI reduces time-to-market and operational risk.<\/li>\n<li>Google Cloud-native IAM and logging simplify governance.<\/li>\n<li><strong>Expected outcomes<\/strong>:<\/li>\n<li>Consistent ad playback across device families<\/li>\n<li>Improved fill stability vs client-side ad SDK fragmentation<\/li>\n<li>Better operational visibility through standardized metrics\/logs (as available)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Startup\/small-team example: Ad-supported VOD tier<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Problem<\/strong>: A startup has a VOD library and wants to introduce a free, ad-supported tier without rewriting multiple player apps with complex ad SDK logic.<\/li>\n<li><strong>Proposed architecture<\/strong>:<\/li>\n<li>VOD assets in Cloud Storage (as origin) and packaged as HLS<\/li>\n<li>Video Stitcher API VOD config per app environment (dev\/prod)<\/li>\n<li>Cloud Run \u201cPlayback API\u201d creates sessions and enforces user tier rules<\/li>\n<li>Cloud CDN in front of origin for caching\/egress control<\/li>\n<li><strong>Why Video Stitcher API was chosen<\/strong>:<\/li>\n<li>Small team wants managed SSAI rather than building a custom manifest manipulator.<\/li>\n<li><strong>Expected outcomes<\/strong>:<\/li>\n<li>Faster rollout of ad-supported tier<\/li>\n<li>Reduced client work: apps just play the returned manifest URL<\/li>\n<li>Clearer backend control of monetization logic<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">16. FAQ<\/h2>\n\n\n\n<p>1) <strong>Is Video Stitcher API an AI or ML service?<\/strong><br\/>\nNot directly. It\u2019s a media\/monetization service for SSAI. It often complements AI and ML systems that optimize ad selection, personalization, or revenue forecasting upstream.<\/p>\n\n\n\n<p>2) <strong>What formats does Video Stitcher API support (HLS\/DASH)?<\/strong><br\/>\nSupport depends on current product capabilities and configuration. Check the official documentation and REST reference for supported formats and constraints: https:\/\/cloud.google.com\/video-stitcher\/docs<\/p>\n\n\n\n<p>3) <strong>Does Video Stitcher API transcode video?<\/strong><br\/>\nNo. Use Transcoder API or a packaging pipeline to produce HLS\/DASH renditions. Video Stitcher API focuses on stitching ads into the playback experience.<\/p>\n\n\n\n<p>4) <strong>Can I use it for live streaming?<\/strong><br\/>\nVideo Stitcher API supports live workflows via live configs\/sessions where available. Confirm live requirements (markers, manifests, timing) in official docs.<\/p>\n\n\n\n<p>5) <strong>Do players need an ad SDK?<\/strong><br\/>\nTypically SSAI reduces or eliminates the need for a client-side ad SDK, but you may still need player-side analytics\/measurement components depending on business requirements.<\/p>\n\n\n\n<p>6) <strong>How do I secure playback URLs?<\/strong><br\/>\nCommon patterns include signed CDN URLs\/tokens, short TTLs, and creating sessions only from a trusted backend. Verify CDN key\/signing options supported by your setup.<\/p>\n\n\n\n<p>7) <strong>Will SSAI stop ad blockers?<\/strong><br\/>\nIt can reduce ad blocking effectiveness compared to client-side ads because ads look like content segments. However, nothing is foolproof; design holistically.<\/p>\n\n\n\n<p>8) <strong>How do I pass targeting parameters (geo\/device\/user segments)?<\/strong><br\/>\nUsually through ad request parameters or session creation logic in your backend, subject to your ad system\u2019s capabilities and privacy policies. Verify supported macros\/parameters.<\/p>\n\n\n\n<p>9) <strong>What happens if the ad server is down?<\/strong><br\/>\nDepending on configuration, you may get no ads, fallback behavior, or slate insertion. Design for timeouts and failover; verify exact behavior in docs.<\/p>\n\n\n\n<p>10) <strong>How do I monitor ad fill and ad decision latency?<\/strong><br\/>\nCombine:\n&#8211; Video Stitcher API logs\/metrics (as available)\n&#8211; Ad server logs\n&#8211; Player telemetry (startup time, rebuffering, ad errors)\n&#8211; CDN logs (manifest\/segment errors)<\/p>\n\n\n\n<p>11) <strong>Does Video Stitcher API provide DRM?<\/strong><br\/>\nDRM is typically handled by packaging\/license infrastructure, not the stitching API itself. Confirm official guidance for DRM + SSAI integration.<\/p>\n\n\n\n<p>12) <strong>Can I use Cloud Storage as an origin?<\/strong><br\/>\nOften yes for VOD origins, but you must package content appropriately and design caching\/CDN. Verify recommended origin patterns in official docs.<\/p>\n\n\n\n<p>13) <strong>How many sessions can I create per second?<\/strong><br\/>\nDepends on quotas for your project and location. Check the Quotas page in Google Cloud Console and request increases early for launches.<\/p>\n\n\n\n<p>14) <strong>Can I use multiple configs (A\/B tests) at the same time?<\/strong><br\/>\nYes\u2014create separate configs and route session creation in your backend by experiment assignment.<\/p>\n\n\n\n<p>15) <strong>What\u2019s the fastest way to get started?<\/strong><br\/>\nUse the official quickstart and REST reference, enable the API, and run a small VOD session test with a known-good source manifest and test ad tag:\n&#8211; Docs: https:\/\/cloud.google.com\/video-stitcher\/docs<br\/>\n&#8211; REST reference: https:\/\/cloud.google.com\/video-stitcher\/docs\/reference\/rest<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">17. Top Online Resources to Learn Video Stitcher API<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>Resource Type<\/th>\n<th>Name<\/th>\n<th>Why It Is Useful<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Official documentation<\/td>\n<td>Video Stitcher API Documentation \u2014 https:\/\/cloud.google.com\/video-stitcher\/docs<\/td>\n<td>The authoritative source for concepts, supported workflows, and setup steps<\/td>\n<\/tr>\n<tr>\n<td>REST API reference<\/td>\n<td>Video Stitcher API REST Reference \u2014 https:\/\/cloud.google.com\/video-stitcher\/docs\/reference\/rest<\/td>\n<td>Exact resource paths, methods, and request\/response schemas<\/td>\n<\/tr>\n<tr>\n<td>Pricing<\/td>\n<td>Video Stitcher API Pricing \u2014 https:\/\/cloud.google.com\/video-stitcher\/pricing<\/td>\n<td>Current pricing model and billable dimensions (do not rely on guesses)<\/td>\n<\/tr>\n<tr>\n<td>Pricing tool<\/td>\n<td>Google Cloud Pricing Calculator \u2014 https:\/\/cloud.google.com\/products\/calculator<\/td>\n<td>Build an estimate including egress, storage, and usage assumptions<\/td>\n<\/tr>\n<tr>\n<td>IAM overview<\/td>\n<td>Google Cloud IAM Documentation \u2014 https:\/\/cloud.google.com\/iam\/docs<\/td>\n<td>How to design least-privilege access for session services and admins<\/td>\n<\/tr>\n<tr>\n<td>Cloud Operations<\/td>\n<td>Cloud Logging \u2014 https:\/\/cloud.google.com\/logging\/docs<\/td>\n<td>Central place for API and application logs; build troubleshooting workflows<\/td>\n<\/tr>\n<tr>\n<td>Cloud Operations<\/td>\n<td>Cloud Monitoring \u2014 https:\/\/cloud.google.com\/monitoring\/docs<\/td>\n<td>Dashboards and alerting for platform health and SLOs<\/td>\n<\/tr>\n<tr>\n<td>CDN<\/td>\n<td>Media CDN \u2014 https:\/\/cloud.google.com\/media-cdn\/docs<\/td>\n<td>CDN patterns for large-scale media delivery (recommended for production delivery)<\/td>\n<\/tr>\n<tr>\n<td>CDN<\/td>\n<td>Cloud CDN \u2014 https:\/\/cloud.google.com\/cdn\/docs<\/td>\n<td>Caching patterns and signed URL approaches (depending on your setup)<\/td>\n<\/tr>\n<tr>\n<td>Encoding<\/td>\n<td>Transcoder API \u2014 https:\/\/cloud.google.com\/transcoder\/docs<\/td>\n<td>Create HLS\/DASH renditions for your origin if you don\u2019t already have a packager<\/td>\n<\/tr>\n<tr>\n<td>Security<\/td>\n<td>Secret Manager \u2014 https:\/\/cloud.google.com\/secret-manager\/docs<\/td>\n<td>Store ad-tech tokens and signing keys securely<\/td>\n<\/tr>\n<tr>\n<td>Code samples (official)<\/td>\n<td>Google Cloud Client Libraries \u2014 https:\/\/cloud.google.com\/video-stitcher\/docs\/reference\/libraries<\/td>\n<td>Find supported languages and usage patterns<\/td>\n<\/tr>\n<tr>\n<td>Community learning<\/td>\n<td>Google Cloud Architecture Center \u2014 https:\/\/cloud.google.com\/architecture<\/td>\n<td>Streaming and delivery architecture patterns (not always Stitcher-specific)<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">18. Training and Certification Providers<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>Institute<\/th>\n<th>Suitable Audience<\/th>\n<th>Likely Learning Focus<\/th>\n<th>Mode<\/th>\n<th>Website URL<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>DevOpsSchool.com<\/td>\n<td>DevOps engineers, SREs, cloud engineers<\/td>\n<td>Cloud DevOps, CI\/CD, operations foundations that help run media services reliably<\/td>\n<td>Check website<\/td>\n<td>https:\/\/www.devopsschool.com<\/td>\n<\/tr>\n<tr>\n<td>ScmGalaxy.com<\/td>\n<td>Beginners to intermediate engineers<\/td>\n<td>DevOps\/SCM basics, cloud fundamentals<\/td>\n<td>Check website<\/td>\n<td>https:\/\/www.scmgalaxy.com<\/td>\n<\/tr>\n<tr>\n<td>CLoudOpsNow.in<\/td>\n<td>Cloud operations teams<\/td>\n<td>Cloud operations practices, monitoring, cost basics<\/td>\n<td>Check website<\/td>\n<td>https:\/\/www.cloudopsnow.in<\/td>\n<\/tr>\n<tr>\n<td>SreSchool.com<\/td>\n<td>SREs, reliability engineers<\/td>\n<td>SRE practices, incident response, monitoring\/alerting<\/td>\n<td>Check website<\/td>\n<td>https:\/\/www.sreschool.com<\/td>\n<\/tr>\n<tr>\n<td>AiOpsSchool.com<\/td>\n<td>Ops + data teams<\/td>\n<td>AIOps concepts, analytics-driven operations (adjacent to AI and ML category)<\/td>\n<td>Check website<\/td>\n<td>https:\/\/www.aiopsschool.com<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">19. Top Trainers<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>Platform\/Site<\/th>\n<th>Likely Specialization<\/th>\n<th>Suitable Audience<\/th>\n<th>Website URL<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>RajeshKumar.xyz<\/td>\n<td>Cloud\/DevOps training content (verify exact offerings)<\/td>\n<td>Beginners to intermediate<\/td>\n<td>https:\/\/rajeshkumar.xyz<\/td>\n<\/tr>\n<tr>\n<td>devopstrainer.in<\/td>\n<td>DevOps and cloud training (verify exact offerings)<\/td>\n<td>DevOps engineers, SREs<\/td>\n<td>https:\/\/www.devopstrainer.in<\/td>\n<\/tr>\n<tr>\n<td>devopsfreelancer.com<\/td>\n<td>Freelance DevOps consulting\/training listings (verify exact offerings)<\/td>\n<td>Teams seeking short engagements<\/td>\n<td>https:\/\/www.devopsfreelancer.com<\/td>\n<\/tr>\n<tr>\n<td>devopssupport.in<\/td>\n<td>DevOps support and training resources (verify exact offerings)<\/td>\n<td>Ops teams and engineers<\/td>\n<td>https:\/\/www.devopssupport.in<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">20. Top Consulting Companies<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th>Company<\/th>\n<th>Likely Service Area<\/th>\n<th>Where They May Help<\/th>\n<th>Consulting Use Case Examples<\/th>\n<th>Website URL<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>cotocus.com<\/td>\n<td>Cloud\/DevOps consulting (verify service catalog)<\/td>\n<td>Architecture, automation, operations<\/td>\n<td>CI\/CD for session services, monitoring dashboards, infrastructure reviews<\/td>\n<td>https:\/\/cotocus.com<\/td>\n<\/tr>\n<tr>\n<td>DevOpsSchool.com<\/td>\n<td>DevOps\/cloud consulting and training (verify service catalog)<\/td>\n<td>Platform engineering, DevOps enablement<\/td>\n<td>Building deployment pipelines, IAM hardening, cost governance foundations<\/td>\n<td>https:\/\/www.devopsschool.com<\/td>\n<\/tr>\n<tr>\n<td>DEVOPSCONSULTING.IN<\/td>\n<td>DevOps consulting (verify service catalog)<\/td>\n<td>DevOps transformation, operational practices<\/td>\n<td>Incident response runbooks, observability stacks, cloud migration planning<\/td>\n<td>https:\/\/www.devopsconsulting.in<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">21. Career and Learning Roadmap<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What to learn before Video Stitcher API<\/h3>\n\n\n\n<p>To be effective with Video Stitcher API in real systems, learn:\n&#8211; <strong>Streaming fundamentals<\/strong>: HLS\/DASH, manifests, segments, ABR ladders, codecs\n&#8211; <strong>HTTP\/CDN fundamentals<\/strong>: caching headers, signed URLs, origin shielding\n&#8211; <strong>Google Cloud basics<\/strong>: projects, IAM, service accounts, quotas, billing\n&#8211; <strong>Observability<\/strong>: logs, metrics, tracing basics\n&#8211; <strong>Ad tech basics<\/strong> (helpful): VAST\/VMAP concepts, ad decisioning, fill, latency<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What to learn after<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Production media delivery<\/strong>: Media CDN design, multi-region origins, failover<\/li>\n<li><strong>Security hardening<\/strong>: key rotation, signed playback, threat modeling for streaming<\/li>\n<li><strong>Analytics pipelines<\/strong>: BigQuery, data modeling for playback and ad metrics<\/li>\n<li><strong>AI\/ML adjacency<\/strong>:<\/li>\n<li>Audience segmentation (BigQuery ML \/ Vertex AI)<\/li>\n<li>Revenue optimization experiments<\/li>\n<li>Churn prediction and ad load balancing<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Job roles that use it<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Streaming platform engineer<\/li>\n<li>Cloud solutions architect (media)<\/li>\n<li>SRE \/ DevOps engineer supporting streaming workloads<\/li>\n<li>Monetization engineer \/ ad integration engineer<\/li>\n<li>Platform\/security engineer reviewing playback authorization and IAM<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Certification path (Google Cloud)<\/h3>\n\n\n\n<p>There is no \u201cVideo Stitcher certification\u201d specifically. Useful certifications include:\n&#8211; <strong>Professional Cloud Architect<\/strong>\n&#8211; <strong>Professional Cloud DevOps Engineer<\/strong>\n&#8211; <strong>Professional Cloud Security Engineer<\/strong>\n&#8211; <strong>Associate Cloud Engineer<\/strong><\/p>\n\n\n\n<p>Check Google Cloud\u2019s certification landing pages for current offerings:\nhttps:\/\/cloud.google.com\/learn\/certification<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Project ideas for practice<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Build a Cloud Run \u201cPlayback API\u201d that:<\/li>\n<li>Authenticates users (JWT)<\/li>\n<li>Creates Video Stitcher sessions<\/li>\n<li>Returns playback URLs with TTL<\/li>\n<li>Add a dashboard:<\/li>\n<li>session success rate<\/li>\n<li>manifest fetch error rate<\/li>\n<li>ad decision latency (if exposed)<\/li>\n<li>Run A\/B configs and measure retention differences using BigQuery.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">22. Glossary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SSAI (Server-Side Ad Insertion)<\/strong>: Ads are inserted on the server by manipulating manifests\/streams, rather than by the player app.<\/li>\n<li><strong>HLS<\/strong>: HTTP Live Streaming; uses <code>.m3u8<\/code> manifests and segmented media.<\/li>\n<li><strong>MPEG-DASH<\/strong>: Adaptive streaming format; uses <code>.mpd<\/code> manifests.<\/li>\n<li><strong>Manifest<\/strong>: A playlist describing media segments and renditions for adaptive bitrate playback.<\/li>\n<li><strong>Segment<\/strong>: A small chunk of media (e.g., a few seconds) referenced by the manifest.<\/li>\n<li><strong>VAST\/VMAP<\/strong>: Common ad standards used for video ad serving (exact usage depends on your ad system and stitcher support).<\/li>\n<li><strong>Ad tag<\/strong>: A URL used to request ads from an ad server.<\/li>\n<li><strong>Slate<\/strong>: Fallback video used when an ad cannot be inserted or during a break.<\/li>\n<li><strong>CDN (Content Delivery Network)<\/strong>: Edge caching and delivery network to reduce latency and origin load.<\/li>\n<li><strong>Signed URL\/Token<\/strong>: A time-limited authorization mechanism for accessing media.<\/li>\n<li><strong>Origin<\/strong>: The server\/bucket where manifests and segments are stored and served from.<\/li>\n<li><strong>Cache hit ratio<\/strong>: Percentage of requests served from CDN cache instead of origin.<\/li>\n<li><strong>Quota<\/strong>: Service limits (requests per minute, concurrent sessions, etc.) enforced per project\/location.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">23. Summary<\/h2>\n\n\n\n<p>Video Stitcher API is Google Cloud\u2019s managed <strong>server-side ad insertion<\/strong> service that generates ad-stitched playback manifests and supports session-based playback workflows. It matters because SSAI is a core building block for reliable monetization in modern streaming\u2014especially for CTV and large-scale VOD\/live platforms.<\/p>\n\n\n\n<p>In a Google Cloud architecture, Video Stitcher API typically sits between your playback control plane (a backend that creates sessions) and your distribution stack (origin + Media CDN\/Cloud CDN), with an external ad server providing decisions. The key cost drivers are usage (sessions\/stitched minutes\u2014verify exact billing units) and, often more significantly, CDN egress and cache efficiency. From a security standpoint, the most important practices are <strong>least-privilege IAM<\/strong>, keeping session creation in a trusted backend, and protecting playback URLs using TTL and signing.<\/p>\n\n\n\n<p>Use Video Stitcher API when you need a managed SSAI layer that integrates cleanly with Google Cloud operations and governance. Next steps: read the official REST reference, validate supported formats and live\/VOD requirements for your pipeline, and expand the lab into a production-ready \u201cPlayback API\u201d service with monitoring, quotas, and secure playback controls.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI and ML<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53,51],"tags":[],"class_list":["post-581","post","type-post","status-publish","format-standard","hentry","category-ai-and-ml","category-google-cloud"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/comments?post=581"}],"version-history":[{"count":0,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/581\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/media?parent=581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/categories?post=581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/tutorials\/wp-json\/wp\/v2\/tags?post=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}