gpt4 book ai didi

Azure 媒体服务在编码作业时为 .wmv 文件提供 JobState.Error

转载 作者:行者123 更新时间:2023-12-04 18:12:31 25 4
gpt4 key购买 nike

对于 Azure 媒体服务编码任务,状态多次显示“正在处理...”,然后进入错误状态。没有显示错误消息。我正在关注这个https://www.windowsazure.com/en-us/develop/net/how-to-guides/media-services/#encode-asset输入文件大小小于 4Mb 且 cloudblobclient.ParallelOperationThreadCount = 2

   IJob job = _context.Jobs.Create("My encoding job");
IMediaProcessor processor = GetMediaProcessor(_context,"Windows Azure Media Encoder");
ITask task = job.Tasks.AddNew("My encoding task",processor, "H.264 256k DSL CBR",TaskCreationOptions.ProtectedConfiguration);

task.InputMediaAssets.Add(assetToBeProcessed); //where assetToBeProcessed is the IAsset Ref.
task.OutputMediaAssets.AddNew("Outputasset",true, AssetCreationOptions.StorageEncrypted);
job.Submit();
CheckJobProgress(_context,job.Id);
<小时/>
      private static void CheckJobProgress(CloudMediaContext _context,string jobId)
{
bool jobCompleted = false;
const int JobProgressInterval = 20000;
while (!jobCompleted)
{
IJob theJob = GetJob(_context,jobId); //brings the desired jobid
switch (theJob.State)
{
case JobState.Finished: jobCompleted = true;break;
case JobState.Queued:
case JobState.Scheduled:
case JobState.Processing:
break;
case JobState.Error:
break;
default:
break;
}
Thread.Sleep(JobProgressInterval);
}

}

最佳答案

您可以使用以下代码获取有关作业失败原因的更多信息,您可以通过 ID 查找作业,然后打印其中所有任务的信息。

var context = CloudMediaContext(acc, key);
var job = context.Jobs.Where(j => j.Id == id).Single();

Console.WriteLine(" Job ID: " + job.Id);
Console.WriteLine(" Name: " + job.Name);
Console.WriteLine(" State: " + job.State);

foreach (var task in job.Tasks)
{
Console.WriteLine(" Task Id: " + task.Id);
Console.WriteLine(" Name: " + task.Name);
Console.WriteLine(" Progress: " + task.Progress);
Console.WriteLine(" Configuration: " + task.Configuration);
Console.WriteLine(" Running time: " + task.RunningDuration);
if (task.ErrorDetails != null)
{
foreach (var errordetail in task.ErrorDetails)
{

Console.WriteLine(" Error Message:" + errordetail.Message);
Console.WriteLine(" Error Code:" + errordetail.Code);
}
}
}

关于Azure 媒体服务在编码作业时为 .wmv 文件提供 JobState.Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12329801/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com