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