对于 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);
}
}