AI 服務暫時不可用,以下為來源正文,待恢復後補全翻譯。
On Oct 9, 2026 we announced the availability of TwelveLabs’ Pegasus 1.5 on Amazon Bedrock. Pegasus 1.5 is a video language model that turns long-form video into structured, timestamped metadata. You describe the moments that matter to your workflow, and the model returns every matching segment as JSON. Video represents a significant and complex category of unstructured data, yet most of it remains unsearchable and underutilized. Extracting structured, actionable insights from that content has historically required labor-intensive manual review or fragmented toolchains. With earlier versions of Pegasus, you can point the model at a clip, ask a question, and get an answer. Now, Pegasus 1.5 analyzes the entire video, finds every segment that matches user-defined criteria, and returns structured, timestamped metadata. It also introduces video segmentation, multimodal prompting with reference images, and on-the-fly processing. With Pegasus 1.5 on Amazon Bedrock, you can analyze videos directly from an Amazon Simple Storage Service (Amazon S3) URI or a base64 string with no pre-indexing required, and your data remains within the AWS data boundary. In this post, we cover what’s new in Pegasus 1.5, how the model is packaged on Amazon Bedrock, and how to send your first request. We then walk through video segmentation, structured JSON output, and multimodal prompting. What’s new in Pegasus 1.5 Pegasus 1.5 has the following changes compared to previous versions: Time-based metadata generation. You define the segments, events, or domain-specific cues that matter to your workflow, such as editorial segments, sports plays, speaker changes, or brand appearances. Pegasus 1.5 returns every matching segment as JSON, with start and end times and the requested fields populated. Multimodal prompting. A segment definition can combine a text description with a visual reference. This makes it possible to locate a specific product, logo, or person, along with what they are doing on screen. On-the-fly processing. No ingestion pipeline or pre-indexing step is required. Videos are sent directly from Amazon S3 and results are returned in the response. Extended processing capacity. Pegasus 1.5 analyzes videos up to two hours long in a single request, up from one hour in Pegasus 1.2. Pegasus 1.5 retains and enhances the core capabilities that made Pegasus 1.2 a powerful tool for video understanding, including: Video-to-text generation: Creates detailed textual descriptions based on video content. Granular visual comprehension: Analyzes objects, on-screen text, and numerical content within video frames. Temporal grounding: Accurately identifies timestamps of specific events within videos. Multimodal understanding: Combines visual, audio, and textual information for comprehensive analysis. Multilingual support: Full support for English, with partial support for Arabic, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Russian, Spanish, Thai, and Vietnamese. How Pegasus 1.5 works on Amazon Bedrock Pegasus 1.5 takes a video and either a text prompt or a set of segment definitions, and returns text or JSON. You call it on the bedrock-runtime endpoint with the InvokeModel API, or with InvokeModelWithResponseStream when you want the response streamed as it’s generated. Setting Value Model ID twelvelabs.pegasus-1-5-v1:0 AWS Region US West (Oregon), us-west-2 Inference On-demand APIs InvokeModel, InvokeModelWithResponseStream Each request runs in one of two analysis modes, chosen with the analysisMode field: Analysis mode analysisMode You send You get back General general (default) A text prompt in inputPrompt A text answer in message, or JSON when you supply a schema Time-based metadata time_based_metadata Segment definitions in responseFormat A segments list with start and end times and the fields you asked for You can point the model at video in two ways. An S3 location (s3Location) takes the object’s uri and the bucketOwner account ID, and suits long-form video. A base64 string (base64String) embeds the video in the request body, up to 25 MB, and suits short clips. To track cost by application, create an application inference profile from the Pegasus 1.5 model, tag it, and call it by its Amazon Resource Name (ARN) in place of the model ID. Getting started with Pegasus 1.5 The following section outlines how to get started with Pegasus 1.5. Prerequisites Before you begin, make sure you have: An active AWS account with Amazon Bedrock access. Python 3.10 or later, with the AWS SDK for Python (Boto3) installed. AWS Identity and Access Management (IAM) permissions for bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream. Model access enabled for TwelveLabs Pegasus 1.5 in the Amazon Bedrock console. Videos stored in an Amazon S3 bucket, or short clips you can send inline. The following policy grants both invoke actions on Pegasus 1.5. { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "bedrock:InvokeModel", "bedrock:InvokeModelWithResponseStream" ], "Resource": [ "arn:aws:bedrock:us-west-2::foundation-model/twelvelabs.pegasus-1-5-v1:0" ] } ] } Boto3 signs requests with your usual AWS credentials. You can also authenticate with an Amazon Bedrock API key by setting it in the AWS_BEARER_TOKEN_BEDROCK environment variable. For production, prefer a short-term key generated from your IAM credentials with the aws-bedrock-token-generator package, because it expires automatically. Bearer-token authentication also requires the bedrock:CallWithBearerToken permission. Send your first request Install Boto3: pip install boto3 The following example analyzes a video stored in Amazon S3 in general mode. This example uses the global Cross Region Inference (CRIS) endpoint. To target the US geographic endpoint instead, replace “global.” with “us.” in the endpoint URL. import boto3 import json from botocore.config import Config AWS_REGION = "us-west-2" MODEL_ID = "global.twelvelabs.pegasus-1-5-v1:0" bedrock_runtime = boto3.client( service_name="bedrock-runtime", region_name=AWS_REGION, config=Config( # keep a longer read_timeout for lengthier invocations such as video segmentation read_timeout=900, retries={"max_attempts": 0}, connect_timeout=10, ), ) # Analyze a video stored in Amazon S3 payload = { "inputPrompt": "Summarize this video and identify the key topics discussed.", "mediaSource": { "s3Location": { "uri": "s3://amzn-s3-demo-pegasus-15/your-video.mp4", "bucketOwner": "your-account-id" } }, "temperature": 0.2, "maxOutputTokens": 4096, "includeMetering": True } response = bedrock_runtime.invoke_model( modelId=MODEL_ID, body=json.dumps(payload) ) result = json.loads(response["body"].read()) print(result["message"]) The response carries the answer in message, the token counts in input_tokens and output_tokens, and the reason generation ended in stopReason. A stopReason of length means the answer reached maxOutputTokens before it finished, so check it before you rely on the output: if result["stopReason"] == "length": print("The answer was cut off. Raise maxOutputTokens and try again.") print("Tokens in:", result["input_tokens"], "out:", result["output_tokens"]) Request fields for general mode: Field Required Description inputPrompt Yes The question or instruction about the video mediaSource.s3Location.uri One video source is required S3 URI of the video mediaSource.s3Location.bucketOwner With uri AWS account ID that owns the bucket mediaSource.base64String One video source is required Base64-encoded video, up to 25 MB temperature No Randomness of the output, from 0 to 1. Default 0.2 maxOutputTokens No Maximum tokens to generate, from 512 to 98,304 responseFormat No A JSON Schema the answer must follow analysisMode No general (default) or time_based_metadata For a short clip, you can send the video inline instead of from S3: import base64 with open("your-video.mp4", "rb") as f: video_b64 = base64.b64encode(f.read()).decode("utf-8") payload["mediaSource"] = {"base64String": video_b64} response = bedrock_runtime.invoke_model(modelId=MODEL_ID, body=json.dumps(payload)) print(json.loads(response["body"].read())["message"]) Note that the preceding example uses the optional includeMetering attribute. includeMetering: True makes Pegasus 1.5 add two billing-usage fields to the non-streaming response: outputTokenCount and inputVideoSecond (the analyzed video’s duration in seconds). Stream the response For interactive applications, InvokeModelWithResponseStream returns the answer in chunks as it’s generated. Each chunk carries the next piece of text in message: response = bedrock_runtime.invoke_model_with_response_stream( modelId=MODEL_ID, body=json.dumps(payload) ) for event in response["body"]: chunk = json.loads(event["chunk"]["bytes"]) print(chunk.get("message", ""), end="", flush=True) print() Return structured JSON In general mode, you can constrain the answer to a JSON Schema so downstream code can parse it directly. Set responseFormat.type to json_schema and put the schema under jsonSchema. The answer arrives in message as a JSON string: payload = { "inputPrompt": "Analyze this video and return a structured summary.", "mediaSource": { "s3Location": { "uri": "s3://amzn-s3-demo-pegasus-15/your-video.mp4", "bucketOwner": "your-account-id" } }, "temperature": 0, "maxOutputTokens": 2048, "includeMetering": True, "responseFormat": { "type": "json_schema", "jsonSchema": { "type": "object", "properties": { "summary": {"type": "string"}, "key_scenes": {"type": "array", "items": {"type": "string"}}, "setting": {"type": "string"} }, "required": ["summary", "key_scenes", "setting"] } } } response = bedrock_runtime.invoke_model(modelId=MODEL_ID, body=json.dumps(payload)) summary = json.loads(json.loads(response["body"].read())["message"]) print(summary["summary"]) for scene in summary["key_scenes"]: print(" -", scene) Video segmentation: Turning video into structured data Time-based metadata generation is where Pegasus 1.5 differs most from earlier versions. Instead of a prompt, you send one or more segment definitions, and the model returns every segment of the video that matches each one. Set analysisMode to time_based_metadata and responseFormat.type to segment_definitions. The definitions take the place of inputPrompt, so leave that field out. Each definition has: id: a name for the definition, returned on every segment it matches. description: what a matching segment looks like. fields: the values to extract for each segment, each with a name, a type (string, boolean, number, integer, array, or timestamp), and a description. The following example identifies each editorial section in a news broadcast and returns a title, summary, and key topics for each one: payload = { "analysisMode": "time_based_metadata", "mediaSource": { "s3Location": { "uri": "s3://amzn-s3-demo-pegasus-15/news-broadcast.mp4", "bucketOwner": "your-account-id" } }, "responseFormat": { "type": "segment_definitions", "segmentTimeFormat": "hh:mm:ss", "segmentDefinitions": [ { "id": "editorial_section", "description": "A distinct editorial section of the broadcast, " "such as a new story, topic, or segment of the program.", "fields": [ {"name": "segment_title", "type": "string", "description": "A descriptive title"}, {"name": "summary", "type": "string", "description": "A brief summary of the segment content"}, {"name": "key_topics", "type": "array", "items": {"type": "string"}, "description": "Main topics discussed"} ] } ] }, "temperature": 0, "maxOutputTokens": 32768, "includeMetering": True } response = bedrock_runtime.invoke_model( modelId=MODEL_ID, contentType="application/json", accept="application/json", body=json.dumps(payload) ) result = json.loads(response["body"].read()) for segment in result["segments"]: print(segment["start_sec"], "-", segment["end_sec"], segment["segment_title"]) print(" ", segment[" [truncated for AI cost control]