The Video Stitcher API allows you to manipulate video content to dynamically insert ads prior to delivery to client devices. Using the Video Stitcher API, you can monetize your video-on-demand (VOD) and live stream videos by inserting ads as described by metadata stored on ad servers.
The Video Stitcher API relies on the following resources:
- Video-on-demand manifests stored and distributed via a Content Delivery Network (CDN).
- Registered CDN keys that the Video Stitcher API requires to retrieve videos prior to stitching.
- Video Multiple Ad Playlist (VMAP), SmartXML, or Video Ad Serving Template (VAST) compliant ad servers to deliver ad metadata.
Video stitching entities
The following image shows the four entities involved in video stitching. Each solid arrow denotes an explicit request from one entity to another. The lighter-colored, dotted-line arrows denote possible requests from one entity to another.
Video Stitcher API
This section describes the features that make up the Video Stitcher API and the primary purpose of each feature.
Adaptive bitrate HTTP streaming
The Video Stitcher API supports the following formats:
- Common Media Application Format (CMAF) compliant HTTP Live Streaming (HLS)
- Dynamic Adaptive Streaming over HTTP (DASH) standard adaptive bitrate streaming
For HLS, ads are stitched after the closest segment to the time offset as specified by the VMAP or SmartXML metadata.
For DASH, ads are stitched after the closest period to the time offset as specified by the VMAP or SmartXML data.
Ad server compliance
The Video Stitcher API complies with ad servers that support the following formats:
- IAB Tech Lab Digital Video Ad Serving Template (VAST), up to version 4.0
- IAB Tech Lab Digital Video Multiple Ad Playlist (VMAP)
- FreeWheel SmartXML
VMAP and SmartXML provide a complete ad playlist, including time offsets, to insert into a VOD asset. If you provide a VAST-only ad tag, the Video Stitcher API treats the ad pod (a sequenced group of ads) as pre-roll, and inserts them before the start of the VOD asset.
Server-side ad tracking
To support a variety of video players, the Video Stitcher API can trigger ad tracking events on the server-side on behalf of the client. Server-side ad tracking can help you to avoid loss of revenue due to client-side ad blocking.
CDN tokenization support
The Video Stitcher API supports retrieving raw videos distributed through Media CDN and the ability to tokenize the segment URLs.
Ad videos provided from ad servers using adaptive bitrate (ABR) streaming might not always be encoded correctly to support every type of client device. The Video Stitcher API re-encodes ad videos to ensure the best quality ads are delivered to a variety of client players. There is a limit of 1000 ads per Google Cloud project.
Every new ad must be encoded before it can be stitched into either a live or VOD session. Expect each ad to be encoded within five minutes. After the ad has been encoded, it can be reused in any number of subsequent sessions. This encoding happens asynchronously and does not require any action to enable or initiate. Due to this encoding time, ads may not be stitched in the first ad break of a live session or in the first VOD session created with the given ad tag.