我成功地将现有blob应对到媒体服务资产,并且能够执行编码任务。
当我启用存储加密复制资产时,情况发生了变化。此资产的编码任务失败,并显示消息“使用H264自适应比特率MP4设置720p进行存储加密的Azure媒体编码 UserInput:不支持文件类型或编解码器。“
IAsset asset = mediaContext.Assets.Create("NewAsset_" + Guid.NewGuid(), AssetCreationOptions.StorageEncrypted);
答案 0 :(得分:2)
以下是您尝试执行的操作示例:
string mediaservicename = "your_media_service_name";
string mediaservicekey = "your_media_service_key";
// create the cloud media context
var mediaServiceContext = new CloudMediaContext(mediaservicename, mediaservicekey);
// create an encrypted asset
var asset = mediaServiceContext.Assets.Create("MyAsset_" + Guid.NewGuid(), AssetCreationOptions.StorageEncrypted);
// create the asset file and upload it from a local path
var assetFile = asset.AssetFiles.Create("BigBuckBunny_320x180.mp4");
assetFile.Upload(@"C:\Users\jucoriol\Desktop\BigBuckBunny_320x180.mp4");
// create the encoding job with a single task
var encodingJob = mediaServiceContext.Jobs.CreateWithSingleTask(
"Azure Media Encoder",
"H264 Adaptive Bitrate MP4 Set 720p",
asset,
"Big Bunny Adaptive 720p",
AssetCreationOptions.StorageEncrypted);
// submit the job
encodingJob.Submit();
Console.ReadLine();
我认为问题不在于存储加密,而在于:
希望这有助于解决您的问题。
于连