- Resource: Video
- VideoUri
- GenerationSource
- VideoInput
- CompositeTemplate
- VideoTheme
- VideoType
- InputImage
- GenAiTemplate
- VideoTheme
- VideoConfig
- ImageEditingOption
- BrandInfo
- Color
- VideoStatus
- Methods
Resource: Video
Represents a video object.
JSON representation |
---|
{ "name": string, "videoUri": { object ( |
Fields | |
---|---|
name |
Output only. Identifier. The unique key for the video using the format of |
videoUri |
Output only. The uri of the generated video. This is a temporary url and will expire after 6 months. A url may not be populated immediately after generation. Use get or list api using videoId to get the url. |
generationSource |
Output only. The source of the video. |
generationTime |
Output only. The timestamp when the video was generated. |
expirationTime |
Output only. The timestamp when the video expires. |
videoInput |
Required. The original input request used to generate the video. |
videoStatus |
Output only. The status of the video generation. |
VideoUri
Represents different types of video urls.
JSON representation |
---|
{ "playableUri": string, "downloadableUri": string, "thumbnailUri": string, "previewUri": string } |
Fields | |
---|---|
playableUri |
The playable uri for the video. |
downloadableUri |
The downloadable uri for the video. |
thumbnailUri |
The static thumbnail uri for the video. |
previewUri |
A 6s preview of the video. This is a playable url. |
GenerationSource
The source of the video.
Enums | |
---|---|
GENERATION_SOURCE_UNSPECIFIED |
Unspecified generation source. |
MERCHANT_GENERATED |
The video was generated by the merchant. |
GENERATED_FOR_YOU |
The video was generated by Google. |
VideoInput
The input request to generate video.
JSON representation |
---|
{ "videoConfig": { object ( |
Fields | |
---|---|
videoConfig |
Required. The configuration for the video to use for generation. These are the parameters that merchant can set to customize the video generation. |
Union field video_template . The video template to use for generation. video_template can be only one of the following: |
|
compositeTemplate |
Multiple asset/data types stitched together using specific, predefined templates. Images, text, logos are pulled automatically into pre-defined slots in the template to output a video. |
genAiTemplate |
Leverage AI to create short (~6s) video animations from still images for a single product. This can only be used for a single product. Generated clips can be stitched together for longer outputs using CompositeTemplate, for example product showcase from multiple animated movements. |
regionCode |
CLDR country code (For example "US"). The region code is used to run eligibility checks for the underlying products and images used in the video generation. |
CompositeTemplate
Represents a composite video template for generating videos with multiple assets (for example images, texts) stitched together using specific, predefined templates.
JSON representation |
---|
{ "theme": enum ( |
Fields | |
---|---|
theme |
Required. The theme of the video to generate. |
videoType |
Required. The type of video to generate, for example product, brand, deal, categorical. |
products[] |
Optional. The name of the product to generate the video for. Format: |
headlines[] |
Optional. Short descriptions/titles for the video. for example Summer sale on all Nike hoodies. If not provided, the headlines will be fetched from the product and auto-generated. |
images[] |
Optional. The images to use for video generation. If not provided, the images will be fetched from the product. |
VideoTheme
List of video transitions.
Enums | |
---|---|
VIDEO_THEME_UNSPECIFIED |
Unspecified video theme. |
MOVING_GRID |
Requires 3 images, 3 texts for example https://www.youtube.com/embed/NyBKgo5H0K4 |
ORIGIN_STORY |
Requires 4 images, 4 texts for example https://www.youtube.com/embed/wBsrEpqzhug |
SCRIBBLE_REVEAL |
Requires 5 images, 2 texts, for example https://www.youtube.com/embed/wd7dhASYP7k |
STACKING_CARDS |
Requires 3 images, 3 texts. |
REPEATING_TEXT |
Requires 3 images, 1 texts, for example https://www.youtube.com/embed/uhTjA8BeST8 |
NEWSFEED |
Requires 2 images, 4 texts, for example https://www.youtube.com/embed/FC6YU6x8gdY |
SLIDING_IMAGES |
Requires 7 images, 1 text, for example https://www.youtube.com/embed/ooKCu05A-J0 |
SLIDING_STRIPES |
Requires 3 images, 2 text, for example https://www.youtube.com/embed/VLxLN9tQM4U |
PRODUCT_CARDS |
Requires 6 images, 14 text, for example https://www.youtube.com/embed/n3GeQWkZJwM |
LIGHT_REVEAL |
Requires 3 image, 2 text, for example https://www.youtube.com/embed/DPJm5NQ48Ns |
SNAPSHOTS |
Requires 7 images, 6 text, for example https://www.youtube.com/embed/2xUC6N8nSHQ |
WIPING_BACKGROUND |
Requires 3 image, 3 text, for example https://www.youtube.com/embed/KE8TNDup0ow |
BOUNCING_WHEEL |
Requires 3 image, 3 text, for example https://www.youtube.com/embed/HCdEg0VLaXE |
CARD_TOWER_V |
Requires 5 image, 3 text. |
FLUID_LINES_H |
Requires 4 image, 3 text. |
SWIPE_GALLERY_H |
Requires 8 image, 5 text. |
PRODUCT_SCROLL_V |
Requires 6 image, 2 text. |
SLIDER_H |
Requires 4 image, 4 text. |
FLASH_REVEAL_V |
Requires 7 image, 4 text. |
SLIP_AND_SLIDE_V |
Requires 2 image, 2 text. |
SHREDDED_SLIDESHOW_H |
Requires 3 image, 2 text. |
UNFOLDING_STORY_H |
Requires 7 image, 2 text. |
VideoType
The type of video to generate.
Enums | |
---|---|
VIDEO_TYPE_UNSPECIFIED |
Unspecified video type. |
BRAND |
Tell the story of the brand from different perspective. |
DEAL |
Sales event to increase merchants’ visibility online |
CATEGORICAL |
Promote selected product collections. |
PRODUCT |
Demonstrate single products. |
InputImage
Represents an input image.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field image . The input image. image can be only one of the following: |
|
imageUri |
Public uri of the image. |
imageBytes |
Raw image bytes. A base64-encoded string. |
GenAiTemplate
Represents a GenAI video template for creating ~6s animations from still images and a prompt.
JSON representation |
---|
{ "theme": enum ( |
Fields | |
---|---|
theme |
Required. The theme of the video to generate. |
product |
Optional. The name of the product to generate the video for. Format: |
image |
Optional. The image to generate the video from. If not provided, the image will be fetched from the product automatically. |
VideoTheme
List of GenAI video transitions.
Enums | |
---|---|
VIDEO_THEME_UNSPECIFIED |
Unspecified video theme type. |
ZOOM_IN |
Zoom in the image. |
ZOOM_OUT |
Zoom out the image. |
CIRCULAR_DOLLY |
Circular dolly zoom. |
VideoConfig
Video configuration to be used for video generation. These are the parameters that merchant can set to customize the video generation.
JSON representation |
---|
{ "imageEditingOption": enum ( |
Fields | |
---|---|
imageEditingOption |
Optional. The image editing option for the video. If not provided, the image will be cropped to match the exact dimensions of the image slot. |
brandInfo |
Optional. Brand information to supplement the video generation for example brand name, logo, colors, font. If not provided, the brand information available in MC will be used. |
ImageEditingOption
The image editing options for the video.
Enums | |
---|---|
IMAGE_EDITING_OPTION_UNSPECIFIED |
Unspecified image editing option. |
ORIGINAL |
Preserve the image's original aspect ratio. |
CROPPING |
Crop the image to match the exact dimensions of the image slot. |
AUTO_EXPANSION_WITH_BLURRY_BACKGROUND |
Fit the entire image within the slot, expanding the image with a blur effect to fill any remaining space. |
BACKGROUND_REMOVAL |
Remove the background of the image. |
BrandInfo
Represents the brand information to be used in the video.
JSON representation |
---|
{
"brandColors": [
{
object ( |
Fields | |
---|---|
brandColors[] |
Optional. The colors of the brand to be used as the background of the video. If not provided, the brand colors available in MC are used. |
googleFontId |
Optional. The Google font id of the font in the video for example "Roboto". If not provided, the default font is used. |
business |
The name of the brand. Merchant name is used if this is not provided. |
logoLink |
The url of the brand logo. Merchant logo uploaded in the MC is used if this is not provided. If the logo in MC is not approved or uploaded, a transparent logo is used instead. |
Color
Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of java.awt.Color
in Java; it can also be trivially provided to UIColor's +colorWithRed:green:blue:alpha
method in iOS; and, with just a little work, it can be easily formatted into a CSS rgba()
string in JavaScript.
This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space.
When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5
.
Example (Java):
import com.google.type.Color;
// ...
public static java.awt.Color fromProto(Color protocolor) {
float alpha = protocolor.hasAlpha()
? protocolor.getAlpha().getValue()
: 1.0;
return new java.awt.Color(
protocolor.getRed(),
protocolor.getGreen(),
protocolor.getBlue(),
alpha);
}
public static Color toProto(java.awt.Color color) {
float red = (float) color.getRed();
float green = (float) color.getGreen();
float blue = (float) color.getBlue();
float denominator = 255.0;
Color.Builder resultBuilder =
Color
.newBuilder()
.setRed(red / denominator)
.setGreen(green / denominator)
.setBlue(blue / denominator);
int alpha = color.getAlpha();
if (alpha != 255) {
result.setAlpha(
FloatValue
.newBuilder()
.setValue(((float) alpha) / denominator)
.build());
}
return resultBuilder.build();
}
// ...
Example (iOS / Obj-C):
// ...
static UIColor* fromProto(Color* protocolor) {
float red = [protocolor red];
float green = [protocolor green];
float blue = [protocolor blue];
FloatValue* alpha_wrapper = [protocolor alpha];
float alpha = 1.0;
if (alpha_wrapper != nil) {
alpha = [alpha_wrapper value];
}
return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}
static Color* toProto(UIColor* color) {
CGFloat red, green, blue, alpha;
if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
return nil;
}
Color* result = [[Color alloc] init];
[result setRed:red];
[result setGreen:green];
[result setBlue:blue];
if (alpha <= 0.9999) {
[result setAlpha:floatWrapperWithValue(alpha)];
}
[result autorelease];
return result;
}
// ...
Example (JavaScript):
// ...
var protoToCssColor = function(rgb_color) {
var redFrac = rgb_color.red || 0.0;
var greenFrac = rgb_color.green || 0.0;
var blueFrac = rgb_color.blue || 0.0;
var red = Math.floor(redFrac * 255);
var green = Math.floor(greenFrac * 255);
var blue = Math.floor(blueFrac * 255);
if (!('alpha' in rgb_color)) {
return rgbToCssColor(red, green, blue);
}
var alphaFrac = rgb_color.alpha.value || 0.0;
var rgbParams = [red, green, blue].join(',');
return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};
var rgbToCssColor = function(red, green, blue) {
var rgbNumber = new Number((red << 16) | (green << 8) | blue);
var hexString = rgbNumber.toString(16);
var missingZeros = 6 - hexString.length;
var resultBuilder = ['#'];
for (var i = 0; i < missingZeros; i++) {
resultBuilder.push('0');
}
resultBuilder.push(hexString);
return resultBuilder.join('');
};
// ...
JSON representation |
---|
{ "red": number, "green": number, "blue": number, "alpha": number } |
Fields | |
---|---|
red |
The amount of red in the color as a value in the interval [0, 1]. |
green |
The amount of green in the color as a value in the interval [0, 1]. |
blue |
The amount of blue in the color as a value in the interval [0, 1]. |
alpha |
The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation:
This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0). |
VideoStatus
Represents the status of the video generation.
JSON representation |
---|
{ "status": string } |
Fields | |
---|---|
status |
Output only. The status of the video generation for example generating, ready, failed. |
Methods |
|
---|---|
|
Generates a video. |
|
Fetch video details such as serving url for a given video resource name. |
|
Lists all videos for a given account. |