

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 为视频创建蓝图
<a name="creating-blueprint-video"></a>

与其他蓝图相比，视频文件的蓝图具备一些独有特性，尤其是在字段创建方面。视频蓝图有一个名为“粒度”的参数，用于将字段设置为“视频”或“章节”。当字段设置为“视频”时，将对整个视频进行检测。例如，如果您想要整个视频片段的摘要，则需要将该字段的粒度设置为“视频”。

将粒度设置为“章节”则会为视频的每个章节返回响应。该字段将为每个视频章节返回一个值。还是使用前面的示例，如果您想获取视频每个部分的摘要，则可以将粒度设置为“章节”。

创建章节粒度字段时，您可以设置唯一的数据类型，即实体数组。例如，如果您要检测视频中显眼的物体，可以创建一个名为 `key-visual-objects` 的字段，并将其类型设置为实体数组。然后，此字段将返回数组对象中实体的名称。

以下是用于视频处理的一些字段示例。视频蓝图中的所有字段均被视为推断字段，实体和实体数组字段除外。

## 用于媒体搜索的蓝图字段示例
<a name="example-video-fields-search"></a>


|  |  |  |  |  | 
| --- |--- |--- |--- |--- |
| 字段 | 说明 | 提取类型 | 类型 | 粒度 | 
| key-visual-objects | Please detect all the visually prominent objects in the video | extractive | Array of entities | [ "chapter" ] | 
| keywords | Searchable terms that capture key themes, cast, plot elements, and notable aspects of TV shows and movies to enhance content discovery. | inferred | Array of strings | ["video"] | 
| genre | The genre of the content. | inferred | string | ["video"] | 
| video-type | Identify the type of video content | inferred | enums: ["Movie", "TV series", "News", "Others"] | [ "video" ] | 

## 主题演讲要点的蓝图字段示例
<a name="example-video-fields-keynote"></a>


|  |  |  |  |  | 
| --- |--- |--- |--- |--- |
| 字段 | 说明 | 提取类型 | 类型 | 粒度 | 
| broadcast-setting | The physical setting or environment where the broadcast or training session is taking place. | inferred | enums["conference hall", "classroom", "outdoor venue", "Others", "Not applicable to the video"] | [ "video" ] | 
| broadcast-audience-engagement | The level of engagement or interaction between the speakers and the audience. | inferred | enums["interactive", "passive", "Not applicable to the video"] | ["video"] | 
| broadcast-visual-aids | A list of notable visual aids or materials used during the presentation, such as slides, diagrams, or demonstrations. | inferred | Array of strings | ["video"] | 
| broadcast-audience-size | The size of the audience present at the event. | inferred | enums["large crowd", "medium crowd", "small group", "Not applicable to this video"] | [ "chapter" ] | 
| broadcast-presentation-topics | A list of key topics, subjects, or themes covered in the presentation or training session. | inferred | enums: ["Movie", "TV series", "News", "Others"] | [ "video" ] | 

## 用于广告分析的蓝图字段示例
<a name="example-video-fields-ad"></a>


|  |  |  |  |  | 
| --- |--- |--- |--- |--- |
| 字段 | 说明 | 提取类型 | 类型 | 粒度 | 
| ads-video-ad-categories | The ad categories for the video | inferred | enums["Health and Beauty", "Weight Loss", "Food and Beverage", "Restaurants", "Political", "Cryptocurrencies and NFT", "Money Lending and Finance", "Tobacco", "Other", "Video is not an advertisement"] | [ "video" ] | 
| ads-video-language | The primary language of the advertisement | inferred | string | ["video"] | 
| ads-video-primary-brand | The main brand or company being advertised in the video. | inferred | string | ["video"] | 
| ads-video-main-message | The primary message or tagline conveyed in the advertisement | inferred | string | [ "video" ] | 
| ads-video-message-clarity | How clear and understandable the main message of the advertisement is | inferred | enums: ["clear", "ambiguous", "Not applicable to the video"] | [ "video" ] | 
| ads-video-target-audience-interests | Specific interests or hobbies that the target audience is likely to have | inferred | Array of strings | [ "video" ] | 
| ads-video-product-type | The category or type of product being advertised | inferred | enums: ["electronics", "apparel", "food\$1and\$1beverage", "automotive", "home\$1appliances", "other", "Not applicable to the video"] | [ "video" ] | 
| ads-video-product-placement | The way the product is positioned or showcased in the advertisement | inferred | enums: ["front\$1and\$1center", "background", "held\$1by\$1person", "other", "Not applicable to the video"] | [ "video" ] | 
| ads-video-product-features | The key features or specifications of the advertised product highlighted in the video | inferred | Array of strings | [ "video" ] | 
| ads-video-number-of-products | The number of distinct products or variations featured in the advertisement | inferred | number | [ "video" ] | 

视频还支持实体数组类型，这有助于在视频内容中识别和定位特定实体。此功能返回一个由检测到的实体组成的数组。以下是客户蓝图中实体数组的示例：

```
  "field_name": {
        "items": {
            "$ref": "bedrock-data-automation#/definitions/Entity"
        },
        "type": "array",
        "instruction": "Please detect all the visually prominent objects in the video",
        "granularity": [
            "chapter"
        ]
    }
```

**注意**  
`bedrock-data-automation#/definitions/Entity` 是 BDA 拥有的服务类型。您可以使用以下架构解析结果。

```
       {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "$id": "bedrock-data-automation",
        "type": "object",
        "definitions": {
            "BoundingBox": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "left": {
                        "type": "number"
                    },
                    "top": {
                        "type": "number"
                    },
                    "width": {
                        "type": "number"
                    },
                    "height": {
                        "type": "number"
                    }
                }
            },
            "Entity": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "label": {
                        "type": "string"
                    },
                    "bounding_box": {
                        "$ref": "bedrock-data-automation#/definitions/BoundingBox"
                    },
                    "confidence": {
                        "type": "number"
                    }
                }
            }
        },
        "properties": {}
    }
```