Iteration Operations - Get Iteration
按 ID 提取迭代。
GET {endpoint}/videotranslation/translations/{translationId}/iterations/{iterationId}?api-version=2025-05-20
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string |
支持的认知服务终结点(协议和主机名,例如:https://eastus.api.cognitive.microsoft.com)。 |
iteration
|
path | True |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
迭代 ID |
translation
|
path | True |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
翻译资源 ID。 |
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
请求已成功。 |
|
Other Status Codes |
意外的错误响应。 标头 x-ms-error-code: string |
安全性
Ocp-Apim-Subscription-Key
在此处提供语音资源密钥。
类型:
apiKey
在:
header
AADToken
这些是 标识平台流Microsoft 。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
https://cognitiveservices.azure.com/.default |
示例
Get Iteration
示例请求
GET {endpoint}/videotranslation/translations/TranslateMyZhCNVideo/iterations/TranslateMyZhCNVideo-Iteration-1?api-version=2025-05-20
示例响应
{
"id": "TranslateMyZhCNVideo-Iteration-1",
"description": "Translate video from en-US to zh-CN, fix segment issue.",
"status": "Succeeded",
"createdDateTime": "2023-04-10T05:30:00.000Z",
"lastActionDateTime": "2023-04-10T05:15:30.000Z",
"input": {
"speakerCount": 3,
"subtitleMaxCharCountPerSegment": 60,
"enableVideoSpeedAdjustment": true,
"exportTargetLocaleAdvancedSubtitleFile": true,
"enableOcrCorrectionFromSubtitle": true,
"subtitlePrimaryColor": "ffffff",
"webvttFile": {
"url": "https://xxx.blob.core.windows.net/container1/myvtt.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx",
"kind": "MetadataJson"
}
},
"result": {
"translatedVideoFileUrl": "https://xxx.blob.core.windows.net/container1/video.mp4?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx",
"sourceLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/sourceLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx",
"targetLocaleSubtitleWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/targetLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx",
"metadataJsonWebvttFileUrl": "https://xxx.blob.core.windows.net/container1/metadataJsonLocale.vtt?sv=2023-01-03&st=2024-05-20T08%3A27%3A15Z&se=2024-05-21T08%3A27%3A15Z&sr=b&sp=r&sig=xxx"
}
}
定义
名称 | 说明 |
---|---|
Azure. |
错误对象。 |
Azure. |
包含错误详细信息的响应。 |
Azure. |
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors。 |
Enable |
启用情感平台语音类型。 |
Iteration |
执行一次迭代,将一个视频文件从源区域设置转换为目标区域设置,对于请求参数是可选的,用于内容编辑的 webvtt。 |
Iteration |
迭代输入。 |
Iteration |
迭代结果。 |
Status |
任务状态。 |
Webvtt |
翻译 Webvtt 文件。 |
Webvtt |
Webvtt 文件类型。 |
Azure.Core.Foundations.Error
错误对象。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的错误代码集之一。 |
details |
导致此报告错误的特定错误的详细信息数组。 |
|
innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
message |
string |
错误的人工可读表示形式。 |
target |
string |
错误的目标。 |
Azure.Core.Foundations.ErrorResponse
包含错误详细信息的响应。
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
Azure.Core.Foundations.InnerError
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的错误代码集之一。 |
innererror |
内部错误。 |
EnableEmotionalPlatformVoice
启用情感平台语音类型。
值 | 说明 |
---|---|
Auto |
让 API 决定是否为目标区域设置启用情感语音。 |
Disable |
禁用目标区域设置的平台语音情感。 |
Enable |
如果目标区域设置存在语音支持的情感,则强制启用情感语音。 |
Iteration
执行一次迭代,将一个视频文件从源区域设置转换为目标区域设置,对于请求参数是可选的,用于内容编辑的 webvtt。
名称 | 类型 | 说明 |
---|---|---|
createdDateTime |
string (date-time) |
创建对象的时间戳。 时间戳编码为 ISO 8601 日期和时间格式(“YYYY-MM-DDThh:mm:ssZ”,请参阅 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)。 |
description |
string |
迭代说明 |
failureReason |
string |
迭代失败原因 |
id |
string minLength: 3maxLength: 64 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$ |
迭代 ID |
input |
迭代输入。 |
|
lastActionDateTime |
string (date-time) |
输入当前状态时的时间戳。 时间戳编码为 ISO 8601 日期和时间格式(“YYYY-MM-DDThh:mm:ssZ”,请参阅 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)。 |
result |
迭代结果。 |
|
status |
迭代状态 |
IterationInput
迭代输入。
名称 | 类型 | 说明 |
---|---|---|
enableEmotionalPlatformVoice |
此参数指定是否为平台语音启用 emotion。 默认情况下,服务器根据目标区域设置确定是否应用情感以优化质量。 如果不指定,API 会自动决定是否在服务端开启情感表达。 |
|
enableOcrCorrectionFromSubtitle |
boolean |
指示是否允许 API 使用原始视频文件中的字幕更正语音识别 (SR) 结果。 通过利用现有的字幕,API 可以提高转录文本的准确性,确保最终输出更加精确可靠,如果未指定,翻译不会对 OCR 字幕进行更正。 |
enableVideoSpeedAdjustment |
boolean |
此参数允许调整视频播放速度,以确保更好地与翻译后的音频保持一致。 启用后,API 可以减慢或加快视频速度以匹配翻译音频的时间,从而提供更同步和无缝的观看体验,如果未指定,则不会调整视频速度。 |
exportSubtitleInVideo |
boolean |
导出视频中的字幕,如果未指定,它将继承在翻译创建的输入中定义的值。 |
exportTargetLocaleAdvancedSubtitleFile |
boolean |
启用此参数后,允许 API 以 Advanced SubStation Alpha 格式导出字幕。 字幕文件可以指定字体样式和颜色,这有助于解决某些目标区域设置(如阿拉伯语 (Ar)、日语 (Ja)、朝鲜语 (Ko) 和中文 (Ch))中的字符显示问题。 通过使用此参数,您可以确保字幕在视觉上具有吸引力,并在不同的语言和区域之间正确呈现,如果未指定,则迭代响应将不包含高级字幕。 |
speakerCount |
integer (int32) |
视频中的说话人数量(如果未指定),它将继承在翻译创建的输入中定义的值。 |
subtitleFontSize |
integer (int32) |
此参数指定视频翻译输出中字幕的字体大小,介于 5 到 30 之间,如果未指定,它将使用与语言相关的默认值。 |
subtitleMaxCharCountPerSegment |
integer (int32) |
每个句段的字幕最大显示字符数,如果未指定,它将继承在翻译创建的输入中定义的值。 |
subtitleOutlineColor |
string minLength: 6maxLength: 9 pattern: ^#?(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$ |
此参数指定视频翻译输出中字幕的轮廓颜色。 该值应以 、 # 或 # 格式提供,其中表示颜色的红色分量,表示绿色分量,表示蓝色分量,表示 alpha 分量。 例如,EBA205 或 #EBA205 会将字幕颜色设置为特定的黄色阴影。 此参数允许自定义字幕外观以增强可读性和视觉吸引力,如果未指定,它将使用默认的黑色。 |
subtitlePrimaryColor |
string minLength: 6maxLength: 9 pattern: ^#?(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$ |
此参数指定视频翻译输出中字幕的主色。 该值应以 、 # 或 # 格式提供,其中表示颜色的红色分量,表示绿色分量,表示蓝色分量,表示 alpha 分量。 例如,EBA205 或 #EBA205 会将字幕颜色设置为特定的黄色阴影。 此参数允许自定义字幕外观以增强可读性和视觉吸引力,如果未指定,它将使用默认的白色。 |
ttsCustomLexiconFileIdInAudioContentCreation |
string pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ |
使用 TTS 自定义词典进行语音合成翻译。 使用 ttsCustomLexiconFileUrl 或 ttsCustomLexiconFileIdInAudioContentCreation 提供自定义词典文件。 这些参数是互斥的,只需要其中一个参数。 如果同时提供两者,则请求将被视为无效。 |
ttsCustomLexiconFileUrl |
string (uri) |
使用 TTS 自定义词典进行语音合成翻译。 使用 ttsCustomLexiconFileUrl 或 ttsCustomLexiconFileIdInAudioContentCreation 提供自定义词典文件。 这些参数是互斥的,只需要其中一个参数。 如果同时提供两者,则请求将被视为无效。 |
webvttFile |
Webvtt 文件进行内容编辑,这是翻译的第二次迭代创建请求所必需的。 |
IterationResult
迭代结果。
名称 | 类型 | 说明 |
---|---|---|
metadataJsonWebvttFileUrl |
string (uri) |
元数据 json webvtt 文件 URL。 |
reportFileUrl |
string (uri) |
报告文件 URL。 |
sourceLocaleSubtitleWebvttFileUrl |
string (uri) |
源区域设置字幕文件 URL。 |
targetLocaleAdvancedSubtitleFileUrl |
string (uri) |
此属性提供目标区域设置 Advanced SubStation Alpha (ASS) 字幕文件的 URL。 只有在迭代创建期间将 exportTargetLocaleAdvancedSubtitleFile 设置为 true 时,才会填充它;否则,此属性将不会包含在响应中。 |
targetLocaleSubtitleWebvttFileUrl |
string (uri) |
目标区域设置字幕文件 URL。 |
translatedAudioFileUrl |
string (uri) |
已翻译的音频文件 URL。 |
translatedVideoFileUrl |
string (uri) |
已翻译的视频文件 URL。 |
Status
任务状态。
值 | 说明 |
---|---|
Canceled |
已取消状态 |
Failed |
运行失败状态 |
NotStarted |
未启动状态 |
Running |
运行状态 |
Succeeded |
运行成功状态 |
WebvttFile
翻译 Webvtt 文件。
名称 | 类型 | 说明 |
---|---|---|
kind |
翻译 Webvtt 文件类型。 |
|
url |
string (uri) |
翻译 Webvtt 文件 URL。 |
WebvttFileKind
Webvtt 文件类型。
值 | 说明 |
---|---|
MetadataJson |
目标区域设置元数据 JSON webvtt 文件 |
SourceLocaleSubtitle |
源区域设置纯文本字幕 webvtt 文件 |
TargetLocaleSubtitle |
目标区域设置纯文本字幕 webvtt 文件 |