Logo for AiToolGo

Sora 2 视频生成概述(预览版)

In-depth discussion
Technical
 0
 0
 5
本文档是 Microsoft Foundry(Azure OpenAI)关于 Sora 2 视频生成模型的官方技术文档。内容涵盖模型能力(文本/图像/视频生成视频、音频生成、Remix 功能)、模型详细信息、快速入门步骤(门户部署与 Python 代码示例)、负责任 AI 内容限制、Sora 2 API 五个端点及参数说明、图像参考与视频混合生成的代码示例、提示最佳实践,以及技术限制(分辨率、时长、并发与保留期等)。
  • main points
  • unique insights
  • practical applications
  • key topics
  • key insights
  • learning outcomes
  • • main points

    • 1
      结构完整,从能力概述、快速入门到 API 参数与代码示例形成完整学习路径
    • 2
      提供同步与异步、Entra ID 与 API 密钥等多种认证方式的可直接运行代码
    • 3
      明确列出内容限制、技术限制与分辨率等约束,便于开发者提前规避生成失败
  • • unique insights

    • 1
      Remix 功能通过窄而精确的编辑保留源视频保真度,是区别于重新生成的实用技巧
    • 2
      异步任务轮询需区分 Jupyter Notebook 环境,避免 asyncio 事件循环冲突的实际踩坑提示
  • • practical applications

    • 对希望在 Azure 上集成视频生成能力的开发者和产品团队具有直接操作价值,可依据文档完成部署、调用、轮询、下载与二次编辑的全流程实现。
  • • key topics

    • 1
      Sora 2 模型能力与支持的生成形式(文本/图像/视频到视频)
    • 2
      通过 Foundry 门户与 Python SDK 部署并调用视频生成 API
    • 3
      视频生成异步作业的状态轮询、下载与 Remix 编辑
  • • key insights

    • 1
      提供基于 Azure OpenAI v1 API 的 Sora 2 端到端集成方案,兼顾企业级认证与负责任 AI 保护
    • 2
      对内容限制与技术限制给出清晰边界说明,降低生成失败与合规风险
    • 3
      包含同步、异步及多种输入参考方式的代码模板,可快速转化为生产应用
  • • learning outcomes

    • 1
      能够在 Microsoft Foundry 中部署 Sora 2 模型并通过 Python SDK 发起视频生成请求
    • 2
      掌握视频生成异步作业的状态轮询、结果下载及图像/视频参考输入的使用方法
    • 3
      理解 Sora 2 的内容限制与技术约束,并能据此编写合规、可成功生成的提示词
examples
tutorials
code samples
visuals
fundamentals
advanced content
practical tips
best practices

“ Introduction to Sora 2 on Azure

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.

 Original link: https://learn.microsoft.com/zh-cn/azure/foundry/openai/concepts/video-generation

Comment(0)

user's avatar

      Related Tools