从已启用存储加密的现有blob复制的资产:编码失败

时间:2015-12-02 05:50:47

标签: azure azure-media-services

我成功地将现有blob应对到媒体服务资产,并且能够执行编码任务。

当我启用存储加密复制资产时,情况发生了变化。此资产的编码任务失败,并显示消息“使用H264自适应比特率MP4设置720p进行存储加密的Azure媒体编码 UserInput:不支持文件类型或编解码器。“

                IAsset asset = mediaContext.Assets.Create("NewAsset_" + Guid.NewGuid(), AssetCreationOptions.StorageEncrypted);

1 个答案:

答案 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();

我认为问题不在于存储加密,而在于:

  • 使用不受支持的编解码器的媒体。如果您还没有,您可以尝试对其进行编码而不加密(您可以使用Azure Media Service Explorer进行快速测试:https://github.com/Azure/Azure-Media-Services-Explorer
  • 另一个常见错误是在名称中创建没有扩展名的资产文件。 Azure Media Encoder要求该文件具有有效的扩展名。我在没有有效扩展名的文件上收到此错误消息。

希望这有助于解决您的问题。

于连