获取RequestEntityTooLarge异常

时间:2017-09-04 11:48:16

标签: asp.net azure azure-media-services

我正在使用带有asp.net c#应用程序的Azure媒体服务来连接资产中的媒体剪辑并为此创建新工作。

当我连接10个或更少时,然后剪辑合并为单个剪辑(我正在使用azure发布的一个Feed创建亮点,持续时间为1分钟的差异点。),它工作正常,我得到一个完美的剪辑后合并它们。

当我增加号码时剪辑到10以上,我在job.submit()方法上得到异常(RequestEntityTooLarge)。以下是我的代码。

public string LaunchJobs_OneJobPerInputAsset_OneTaskPerfConfig(CloudMediaContext _context, IMediaProcessor processor, List<IAsset> selectedassets, string jobname, int jobpriority, string taskname, string outputassetname, List<ClipConfig> configuration, AssetCreationOptions myAssetCreationOptions, TaskOptions myTaskOptions, string storageaccountname = "")
    {
        string assetJobId = "";
        string tasknameloc = "";
        int count = 0;
        outputAssetsList = new List<IAsset>();
        // a job per asset, one task per config
        foreach (IAsset asset in selectedassets)
        {
            string jobnameloc = jobname.Replace(Constants.NameconvInputasset, asset.Name);
            IJob myJob = _context.Jobs.Create(jobnameloc, jobpriority);

            _contextGlobal = _context;

            foreach (var config in configuration)
            {
                if (config.PublishUrl.Contains(asset.Locators.SingleOrDefault().Path))
                {
                    tasknameloc = taskname.Replace(Constants.NameconvInputasset, asset.Name).Replace(Constants.NameconvAMEpreset, config.Configuration);
                    ITask myTask = myJob.Tasks.AddNew(
                           tasknameloc,
                          processor,
                          config.Configuration,
                          myTaskOptions);

                    myTask.InputAssets.Add(asset);

                    // Add an output asset to contain the results of the task
                    string outputassetnameloc = outputassetname.Replace(Constants.NameconvInputasset, asset.Name).Replace(Constants.NameconvAMEpreset, config.Configuration);
                    outputassetnameloc = outputassetnameloc + '_' + count;

                    if (storageaccountname == "")
                    {
                        myTask.OutputAssets.AddNew(outputassetnameloc, asset.StorageAccountName, myAssetCreationOptions); // let's use the same storage account than the input asset
                    }
                    else
                    {
                        myTask.OutputAssets.AddNew(outputassetnameloc, storageaccountname, myAssetCreationOptions);
                    }

                    outputAsssetDetailforConcatenate.Add(new ClipConfig { Name = outputassetnameloc, StartTime = config.StartTime, Duration = config.Duration });
                    count++;
                }
                else
                {
                    continue;
                }
            }

            // Submit the job and wait until it is completed.
            bool Error = false;
            try
            {
                myJob.StateChanged += new EventHandler<JobStateChangedEventArgs>(JobStateChanged);
                myJob.Submit();// I am getting exception in this line if the no. of clips are greater then 10.
                myJob.GetExecutionProgressTask(CancellationToken.None);
                outputAssetsList.AddRange(myJob.OutputMediaAssets);

                // Call function to update status in session
                SetStatusValueInSession("Clip generation job has submitted.");

                assetJobId = myJob.Id;
            }

            catch (Exception ex)
            {
                // Add useful information to the exception
                Error = true;
            }

            if (Error)
            {
                assetJobId = "There is error in job process.";
            }
        }

        return assetJobId;
    }

是否有任何限制仅连接10个剪辑或有任何设置来增加no。 Azure Media Service中的剪辑?

1 个答案:

答案 0 :(得分:0)

您的有线XML负载可能会变得太大。您是否可以分享有关“config.Configuration”预设设置XML文件的有效负载的更多详细信息,以及您是否可以使用Fiddler2捕获有线流量并将其发送给我们的团队,这有助于进一步调查此问题。