简体   繁体   English

无法在Azure Media Services中发布编码的资产

[英]Cannot Publish Encoded Asset in Azure Media Services

I'm having a problem publishing an encoded asset in Azure Media Services. 我在Azure媒体服务中发布编码资产时遇到问题。

I can see that my asset is being created and encoded because it displays in my Media Services account but the "publish" functionality fails. 我可以看到我的资产正在创建和编码,因为它显示在我的媒体服务帐户中,但是“发布”功能失败。 I can successfully publish any asset that is created and encoded by my application, by hitting the publish button in the portal. 通过单击门户中的“发布”按钮,我可以成功发布由我的应用程序创建和编码的任何资产。 However, I need to be able to do it programmatically. 但是,我需要能够以编程方式进行操作。 This is my method. 这是我的方法。 I don't get any errors... 我没有任何错误...

   `private static IAsset PublishAsset(IJob job)
    {
        var preparedAsset = job.OutputMediaAssets.FirstOrDefault();
        var ismAssetFiles = preparedAsset.AssetFiles.ToList().
          Where(f => f.Name.EndsWith(".ism", StringComparison.OrdinalIgnoreCase))
          .ToArray();

        ismAssetFiles.First().IsPrimary = true;
        ismAssetFiles.First().Update();
        return preparedAsset;

    }`

Can anyone see what I'm doing wrong? 谁能看到我在做什么错?

The pasted code does not publish the asset but only mark the .ism file as primary file in the asset. 粘贴的代码不会发布资产,而只会将.ism文件标记为资产中的主文件。

To publish the asset, you should create an access locator as explained here: https://azure.microsoft.com/en-us/documentation/articles/media-services-dotnet-get-started/#publish-the-asset-and-get-urls-for-streaming-and-progressive-download 要发布资产,您应该按照以下说明创建访问定位器: https : //azure.microsoft.com/zh-cn/documentation/articles/media-services-dotnet-get-started/#publish-the-asset-并获取用于流式传输和渐进式下载的网址

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM