[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Video Stitcher API overview\n\nThe Video Stitcher API allows you to manipulate video content to dynamically\ninsert ads prior to delivery to client devices. Using the\nVideo Stitcher API, you can monetize your video-on-demand (VOD) and\nlivestream videos by inserting ads as described by metadata stored on ad\nservers.\n\nData model\n----------\n\nThe Video Stitcher API relies on the following resources:\n\n- Video-on-demand manifests stored and distributed via a Content Delivery Network (CDN).\n- Registered CDN keys that the Video Stitcher API requires to retrieve videos prior to stitching.\n- [Video Multiple Ad Playlist (VMAP)](https://www.iab.com/guidelines/vmap/), [SmartXML](http://www.oroptimizer.com/smartxml/index.aspx), or [Video Ad Serving Template\n (VAST)](https://www.iab.com/guidelines/vast/) compliant ad servers to deliver ad metadata.\n\nVideo stitching entities\n------------------------\n\nThe following image shows the four entities involved in video stitching.\nEach solid arrow denotes an explicit request from one entity to another. The\nlighter-colored, dotted-line arrows denote possible requests from one entity to\nanother.\n\n| **Key Point:** The Video Stitcher API does not store the content provider's source content (media). The Video Stitcher API provides a manifest that references the content provider's CDN for source content.\n\nFeatures\n--------\n\nThis section describes the features that make up the Video Stitcher API\nand the primary purpose of each feature.\n\n### Adaptive bitrate HTTP streaming\n\nThe Video Stitcher API supports the following formats:\n\n- [Common Media Application Format (CMAF) compliant HTTP Live Streaming (HLS)](https://developer.apple.com/documentation/http_live_streaming/about_the_common_media_application_format_with_http_live_streaming)\n- [Dynamic Adaptive Streaming over HTTP (DASH)](https://wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP) standard adaptive bitrate streaming\n\nFor HLS, ads are stitched after the closest segment to the time offset as\nspecified by the VMAP or SmartXML metadata.\n\nFor DASH, ads are stitched after the closest period to the time offset as\nspecified by the VMAP or SmartXML data.\n\n### Ad server compliance\n\nThe Video Stitcher API complies with ad servers that support the following\nformats:\n\n- [IAB Tech Lab Digital Video Ad Serving Template (VAST)](https://iabtechlab.com/standards/vast/), up to version 4.0\n- [IAB Tech Lab Digital Video Multiple Ad Playlist (VMAP)](https://iabtechlab.com/standards/video-multiple-ad-playlist-vmap/)\n- [FreeWheel](https://docs.vdms.com/video/Content/AdIntegration/Freewheel.htm) SmartXML\n\nVMAP and SmartXML provide a complete ad playlist, including time offsets, to\ninsert into a VOD asset. If you provide a VAST-only ad tag, the\nVideo Stitcher API treats the ad pod (a sequenced group of ads) as\npre-roll, and inserts them before the start of the VOD asset.\n\n### Server-side ad tracking\n\nTo support a variety of video players, the Video Stitcher API can trigger\nad tracking events on the server-side on behalf of the client. Server-side ad\ntracking can help you to avoid loss of revenue due to client-side ad blocking.\n\n### CDN tokenization support\n\nThe Video Stitcher API supports retrieving raw videos distributed through\n[Media CDN](/media-cdn) and the ability to tokenize the segment\nURLs.\n\n### Ad re-encoding\n\nAd videos provided from ad servers using adaptive bitrate (ABR) streaming might\nnot always be encoded correctly to support every type of client device. The\nVideo Stitcher API re-encodes ad videos to ensure the best quality ads are\ndelivered to a variety of client players. There is a limit of 1000 ads per\nGoogle Cloud project.\n\nEvery new ad must be encoded before it can be stitched into either a live or VOD\nsession. Expect each ad to be encoded within five minutes. After the ad has been\nencoded, it can be reused in any number of subsequent sessions. This encoding\nhappens asynchronously and does not require any action to enable or initiate.\nDue to this encoding time, ads may not be stitched in the first ad break of a\nlive session or in the first VOD session created with the given ad tag.\n\nWhat's next\n-----------\n\n- See the [Pricing](/video-stitcher/pricing) page.\n- Complete the [quickstart for livestreams](/video-stitcher/docs/quickstarts/inserting-ads-into-live).\n- Complete the [quickstart for VOD assets](/video-stitcher/docs/quickstarts/inserting-ads-into-vod)."]]