创建 CopyVideo CopyAudio 转换Create a CopyVideo CopyAudio transform

媒体服务徽标 v3media services logo v3


本文介绍如何创建 CopyVideo/CopyAudio 转换。This article shows how to create a CopyVideo/CopyAudio transform.

先决条件Prerequisites

按照创建媒体服务帐户中的步骤操作,创建所需的媒体服务帐户和资源组以创建资产。Follow the steps in Create a Media Services account to create the needed Media Services account and resource group to create an asset.

方法Methods

使用 REST APIUsing the REST API

使用以下 Azure REST 命令可将视频和音频从一个位置复制到另一个位置,而无需进一步编码。The following Azure REST command allows you to copy video and audio from one place to another without further encoding. subscriptionIDresourceGroupaccountName 值替换为当前正在使用的值。Replace the values subscriptionID, resourceGroup, and accountName with values you are currently working with. 通过设置 transformName 为转换命名。Give your transform a name by setting transformName.


PUT https://management.chinacloudapi.cn/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroup}}/providers/Microsoft.Media/mediaServices/{{accountName}}/transforms/{{transformName}}?api-version=2020-05-01

正文Body

{
    "properties": {
        "description": "Copy video and audio files with no encoding",
        "outputs": [
            {
                "onError": "StopProcessingJob",
                "relativePriority": "Normal",
                "preset": {
                    "@odata.type": "#Microsoft.Media.StandardEncoderPreset",
                    "codecs": [
                        {
                            "@odata.type": "#Microsoft.Media.CopyAudio"
                        },
                        {
                            "@odata.type": "#Microsoft.Media.CopyVideo"
                        }
                    ],
                    "formats": [
                        {
                            "@odata.type": "#Microsoft.Media.Mp4Format",
                            "filenamePattern": "{Basename}_Copy{Extension}"
                        }
                    ]
                }
            }
        ]
    }
}

示例响应Sample response

{
    "name": "aacaudio",
    "id": "/subscriptions/35c2594a-23da-4fce-b59c-f6fb9513eeeb/resourceGroups/inhenkelRG/providers/Microsoft.Media/mediaservices/inhenkel/transforms/aacaudio",
    "type": "Microsoft.Media/mediaservices/transforms",
    "properties": {
        "created": "2020-11-19T00:12:48.6001786Z",
        "description": "Copy audio files with no encoding",
        "lastModified": "2020-11-19T17:50:23.9602077Z",
        "outputs": [
            {
                "onError": "StopProcessingJob",
                "relativePriority": "Normal",
                "preset": {
                    "@odata.type": "#Microsoft.Media.StandardEncoderPreset",
                    "codecs": [
                        {
                            "@odata.type": "#Microsoft.Media.CopyAudio"
                        },
                        {
                            "@odata.type": "#Microsoft.Media.CopyVideo"
                        }
                    ],
                    "formats": [
                        {
                            "@odata.type": "#Microsoft.Media.Mp4Format",
                            "filenamePattern": "{Basename}_Copy{Extension}",
                            "outputFiles": []
                        }
                    ]
                }
            }
        ]
    }
}

后续步骤Next steps

有关创建转换的其他操作指南:Other how to guides for creating a transform: