本文档是 Microsoft Foundry(Azure OpenAI)关于 Sora 2 视频生成模型的官方技术文档。内容涵盖模型能力(文本/图像/视频生成视频、音频生成、Remix 功能)、模型详细信息、快速入门步骤(门户部署与 Python 代码示例)、负责任 AI 内容限制、Sora 2 API 五个端点及参数说明、图像参考与视频混合生成的代码示例、提示最佳实践,以及技术限制(分辨率、时长、并发与保留期等)。
Sora 2 is an AI video generation model from OpenAI, now accessible through Azure OpenAI Service and Microsoft Foundry in preview. It creates realistic and imaginative video scenes from text descriptions and/or input images or videos, producing a wide range of content including lifelike scenes, animation, and special effects across multiple resolutions and durations. Developers can integrate it into applications using the v1 API, which aligns with OpenAI's native Sora 2 architecture.
“ Key Capabilities
Sora 2 supports three generation modes: text-to-video, image-to-video, and video-to-video (generation followed by transformation). It can generate audio within output videos, similar to the Sora app experience. Its Remix feature allows targeted adjustments to an existing video rather than regenerating it from scratch, preserving structure, motion, and framing while applying requested changes. Azure also applies built-in responsible AI protections, input and output moderation, content filtering, and abuse monitoring to all image and video generation models.
“ Model Details and Specifications
Sora 2 uses the Azure OpenAI v1 API and offers enhanced realism, physical consistency, and temporal coherence. Billing is calculated per second of generated video. The model supports text-to-video, image-to-video, and video-to-video modes, along with audio generation and Remix functionality. Output resolutions include 480x480, 480x854, 854x480, 720x720, 720x1280, 1280x720, 1080x1080, 1080x1920, and 1920x1080, with video lengths from 1 to 20 seconds.
“ Quickstart: Generating Your First Video
To get started, you need an Azure subscription and an Azure OpenAI resource in a supported region. Sign in to Microsoft Foundry, create or select a project, navigate to 'Models + endpoints', deploy the Sora 2 video generation model, and open it in the playground. Enter a text prompt and select Generate; generation typically takes 1 to 5 minutes. The playground also provides pre-filled Python and cURL code samples that can be reused in applications. When finished, clean up resources by deleting any deployed models and then the Azure OpenAI resource.
“ Asynchronous Job Creation and Status Polling
Video generation is asynchronous. Using the OpenAI Python client (upgrade with `pip install openai --upgrade`), call `client.videos.create()` with a model deployment name and prompt to receive a job ID. Poll the job with `client.videos.retrieve(video.id)` until its status is `completed`, `failed`, or `cancelled`. Expected intermediate statuses include `queued` and `in_progress`. Authentication can use Microsoft Entra ID via `DefaultAzureCredential`, an API key, or environment variables. Asynchronous clients with `create_and_poll` are also available, and synchronous polling is recommended in Jupyter notebooks.
“ Using Reference Images and Video Remix
The `input_reference` parameter accepts a single image (JPEG, PNG, or WebP) that serves as the visual anchor for the first frame; the image's resolution must exactly match the output size (720x1280 or 1280x720). It can be supplied as a local file or via a URL. The `remix_video_id` parameter references a previously completed video ID so that its structure, motion, and framing are reused while applying a new prompt. For best results, limit remix edits to one clear, specific adjustment, such as shifting the color palette, since narrow edits preserve source fidelity and reduce visual artifacts.
“ Sora 2 API Reference and Parameters
The Sora 2 API exposes five endpoints: create a video (start a render job from a prompt with optional reference input or remix ID), get video status (monitor progress), download video (retrieve the completed MP4), list videos (paginated enumeration for history or dashboards), and delete video (remove a video ID from storage). Key parameters are: `prompt` (required natural-language description including shot type, subject, action, setting, lighting, and camera motion; keep it single-purpose), `model` (default `sora-2`), `size` (portrait 720x1280 or landscape 1280x720; default 720x1280), `seconds` (4, 8, or 12; default 4), `input_reference` (optional single reference image), and `remix_video_id` (optional prior video ID).
“ Prompt Best Practices
Write prompts in English or other Latin-script languages for optimal performance. Be explicit about shot type, subject, action, setting, lighting, and any desired camera movement to reduce ambiguity. Keep each prompt focused on a single scene or purpose for better adherence. Ensure prompts, reference images, and transcripts comply with content rules to avoid generation failures.
“ Responsible AI and Content Restrictions
Sora 2 includes built-in responsible AI protections and enforces several content restrictions: content is limited to audiences aged 18 and above (a setting to bypass this is planned for the future), copyrighted characters and copyrighted music are rejected, real people including public figures cannot be generated, and input images containing human faces are currently refused. Output content is filtered through Azure's content moderation and abuse monitoring systems, and generations that Azure OpenAI identifies as harmful will not be returned.
“ Technical Limitations and Considerations
Sora 2 currently has content-quality limitations: it may struggle with complex physical phenomena, cause-and-effect relationships (such as bite marks on a cookie), spatial reasoning (such as distinguishing left from right), and precise time-based event ordering such as camera motion. Technical limits in the preview include: up to two video variants per job at 720p (variants are disabled at 1080p and up to four at other resolutions), no more than two concurrent video creation jobs, job availability for 24 hours after creation, up to two images as input (with generated video interpolating between them), and up to one 5-second video as input.
We use cookies that are essential for our site to work. To improve our site, we would like to use additional cookies to help us understand how visitors use it, measure traffic to our site from social media platforms and to personalise your experience. Some of the cookies that we use are provided by third parties. To accept all cookies click ‘Accept’. To reject all optional cookies click ‘Reject’.
Comment(0)