Azure Media Service上传的视频资产,如何保证在Transfer编码后音频文件和视频文件不分成两个文件?保持在一个可以直接播放的MP4文件中呢?
Azure Media Service上提供的 Build-in Transform 生成的资产中,音频与视频分别存储在不同的文件中。通过自定义 StandardEncoderPreset 创建的 Transform 可以用来copy音视频到单个可以streaming播放的MP4文件。
{ "@odata.type": "#Microsoft.Media.StandardEncoderPreset", "codecs": [ { "@odata.type": "#Microsoft.Media.CopyVideo" }, { "@odata.type": "#Microsoft.Media.CopyAudio" } ], "formats": [ { "@odata.type": "#Microsoft.Media.Mp4Format", "filenamePattern": "{Basename}_{Bitrate}{Extension}" } ] }
az ams transform create --account-name <your media service name>--resource-group <your group name> --name transformname-copy-to-single-file --preset custom-preset.json
Media Services --> Transforms + jobs --> Create a job ...
az ams transform create :https://learn.microsoft.com/en-us/cli/azure/ams/transform?view=azure-cli-latest#az-ams-transform-create-examples
CopyVideo and CopyAudio : https://learn.microsoft.com/en-us/rest/api/media/transforms/create-or-update?tabs=HTTP#copyaudio